From: Jan Büren Date: Thu, 14 Jan 2021 13:44:25 +0000 (+0100) Subject: Zu ZB bei Kreditorenbuchung - Vorbelegung Stammdaten Lieferant X-Git-Tag: kivitendo-mebil_0.1-0~9^2~525 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fc131333aacf1d2a42e7faa8c364692e923b12af;p=kivitendo-erp.git Zu ZB bei Kreditorenbuchung - Vorbelegung Stammdaten Lieferant 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 --- 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')") %]