From f5ab83507b71d551147835d84ec8317afd2842e9 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 22 May 2007 10:45:09 +0000 Subject: [PATCH] =?utf8?q?Die=20ausgewiesenen=20Mahngeb=C3=BChren=20gelten?= =?utf8?q?=20pro=20Rechnung,=20nicht=20pro=20erzeugter=20Mahnung,=20auch?= =?utf8?q?=20wenn=20Rechnungen=20in=20einer=20Mahnung=20zusammengefasst=20?= =?utf8?q?werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DN.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SL/DN.pm b/SL/DN.pm index 95ff16ac3..f986421f7 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -211,10 +211,9 @@ sub save_dunning { qq|SELECT cfg.interest_rate, cfg.template AS formname, cfg.email_subject, cfg.email_body, cfg.email_attachment, - (SELECT fee + (SELECT SUM(fee) FROM dunning - WHERE dunning_id = ? - LIMIT 1) + WHERE dunning_id = ?) AS fee, (SELECT SUM(interest) FROM dunning @@ -640,7 +639,11 @@ sub print_dunning { qq|SELECT cfg.interest_rate, cfg.template AS formname, cfg.email_subject, cfg.email_body, cfg.email_attachment, - d.fee, d.transdate AS dunning_date, + d.transdate AS dunning_date, + (SELECT SUM(fee) + FROM dunning + WHERE dunning_id = ?) + AS fee, (SELECT SUM(interest) FROM dunning WHERE dunning_id = ?) @@ -656,7 +659,7 @@ sub print_dunning { LEFT JOIN dunning_config cfg ON (d.dunning_config_id = cfg.id) WHERE d.dunning_id = ? LIMIT 1|; - $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id, $dunning_id, $dunning_id); + $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id, $dunning_id, $dunning_id, $dunning_id); map { $form->{$_} = $ref->{$_} } keys %{ $ref }; $form->{interest_rate} = $form->format_amount($myconfig, $ref->{interest_rate} * 100); -- 2.20.1