Recommit von r1205 von skoehler: Bug 232 - Zahlungsausgang Fehler, falsches Aufsummie...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 22 Nov 2006 16:47:55 +0000 (16:47 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 22 Nov 2006 16:47:55 +0000 (16:47 +0000)
SL/CP.pm

index 341510c..b411b06 100644 (file)
--- 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);