Filter supported subscription cycle types to prevent errors

This commit is contained in:
Andreas Palm 2024-04-25 19:47:32 +02:00
parent c834816e19
commit 05906533dd
2 changed files with 4 additions and 2 deletions

View File

@ -61,6 +61,7 @@ class SubscriptionModule implements SubscriptionModuleInterface
WHERE aa.dokument = :doctype WHERE aa.dokument = :doctype
AND greatest(aa.startdatum, aa.abgerechnetbis) <= :calcdate AND greatest(aa.startdatum, aa.abgerechnetbis) <= :calcdate
AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum) AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum)
AND aa.preisart IN ('monat', 'jahr', '30tage')
AND aa.adresse = :address"; AND aa.adresse = :address";
return $this->db->fetchAll($sql, [ return $this->db->fetchAll($sql, [

View File

@ -70,7 +70,7 @@ class Rechnungslauf {
$calcdate = new \DateTimeImmutable('today'); $calcdate = new \DateTimeImmutable('today');
$scalcdate = $calcdate->format('Y-m-d'); $scalcdate = $calcdate->format('Y-m-d');
$where = " aa.id > 0 $where = " aa.id > 0
AND aa.dokument = '$doctype' AND aa.dokument = '$doctype' AND aa.preisart IN ('monat', 'jahr', '30tage')
AND greatest(aa.startdatum, aa.abgerechnetbis) < '$scalcdate' AND greatest(aa.startdatum, aa.abgerechnetbis) < '$scalcdate'
AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum)"; AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum)";
@ -167,7 +167,8 @@ class Rechnungslauf {
. "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/forward.svg\" border=\"0\"></a>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/forward.svg\" border=\"0\"></a>"
. "&nbsp;</td></tr></table>"; . "&nbsp;</td></tr></table>";
$where = " aa.id > 0 AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum) "; $where = " aa.id > 0 AND aa.preisart IN ('monat', 'jahr', '30tage')
AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum) ";
$sql = "SELECT SQL_CALC_FOUND_ROWS aa.id, ad.name, ad.kundennummer, $sql = "SELECT SQL_CALC_FOUND_ROWS aa.id, ad.name, ad.kundennummer,
aa.bezeichnung, a.nummer, DATE_FORMAT(aa.abgerechnetbis, '%d.%m.%Y'), aa.bezeichnung, a.nummer, DATE_FORMAT(aa.abgerechnetbis, '%d.%m.%Y'),