From cd15b41168a4c4752e89e2a28f47f254d533e5d3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 22 Nov 2006 16:47:55 +0000 Subject: [PATCH] Recommit von r1205 von skoehler: Bug 232 - Zahlungsausgang Fehler, falsches Aufsummieren von Teilzahlungen bei Rechnungen --- SL/CP.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SL/CP.pm b/SL/CP.pm index 341510c55..b411b0608 100644 --- a/SL/CP.pm +++ b/SL/CP.pm @@ -370,10 +370,17 @@ sub process_payment { $pth->finish; $amount += $form->{"paid_$i"}; + + # BUG 324 + if ($form->{arap} eq 'ap') { + $paid = "paid = paid + $amount"; + } else { + $paid = "paid = $amount"; + } # update AR/AP transaction $query = qq|UPDATE $form->{arap} set - paid = $amount, + $paid, datepaid = '$form->{datepaid}' WHERE id = $form->{"id_$i"}|; $dbh->do($query) || $form->dberror($query); -- 2.20.1