diff --git a/Layout/default/Invoice/Index.php b/Layout/default/Invoice/Index.php index 334b80469..93f11902e 100644 --- a/Layout/default/Invoice/Index.php +++ b/Layout/default/Invoice/Index.php @@ -26,7 +26,7 @@ $pagination_entity_name = "Rechnungen";
-
+
@@ -62,10 +62,14 @@ $pagination_entity_name = "Rechnungen";
-
+ +
+ + +
@@ -76,11 +80,11 @@ $pagination_entity_name = "Rechnungen"; -
+
-
+

Rechnungsversand

">
@@ -115,11 +119,6 @@ $pagination_entity_name = "Rechnungen"; diff --git a/application/Invoice/InvoiceController.php b/application/Invoice/InvoiceController.php index c0836d3af..18d354699 100644 --- a/application/Invoice/InvoiceController.php +++ b/application/Invoice/InvoiceController.php @@ -18,6 +18,10 @@ class InvoiceController extends mfBaseController { if(!$this->me->can("Billing")) { $this->redirect("Dashboard"); } + if($this->request->export_type == "bmd-invoice" || $this->request->export_type == "bmd-credit") { + return $this->exportBmdAction(); + } + $this->layout()->setTemplate("Invoice/Index"); if ($this->request->resetFilter) { @@ -593,7 +597,7 @@ class InvoiceController extends mfBaseController { //var_dump($this->request->type);exit; $type = "normal"; - if($this->request->type == "credit") { + if($this->request->export_type == "bmd-credit") { $type = "credit"; } @@ -606,9 +610,20 @@ class InvoiceController extends mfBaseController { } $csv_out = ""; - $filter = [ - "bmd_export_date" => null, - ]; + $filter = []; + if (is_array($this->request->filter)) { + $filter = $this->request->filter; + $_SESSION[MFAPPNAME . '-Invoice-filter'] = $filter; + } else { + if (array_key_exists(MFAPPNAME . '-Invoice-filter', $_SESSION) && count($_SESSION[MFAPPNAME . '-Invoice-filter'])) { + $filter = $_SESSION[MFAPPNAME . '-Invoice-filter']; + } + } + + $this->layout->set("filter", $filter); + $filter = $this->getPreparedFilter($filter); + + $filter["bmd_export_date"] = null; if($type == "credit") { $filter["vatgroup_id"] = TT_VATGROUP_CREDIT; @@ -616,7 +631,7 @@ class InvoiceController extends mfBaseController { $filter["!vatgroup_id"] = TT_VATGROUP_CREDIT; } - + //var_dump($filter);exit; if(!InvoiceModel::search($filter)) { $this->layout()->setFlash("Keine neuen Rechnungen seit letztem BMD-Export vorhanden."); $this->redirect("Invoice");