From e21e2190c9f3b2ff969b7e4159db284c35dd20b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 3 Dec 2020 16:44:22 +0100 Subject: [PATCH] Kreditorenbuchungen: Zahlungsbedingungen in Belegvorlagen --- SL/DB/MetaSetup/RecordTemplate.pm | 6 ++++++ bin/mozilla/ap.pl | 2 ++ sql/Pg-upgrade2/record_template_payment_id.sql | 5 +++++ 3 files changed, 13 insertions(+) create mode 100644 sql/Pg-upgrade2/record_template_payment_id.sql diff --git a/SL/DB/MetaSetup/RecordTemplate.pm b/SL/DB/MetaSetup/RecordTemplate.pm index a9f6f8814..83850fffa 100644 --- a/SL/DB/MetaSetup/RecordTemplate.pm +++ b/SL/DB/MetaSetup/RecordTemplate.pm @@ -23,6 +23,7 @@ __PACKAGE__->meta->columns( 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 }, @@ -62,6 +63,11 @@ __PACKAGE__->meta->foreign_keys( 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' }, diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 8e9e4cae1..8f06776a1 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -130,6 +130,7 @@ sub load_record_template { $::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; @@ -213,6 +214,7 @@ sub save_record_template { 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}, diff --git a/sql/Pg-upgrade2/record_template_payment_id.sql b/sql/Pg-upgrade2/record_template_payment_id.sql new file mode 100644 index 000000000..e251e3dd7 --- /dev/null +++ b/sql/Pg-upgrade2/record_template_payment_id.sql @@ -0,0 +1,5 @@ +-- @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); -- 2.20.1