notes          => { type => 'text' },
   ob_transaction => { type => 'boolean', default => 'false', not_null => 1 },
   ordnumber      => { type => 'text' },
+  payment_id     => { type => 'integer' },
   project_id     => { type => 'integer' },
   reference      => { type => 'text' },
   show_details   => { type => 'boolean', default => 'false', not_null => 1 },
     key_columns => { employee_id => 'id' },
   },
 
+  payment => {
+    class       => 'SL::DB::PaymentTerm',
+    key_columns => { payment_id => 'id' },
+  },
+
   project => {
     class       => 'SL::DB::Project',
     key_columns => { project_id => 'id' },
 
   $::form->{currency}         = $template->currency->name;
   $::form->{direct_debit}     = $template->direct_debit;
   $::form->{globalproject_id} = $template->project_id;
+  $::form->{payment_id}       = $template->payment_id;
   $::form->{AP_chart_id}      = $template->ar_ap_chart_id;
   $::form->{transdate}        = $today->to_kivitendo;
   $::form->{duedate}          = $today->to_kivitendo;
     vendor_id      => $::form->{vendor_id}        || undef,
     department_id  => $::form->{department_id}    || undef,
     project_id     => $::form->{globalproject_id} || undef,
+    payment_id     => $::form->{payment_id}       || undef,
     taxincluded    => $::form->{taxincluded}  ? 1 : 0,
     direct_debit   => $::form->{direct_debit} ? 1 : 0,
     ordnumber      => $::form->{ordnumber},
 
--- /dev/null
+-- @tag: record_template_payment_id
+-- @description: Zahlungsbedingungen in Vorlagen in der Finanzbuchhaltung
+-- @depends: release_3_5_6_1
+
+ALTER TABLE record_templates ADD COLUMN payment_id INTEGER REFERENCES payment_terms(id);