From d18d1460f7f3946de9401d5bd00b382a80042eef Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 25 Apr 2007 10:03:04 +0000 Subject: [PATCH] Kreditlimit von Lieferanten wurde nicht richtig berechnet, wenn neue Rechnungen angelegt wurden. --- SL/IR.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SL/IR.pm b/SL/IR.pm index f51ce4a4b..ec64dc50c 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -1008,7 +1008,8 @@ sub get_vendor { $form->{creditremaining} = $form->{creditlimit}; $query = qq|SELECT SUM(a.amount - a.paid) FROM ap a WHERE a.vendor_id = ?|; - ($form->{creditremaining}) -= selectfirst_array_query($form, $dbh, $query, $form->{vendor_id}); + my ($unpaid_invoices) = selectfirst_array_query($form, $dbh, $query, $form->{vendor_id}); + $form->{creditremaining} -= $unpaid_invoices; $query = qq|SELECT o.amount, (SELECT e.sell FROM exchangerate e -- 2.20.1