From 150381a20f4be5eb7c829f69ec06bb4f72e868a6 Mon Sep 17 00:00:00 2001 From: Andreas Palm Date: Tue, 19 Sep 2023 13:59:38 +0200 Subject: [PATCH] Enable "Zahlzyklus" in "Abolauf" --- classes/Modules/SubscriptionCycle/SubscriptionModule.php | 4 ++-- www/pages/rechnungslauf.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Modules/SubscriptionCycle/SubscriptionModule.php b/classes/Modules/SubscriptionCycle/SubscriptionModule.php index ef31098a..d672c6a3 100644 --- a/classes/Modules/SubscriptionCycle/SubscriptionModule.php +++ b/classes/Modules/SubscriptionCycle/SubscriptionModule.php @@ -31,14 +31,14 @@ class SubscriptionModule implements SubscriptionModuleInterface aa.id, @start := GREATEST(aa.startdatum, aa.abgerechnetbis) as start, @end := IF(aa.enddatum = '0000-00-00' OR aa.enddatum > :calcdate, :calcdate, aa.enddatum) as end, - @cycles := CASE + @cycles := GREATEST(aa.zahlzyklus, CASE WHEN aa.preisart = 'monat' THEN TIMESTAMPDIFF(MONTH, @start, @end) WHEN aa.preisart = 'jahr' THEN TIMESTAMPDIFF(YEAR, @start, @end) WHEN aa.preisart = '30tage' THEN FLOOR(TIMESTAMPDIFF(DAY, @start, @end) / 30) - END+1 as cycles, + END+1) as cycles, CASE WHEN aa.preisart = 'monat' THEN DATE_ADD(@start, INTERVAL @cycles MONTH) diff --git a/www/pages/rechnungslauf.php b/www/pages/rechnungslauf.php index dcb0313a..e09e1f89 100644 --- a/www/pages/rechnungslauf.php +++ b/www/pages/rechnungslauf.php @@ -94,7 +94,7 @@ class Rechnungslauf { DATE_ADD(@start, INTERVAL (FLOOR(TIMESTAMPDIFF(DAY, @start, IF(aa.enddatum = '0000-00-00' OR aa.enddatum > '$scalcdate', '$scalcdate', aa.enddatum)) / 30)+1)*30 DAY ) END, '%d.%m.%Y') SEPARATOR '
') as end, SUM((100-aa.rabatt)/100 * aa.preis * aa.menge * - (CASE + (GREATEST(aa.zahlzyklus, CASE WHEN aa.preisart = 'monat' THEN TIMESTAMPDIFF(MONTH, @start, @end) WHEN aa.preisart = 'jahr' THEN @@ -102,7 +102,7 @@ class Rechnungslauf { WHEN aa.preisart = '30tage' THEN FLOOR(TIMESTAMPDIFF(DAY, @start, @end) / 30) END - ) + )) ) as amount, adr.id FROM abrechnungsartikel aa