From 260b9dfda84163c18d1f9c7411aa3094b6ad95ee Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 17 Apr 2024 17:45:07 +0000 Subject: [PATCH] fix templates --- Admin/Install/Navigation.install.json | 12 +++--- Controller/BackendController.php | 40 +++++++++---------- Theme/Backend/bill-create.tpl.php | 6 +-- .../finance-taxcombination-list.tpl.php | 17 ++++---- Theme/Backend/payment-view.tpl.php | 4 +- Theme/Backend/purchase-bill-list.tpl.php | 4 +- Theme/Backend/purchase-bill.tpl.php | 6 +-- Theme/Backend/sales-bill-list.tpl.php | 4 +- Theme/Backend/shipping-view.tpl.php | 4 +- 9 files changed, 48 insertions(+), 49 deletions(-) diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 7a69e4b..fd4a60e 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -60,7 +60,7 @@ }, { "id": 1005104401, - "pid": "/sales/bill", + "pid": "/bill/payment", "type": 3, "subtype": 1, "name": "PaymentTerms", @@ -75,7 +75,7 @@ }, { "id": 1005104501, - "pid": "/sales/bill", + "pid": "/bill/shipping", "type": 3, "subtype": 1, "name": "ShippingTerms", @@ -258,7 +258,7 @@ "children": [ { "id": 1005109101, - "pid": "/", + "pid": "/private/purchase/recognition", "type": 3, "subtype": 1, "name": "List", @@ -274,7 +274,7 @@ }, { "id": 1005109201, - "pid": "/", + "pid": "/private/purchase/recognition", "type": 3, "subtype": 1, "name": "Upload", @@ -306,7 +306,7 @@ "children": [ { "id": 1005110101, - "pid": "/", + "pid": "/purchase/recognition", "type": 3, "subtype": 1, "name": "List", @@ -322,7 +322,7 @@ }, { "id": 1005110201, - "pid": "/", + "pid": "/purchase/recognition", "type": 3, "subtype": 1, "name": "Upload", diff --git a/Controller/BackendController.php b/Controller/BackendController.php index e27bc6a..6f2af92 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -68,7 +68,7 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response); - $mapperQuery = BillMapper::getAll() + $view->data['bills'] = BillMapper::getAll() ->with('type') ->with('type/l11n') ->with('client') @@ -78,17 +78,13 @@ final class BackendController extends Controller ->sort('id', OrderType::DESC) ->where('unit', $this->app->unitId) ->where('client', null, '!=') - ->limit(25); - - if ($request->getData('ptype') === 'p') { - $mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '<'); - } elseif ($request->getData('ptype') === 'n') { - $mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '>'); - } else { - $mapperQuery->where('id', 0, '>'); - } - - $view->data['bills'] = $mapperQuery->execute(); + ->limit(25) + ->paginate( + 'id', + $request->getData('ptype'), + $request->getDataInt('offset') + ) + ->execute(); return $view; } @@ -486,13 +482,15 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response); - if ($request->getData('ptype') === 'p') { - $view->data['bills'] = BillMapper::getAll()->where('id', $request->getDataInt('offset') ?? 0, '<')->where('unit', $this->app->unitId)->limit(25)->executeGetArray(); - } elseif ($request->getData('ptype') === 'n') { - $view->data['bills'] = BillMapper::getAll()->where('id', $request->getDataInt('offset') ?? 0, '>')->where('unit', $this->app->unitId)->limit(25)->executeGetArray(); - } else { - $view->data['bills'] = BillMapper::getAll()->where('id', 0, '>')->where('unit', $this->app->unitId)->limit(25)->executeGetArray(); - } + $view->data['bills'] = BillMapper::getAll() + ->where('unit', $this->app->unitId) + ->limit(25) + ->paginate( + 'id', + $request->getData('ptype'), + $request->getDataInt('offset') + ) + ->executeGetArray(); return $view; } @@ -692,7 +690,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Billing/Theme/Backend/payment-view'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002901101, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response); $view->data['type'] = PaymentTermMapper::get() ->with('l11n') @@ -754,7 +752,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Billing/Theme/Backend/shipping-view'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002901101, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response); $view->data['type'] = ShippingTermMapper::get() ->with('l11n') diff --git a/Theme/Backend/bill-create.tpl.php b/Theme/Backend/bill-create.tpl.php index 6c53b22..3c5e46e 100755 --- a/Theme/Backend/bill-create.tpl.php +++ b/Theme/Backend/bill-create.tpl.php @@ -354,7 +354,7 @@ echo $this->data['nav']->render(); ?> > - + > > > @@ -555,7 +555,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Logs'); ?>download
@@ -585,7 +585,7 @@ echo $this->data['nav']->render(); ?>
createdAt->format('Y-m-d H:i'); ?>
-
+
diff --git a/Theme/Backend/finance-taxcombination-list.tpl.php b/Theme/Backend/finance-taxcombination-list.tpl.php index 518e22e..2144e8c 100644 --- a/Theme/Backend/finance-taxcombination-list.tpl.php +++ b/Theme/Backend/finance-taxcombination-list.tpl.php @@ -26,7 +26,7 @@ $next = empty($taxcombination) ? '{/base}/finance/tax/combination/list' : '{ echo $this->data['nav']->render(); ?>
-
+
getHtml('TaxCombinations'); ?>download
@@ -61,12 +61,13 @@ echo $this->data['nav']->render(); ?>
getHtml('Empty', '0', '0'); ?> -
- + + +
diff --git a/Theme/Backend/payment-view.tpl.php b/Theme/Backend/payment-view.tpl.php index 072775f..5fb9110 100644 --- a/Theme/Backend/payment-view.tpl.php +++ b/Theme/Backend/payment-view.tpl.php @@ -21,7 +21,7 @@ $type = $this->data['type']; echo $this->data['nav']->render(); ?>
-
+
data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/purchase-bill-list.tpl.php b/Theme/Backend/purchase-bill-list.tpl.php index 589ac22..6393246 100755 --- a/Theme/Backend/purchase-bill-list.tpl.php +++ b/Theme/Backend/purchase-bill-list.tpl.php @@ -20,7 +20,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Bills'); ?>download
@@ -191,6 +191,6 @@ echo $this->data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/purchase-bill.tpl.php b/Theme/Backend/purchase-bill.tpl.php index d0d1d6b..fa086fe 100755 --- a/Theme/Backend/purchase-bill.tpl.php +++ b/Theme/Backend/purchase-bill.tpl.php @@ -352,7 +352,7 @@ echo $this->data['nav']->render(); ?> > - + > > > @@ -573,7 +573,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Logs'); ?>download
@@ -603,7 +603,7 @@ echo $this->data['nav']->render(); ?>
createdAt->format('Y-m-d H:i'); ?>
-
+
diff --git a/Theme/Backend/sales-bill-list.tpl.php b/Theme/Backend/sales-bill-list.tpl.php index 90124cc..67ff78e 100755 --- a/Theme/Backend/sales-bill-list.tpl.php +++ b/Theme/Backend/sales-bill-list.tpl.php @@ -20,7 +20,7 @@ echo $this->data['nav']->render(); ?>
-
+
getHtml('Bills'); ?>download
@@ -190,6 +190,6 @@ echo $this->data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/shipping-view.tpl.php b/Theme/Backend/shipping-view.tpl.php index 6f7a540..480e744 100644 --- a/Theme/Backend/shipping-view.tpl.php +++ b/Theme/Backend/shipping-view.tpl.php @@ -21,7 +21,7 @@ $type = $this->data['type']; echo $this->data['nav']->render(); ?>
-
+
data['nav']->render(); ?>
-
+