From f47c2cd1dcbf2423d797d16a6e282be5163a398d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 7 Feb 2013 15:42:32 +0100 Subject: [PATCH] =?utf8?q?Einkaufsrechnungen:=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/PurchaseInvoice.pm | 1 + SL/IR.pm | 7 ++++--- locale/de/all | 1 + sql/Pg-upgrade2/ap_add_direct_debit.sql | 7 +++++++ templates/webpages/ir/form_footer.html | 5 +++++ 5 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 sql/Pg-upgrade2/ap_add_direct_debit.sql diff --git a/SL/DB/MetaSetup/PurchaseInvoice.pm b/SL/DB/MetaSetup/PurchaseInvoice.pm index 309884c68..bee7eb2ae 100644 --- a/SL/DB/MetaSetup/PurchaseInvoice.pm +++ b/SL/DB/MetaSetup/PurchaseInvoice.pm @@ -43,6 +43,7 @@ __PACKAGE__->meta->setup( globalproject_id => { type => 'integer' }, transaction_description => { type => 'text' }, storno_id => { type => 'integer' }, + direct_debit => { type => 'boolean', default => 'false' }, ], primary_key_columns => [ 'id' ], diff --git a/SL/IR.pm b/SL/IR.pm index e1d1011aa..bd8bd591d 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -658,7 +658,7 @@ sub post_invoice { invoice = ?, taxzone_id = ?, notes = ?, taxincluded = ?, intnotes = ?, curr = ?, storno_id = ?, storno = ?, cp_id = ?, employee_id = ?, department_id = ?, - globalproject_id = ? + globalproject_id = ?, direct_debit = ? WHERE id = ?|; @values = ( $form->{invnumber}, $form->{ordnumber}, $form->{quonumber}, conv_date($form->{invdate}), @@ -668,6 +668,7 @@ sub post_invoice { $form->{intnotes}, $form->{currency}, conv_i($form->{storno_id}), $form->{storno} ? 't' : 'f', conv_i($form->{cp_id}), conv_i($form->{employee_id}), conv_i($form->{department_id}), conv_i($form->{globalproject_id}), + $form->{direct_debit} ? 't' : 'f', conv_i($form->{id}) ); do_query($form, $dbh, $query, @values); @@ -911,7 +912,7 @@ sub retrieve_invoice { $query = qq|SELECT cp_id, invnumber, transdate AS invdate, duedate, orddate, quodate, globalproject_id, ordnumber, quonumber, paid, taxincluded, notes, taxzone_id, storno, gldate, - intnotes, curr AS currency + intnotes, curr AS currency, direct_debit FROM ap WHERE id = ?|; $ref = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id})); @@ -1061,7 +1062,7 @@ sub get_vendor { v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount, v.creditlimit, v.terms, v.notes AS intnotes, v.email, v.cc, v.bcc, v.language_id, v.payment_id, - v.street, v.zipcode, v.city, v.country, v.taxzone_id, v.curr, + v.street, v.zipcode, v.city, v.country, v.taxzone_id, v.curr, v.direct_debit, $duedate + COALESCE(pt.terms_netto, 0) AS duedate, b.description AS business FROM vendor v diff --git a/locale/de/all b/locale/de/all index b05f929d2..10942f558 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1380,6 +1380,7 @@ $self->{texts} = { 'Password' => 'Passwort', 'Payables' => 'Verbindlichkeiten', 'Payment' => 'Zahlungsausgang', + 'Payment Options' => 'Zahlungsoptionen', 'Payment Reminder' => 'Zahlungserinnerung', 'Payment Terms' => 'Zahlungsbedingungen', 'Payment Terms missing in row ' => 'Zahlungsfrist fehlt in Zeile ', diff --git a/sql/Pg-upgrade2/ap_add_direct_debit.sql b/sql/Pg-upgrade2/ap_add_direct_debit.sql new file mode 100644 index 000000000..662b1c313 --- /dev/null +++ b/sql/Pg-upgrade2/ap_add_direct_debit.sql @@ -0,0 +1,7 @@ +-- @tag: ap_add_direct_debit +-- @description: Spalte für Bankeinzug bei Einkaufsrechnungen +-- @depends: release_3_0_0 +-- @charset: utf-8 +ALTER TABLE ap ADD COLUMN direct_debit boolean; +ALTER TABLE ap ALTER COLUMN direct_debit SET DEFAULT FALSE; +UPDATE ap SET direct_debit = FALSE; diff --git a/templates/webpages/ir/form_footer.html b/templates/webpages/ir/form_footer.html index 06350eaf0..5b66f7031 100644 --- a/templates/webpages/ir/form_footer.html +++ b/templates/webpages/ir/form_footer.html @@ -1,6 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE LxERP %] +[%- USE L %] @@ -10,6 +11,7 @@ + + [%- IF id && follow_ups.size %] -- 2.20.1
[% 'Notes' | $T8 %] [% 'Internal Notes' | $T8 %][% 'Payment Options' | $T8 %]
@@ -18,6 +20,9 @@ + [%- L.checkbox_tag('direct_debit', 'checked', direct_debit, 'label', LxERP.t8('direct debit')) %] +