From fc131333aacf1d2a42e7faa8c364692e923b12af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 14 Jan 2021 14:44:25 +0100 Subject: [PATCH] Zu ZB bei Kreditorenbuchung - Vorbelegung Stammdaten Lieferant MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Falls kein invoice_obj vorhanden, wieder auf form->payment_id gehen, da hier die Werte aus den Stammdaten des Lieferanten vorbelegt sind (!) Jetzt müssten alle Fälle passen: 1. Gespeicherte Werte anzeigen, auch bei ungültigen ZB 2. Lieferanten-Werte aus Stammdaten übernehmen 3. Lieferanten-Werte beim Wechsel des Lieferanten übernehmen --- bin/mozilla/ap.pl | 3 ++- templates/webpages/ap/form_header.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 8558f3841..65ccc4b1b 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -561,10 +561,11 @@ sub form_header { $form->{paid_missing} = $form->{invtotal_unformatted} - $form->{totalpaid}; + $form->{payment_id} = $form->{invoice_obj}->{payment_id} // $form->{payment_id}; 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->{invoice_obj}->{payment_id}*1 ]]), + payment_terms => SL::DB::Manager::PaymentTerm->get_all_sorted(query => [ or => [ obsolete => 0, id => $form->{payment_id}*1 ]]), }); $main::lxdebug->leave_sub(); diff --git a/templates/webpages/ap/form_header.html b/templates/webpages/ap/form_header.html index 582b64958..2f22a96f2 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=invoice_obj.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=payment_id, title_key='description', with_empty=1, style="width: 250px", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('invdate')") %] -- 2.20.1