From ea13b69d6d3a70c5432ae6b6d29a0a0531e51da9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 14 Jan 2021 14:04:24 +0100 Subject: [PATCH] Zahlungsbedingungen Kreditorenbeleg Speichern und Laden in Maske Das was Commit 8b5bed7fe5 versprochen hat, jetzt auch in Echt ;-) --- SL/AP.pm | 3 ++- bin/mozilla/ap.pl | 2 +- templates/webpages/ap/form_header.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index 71c2b4b00..69a2a0a0c 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -141,7 +141,7 @@ sub _post_transaction { transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?, amount = ?, duedate = ?, deliverydate = ?, tax_point = ?, paid = ?, netamount = ?, currency_id = (SELECT id FROM currencies WHERE name = ?), notes = ?, department_id = ?, storno = ?, storno_id = ?, - globalproject_id = ?, direct_debit = ? + globalproject_id = ?, direct_debit = ?, payment_id = ? WHERE id = ?|; @values = ($form->{invnumber}, conv_date($form->{transdate}), $form->{ordnumber}, conv_i($form->{vendor_id}), @@ -152,6 +152,7 @@ sub _post_transaction { conv_i($form->{department_id}), $form->{storno}, $form->{storno_id}, conv_i($form->{globalproject_id}), $form->{direct_debit} ? 't' : 'f', + $form->{payment_id}, $form->{id}); do_query($form, $dbh, $query, @values); diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index afc2ab558..8558f3841 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -564,7 +564,7 @@ sub form_header { print $form->parse_html_template('ap/form_header', { today => DateTime->today, currencies => SL::DB::Manager::Currency->get_all_sorted, - payment_terms => SL::DB::Manager::PaymentTerm->get_all_sorted(query => [ or => [ obsolete => 0, id => $::form->{payment_id}*1 ]]), + payment_terms => SL::DB::Manager::PaymentTerm->get_all_sorted(query => [ or => [ obsolete => 0, id => $form->{invoice_obj}->{payment_id}*1 ]]), }); $main::lxdebug->leave_sub(); diff --git a/templates/webpages/ap/form_header.html b/templates/webpages/ap/form_header.html index 2f22a96f2..582b64958 100644 --- a/templates/webpages/ap/form_header.html +++ b/templates/webpages/ap/form_header.html @@ -252,7 +252,7 @@ [% L.textarea_tag("intnotes", intnotes, wrap="soft", rows=textarea_rows, cols=50, readonly=readonly) %] - [% L.select_tag('payment_id', payment_terms, default=payment_id, title_key='description', with_empty=1, style="width: 250px", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('invdate')") %] + [% L.select_tag('payment_id', payment_terms, default=invoice_obj.payment_id, title_key='description', with_empty=1, style="width: 250px", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('invdate')") %] -- 2.20.1