Browse code

set abbuchung=1 for old invoices when a new SEPA mandate is valid in the past.

Bernd Wurst authored on24/08/2021 08:44:14
Showing1 changed files
... ...
@@ -252,6 +252,8 @@ function sepamandat($name, $adresse, $iban, $bankname, $bic, $gueltig_ab)
252 252
                 ":today" => $today, ":gueltig_ab" => $gueltig_ab, ":name" => $name, ":adresse" => $adresse,
253 253
                 ":iban" => $iban, ":bic" => $bic, ":bankname" => $bankname)
254 254
     );
255
+    db_query("UPDATE kundendaten.ausgestellte_rechnungen SET abbuchung=1 WHERE kunde = :cid AND datum >= :gueltig_ab",
256
+        array(":cid" => $cid, ":gueltig_ab" => $gueltig_ab));
255 257
 }
256 258
 
257 259