From 356fec7ed87236e0b68c0ef45fe5f99c8b1f5038 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 7 Mar 2019 12:32:46 +0100 Subject: [PATCH] Kosmetik, Kommentar verbessert, toter Code entfernt --- SL/DB/Helper/Payment.pm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/SL/DB/Helper/Payment.pm b/SL/DB/Helper/Payment.pm index 1309540c0..31795cccb 100644 --- a/SL/DB/Helper/Payment.pm +++ b/SL/DB/Helper/Payment.pm @@ -123,8 +123,8 @@ sub pay_invoice { my $new_acc_trans; # all three payment type create 1 AR/AP booking (the paid part) - # difference_as_skonto creates n skonto bookings (1 for each tax type) - # with_skonto_pt creates 1 bank booking and n skonto bookings (1 for each tax type) + # difference_as_skonto creates n skonto bookings (1 for each buchungsgruppe type) + # with_skonto_pt creates 1 bank booking and n skonto bookings (1 for each buchungsgruppe type) # without_skonto creates 1 bank booking # as long as there is no automatic tax, payments are always booked with @@ -196,9 +196,9 @@ sub pay_invoice { $new_acc_trans->save; push @new_acc_ids, $new_acc_trans->acc_trans_id; - }; - }; - }; + } + } + } if ( $params{payment_type} eq 'difference_as_skonto' or $params{payment_type} eq 'with_skonto_pt' ) { @@ -244,8 +244,7 @@ sub pay_invoice { if ( $params{payment_type} eq 'difference_as_skonto' ) { die "difference_as_skonto calculated incorrectly, sum of calculated payments doesn't add up to open amount $total_open_amount, reference_amount = $reference_amount\n" unless _round($reference_amount) == 0; } - - }; + } my $arap_amount = 0; @@ -258,7 +257,7 @@ sub pay_invoice { # with_skonto_pt for completely unpaid invoices we just use the value # from the invoice $arap_amount = $total_open_amount; - }; + } # regardless of payment_type there is always only exactly one arap booking # TODO: compare $arap_amount to running total @@ -447,8 +446,6 @@ sub amount_less_skonto { # the result is rounded so we can directly compare it with the user input my $self = shift; - my $is_sales = ref($self) eq 'SL::DB::Invoice'; - my $percent_skonto = $self->percent_skonto || 0; return _round($self->amount - ( $self->amount * $percent_skonto) ); -- 2.20.1