From 07e01856fbef2494905b7ce82a32c02ddf8128a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 20 Dec 2021 15:50:48 +0100 Subject: [PATCH] Anzahlungs-Rg.: Druckvariblen: offenen Betrag jeder Anzahlungs-Rg. und Summe --- SL/IS.pm | 30 ++++++++++++++++++------------ templates/print/marei/invoice.tex | 4 ++-- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/SL/IS.pm b/SL/IS.pm index c667c0f2a..8b79376d2 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -586,18 +586,24 @@ sub invoice_details { my %pat = $invoice_for_advance_payment->calculate_prices_and_taxes; my $taxamount = sum0 values %{ $pat{taxes_by_tax_id} }; - push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_$_"} }, $invoice_for_advance_payment->$_) for qw(invnumber transdate); - push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_amount_nofmt"} }, $invoice_for_advance_payment->amount); - push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_amount"} }, $invoice_for_advance_payment->amount_as_number); - push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_taxamount_nofmt"} }, $taxamount); - push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_taxamount"} }, $form->format_amount($myconfig, $taxamount, 2)); - - $form->{iap_amount_nofmt} += $invoice_for_advance_payment->amount; - $form->{iap_taxamount_nofmt} += $taxamount; - $form->{iap_existing} = 1; - } - $form->{iap_amount} = $form->format_amount($myconfig, $form->{iap_amount_nofmt}, 2); - $form->{iap_taxamount} = $form->format_amount($myconfig, $form->{iap_taxamount_nofmt}, 2); + push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_$_"} }, $invoice_for_advance_payment->$_) for qw(invnumber transdate); + push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_amount_nofmt"} }, $invoice_for_advance_payment->amount); + push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_amount"} }, $invoice_for_advance_payment->amount_as_number); + push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_taxamount_nofmt"} }, $taxamount); + push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_taxamount"} }, $form->format_amount($myconfig, $taxamount, 2)); + + my $open_amount = $form->round_amount($invoice_for_advance_payment->open_amount, 2); + push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_open_amount_nofmt"} }, $open_amount); + push(@{ $form->{TEMPLATE_ARRAYS}->{"iap_open_amount"} }, $form->format_amount($myconfig, $open_amount, 2)); + + $form->{iap_amount_nofmt} += $invoice_for_advance_payment->amount; + $form->{iap_taxamount_nofmt} += $taxamount; + $form->{iap_open_amount_nofmt} += $open_amount; + $form->{iap_existing} = 1; + } + $form->{iap_amount} = $form->format_amount($myconfig, $form->{iap_amount_nofmt}, 2); + $form->{iap_taxamount} = $form->format_amount($myconfig, $form->{iap_taxamount_nofmt}, 2); + $form->{iap_open_amount} = $form->format_amount($myconfig, $form->{iap_open_amount_nofmt}, 2); $main::lxdebug->leave_sub(); } diff --git a/templates/print/marei/invoice.tex b/templates/print/marei/invoice.tex index 9b988e985..48f2cbaa5 100644 --- a/templates/print/marei/invoice.tex +++ b/templates/print/marei/invoice.tex @@ -158,10 +158,10 @@ <%if iap_existing%>% Es sind folgende Anzahlungsrechnungen vorhanden:\\ <%foreach iap_invnumber%>% - <%iap_invnumber%> <%iap_invdate%> <%iap_amount%> <%iap_taxamount%>\\% + <%iap_invnumber%> <%iap_invdate%> <%iap_amount%> <%iap_taxamount%> (offen: <%iap_open_amount%>)\\% <%end iap_invnumber%>% Die Summen sind:\\ - \bfseries <%iap_amount%> \bfseries <%iap_taxamount%>\\% + \bfseries <%iap_amount%> \bfseries <%iap_taxamount%> (offen: <%iap_open_amount%>)\\% <%end iap_available%>% \Ifstr{<%deliverydate%>}{}{% -- 2.20.1