diff --git a/application/Invoice/InvoiceController.php b/application/Invoice/InvoiceController.php index 18d354699..00debe869 100644 --- a/application/Invoice/InvoiceController.php +++ b/application/Invoice/InvoiceController.php @@ -623,7 +623,7 @@ class InvoiceController extends mfBaseController { $this->layout->set("filter", $filter); $filter = $this->getPreparedFilter($filter); - $filter["bmd_export_date"] = null; + //$filter["bmd_export_date"] = null; if($type == "credit") { $filter["vatgroup_id"] = TT_VATGROUP_CREDIT; @@ -691,6 +691,14 @@ class InvoiceController extends mfBaseController { $mandatskz = ($last_invoice_date ? "1" : "0"); + $three_years_ago = new DateTime("now"); + $three_years_ago->modify("-3 years"); + + if($mandatskz == "0") { + while($sepa_date->format("Y-m-d") < $three_years_ago->format("Y-m-d")) { + $sepa_date->modify("+1 year"); + } + } }