From a523371da37bbce8a103a9db97a5daecd4773c59 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 10 Jan 2013 13:03:34 +0100 Subject: [PATCH] =?utf8?q?Verkaufsrechnungen:=20Checkbox=20f=C3=BCr=20"Las?= =?utf8?q?tschrifteinzug";=20Vorbelegung=20aus=20Stammdaten?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/MetaSetup/Invoice.pm | 1 + SL/IS.pm | 8 ++++---- locale/de/all | 2 +- sql/Pg-upgrade2/ar_add_direct_debit.sql | 7 +++++++ templates/webpages/is/form_footer.html | 3 +++ 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 sql/Pg-upgrade2/ar_add_direct_debit.sql diff --git a/SL/DB/MetaSetup/Invoice.pm b/SL/DB/MetaSetup/Invoice.pm index 854b9c7e3..839c67bfe 100644 --- a/SL/DB/MetaSetup/Invoice.pm +++ b/SL/DB/MetaSetup/Invoice.pm @@ -56,6 +56,7 @@ __PACKAGE__->meta->setup( marge_percent => { type => 'numeric', precision => 5, scale => 15 }, donumber => { type => 'text' }, invnumber_for_credit_note => { type => 'text' }, + direct_debit => { type => 'boolean', default => 'false' }, ], primary_key_columns => [ 'id' ], diff --git a/SL/IS.pm b/SL/IS.pm index 13b86fb4b..b8dd8ee6e 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1017,7 +1017,7 @@ sub post_invoice { cp_id = ?, marge_total = ?, marge_percent = ?, globalproject_id = ?, delivery_customer_id = ?, transaction_description = ?, delivery_vendor_id = ?, - donumber = ?, invnumber_for_credit_note = ? + donumber = ?, invnumber_for_credit_note = ?, direct_debit = ? WHERE id = ?|; @values = ( $form->{"invnumber"}, $form->{"ordnumber"}, $form->{"quonumber"}, $form->{"cusordnumber"}, conv_date($form->{"invdate"}), conv_date($form->{"orddate"}), conv_date($form->{"quodate"}), conv_i($form->{"customer_id"}), @@ -1030,7 +1030,7 @@ sub post_invoice { conv_i($form->{"cp_id"}), 1 * $form->{marge_total} , 1 * $form->{marge_percent}, conv_i($form->{"globalproject_id"}), conv_i($form->{"delivery_customer_id"}), $form->{transaction_description}, conv_i($form->{"delivery_vendor_id"}), - $form->{"donumber"}, $form->{"invnumber_for_credit_note"}, + $form->{"donumber"}, $form->{"invnumber_for_credit_note"}, $form->{direct_debit} ? 't' : 'f', conv_i($form->{"id"})); do_query($form, $dbh, $query, @values); @@ -1508,7 +1508,7 @@ sub retrieve_invoice { a.employee_id, a.salesman_id, a.payment_id, a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type, a.transaction_description, a.donumber, a.invnumber_for_credit_note, - a.marge_total, a.marge_percent, + a.marge_total, a.marge_percent, a.direct_debit, e.name AS employee FROM ar a LEFT JOIN employee e ON (e.id = a.employee_id) @@ -1684,7 +1684,7 @@ sub get_customer { c.email, c.cc, c.bcc, c.language_id, c.payment_id, c.street, c.zipcode, c.city, c.country, c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, c.curr, - c.taxincluded_checked, + c.taxincluded_checked, c.direct_debit, $duedate + COALESCE(pt.terms_netto, 0) AS duedate, b.discount AS tradediscount, b.description AS business FROM customer c diff --git a/locale/de/all b/locale/de/all index ce6525e4b..cf6eafcba 100644 --- a/locale/de/all +++ b/locale/de/all @@ -2333,7 +2333,7 @@ $self->{texts} = { 'delete' => 'Löschen', 'delivered' => 'geliefert', 'deliverydate' => 'Lieferdatum', - 'direct debit' => 'Lastschrift', + 'direct debit' => 'Lastschrifteinzug', 'disposed' => 'Entsorgung', 'do not include' => 'Nicht aufnehmen', 'done' => 'erledigt', diff --git a/sql/Pg-upgrade2/ar_add_direct_debit.sql b/sql/Pg-upgrade2/ar_add_direct_debit.sql new file mode 100644 index 000000000..c4b4842e4 --- /dev/null +++ b/sql/Pg-upgrade2/ar_add_direct_debit.sql @@ -0,0 +1,7 @@ +-- @tag: ar_add_direct_debit +-- @description: Spalte für Bankeinzug bei Verkaufsrechnungen +-- @depends: release_3_0_0 +-- @charset: utf-8 +ALTER TABLE ar ADD COLUMN direct_debit boolean; +ALTER TABLE ar ALTER COLUMN direct_debit SET DEFAULT FALSE; +UPDATE ar SET direct_debit = FALSE; diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index deccd790f..79bbdb162 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -1,6 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE LxERP %] +[%- USE L %] @@ -29,6 +30,8 @@ show_empty = 1 allow_textbox = 0 -%] +
+ [%- L.checkbox_tag('direct_debit', 'checked', direct_debit, 'label', LxERP.t8('direct debit')) %] [%- IF id && follow_ups.size %] -- 2.20.1