From 044c37079706d192669ed062e464a55d0ecb38f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 10 Nov 2021 16:31:03 +0100 Subject: [PATCH] Anzahlungs-Rg.: Buchen auf Verrechnungskonto ohne Steuer --- SL/IS.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SL/IS.pm b/SL/IS.pm index 9474b18e0..f64d92996 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -51,6 +51,7 @@ use SL::MoreCommon; use SL::IC; use SL::IO; use SL::TransNumber; +use SL::DB::Chart; use SL::DB::Default; use SL::DB::Draft; use SL::DB::Tax; @@ -776,6 +777,10 @@ sub _post_invoice { my $basefactor; my $baseqty; + if ($form->{type} eq 'invoice_for_advance_payment') { + $form->{"income_accno_$i"} = SL::DB::Chart->new(id => $::instance_conf->get_advance_payment_clearing_chart_id)->load->accno; + } + $form->{"marge_percent_$i"} = $form->parse_amount($myconfig, $form->{"marge_percent_$i"}) * 1; $form->{"marge_absolut_$i"} = $form->parse_amount($myconfig, $form->{"marge_absolut_$i"}) * 1; $form->{"lastcost_$i"} = $form->parse_amount($myconfig, $form->{"lastcost_$i"}) * 1; @@ -1010,6 +1015,16 @@ SQL } } + if ($form->{type} eq 'invoice_for_advance_payment') { + # invoice for advance payment show tax but does not account it. + # tax has to be accounted on payment + foreach my $item (split(/ /, $form->{taxaccounts})) { + delete $form->{amount}{ $form->{id} }{$item}; + } + + $tax = 0; + } + # Invoice Summary includes Rounding my $grossamount = $netamount + $tax; my $rounding = $form->round_amount( -- 2.20.1