Mahnzinsen anhand des Fälligkeitsdatums berechnen
authorJoachim Zach <info@ceos-gmbh.de>
Mon, 27 Dec 2010 13:41:31 +0000 (14:41 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 27 Dec 2010 13:41:31 +0000 (14:41 +0100)
Fix für Bug 1384.

Signed-off-by: Moritz Bunkus <m.bunkus@linet-services.de>
SL/DN.pm

index 72154c2..45bc367 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -288,7 +288,7 @@ sub save_dunning {
                (SELECT SUM(fee)
                 FROM dunning_config
                 WHERE dunning_level <= (SELECT dunning_level FROM dunning_config WHERE id = ?)),
-               (SELECT (amount - paid) * (current_date - transdate) FROM ar WHERE id = ?)
+               (SELECT (amount - paid) * (current_date - duedate) FROM ar WHERE id = ?)
                  * (SELECT interest_rate FROM dunning_config WHERE id = ?)
                  / 360,
                current_date,