From c968275e34c545244fe5a41f126c414c7f36c3cd Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 2 Jan 2024 23:34:17 +0000 Subject: [PATCH] update --- Admin/Install/Navigation.install.json | 210 ++++++++++++++++++++++ Admin/Routes/Web/Backend.php | 154 ++++++++++++++++ Controller/BackendController.php | 20 ++- Models/PermissionState.php | 2 +- Theme/Backend/budgeting-dashboard.tpl.php | 144 +++++++++++++++ info.json | 1 - 6 files changed, 528 insertions(+), 3 deletions(-) diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 4ba5e77..f5df665 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -27,6 +27,216 @@ "permission": { "permission": 2, "type": null, "element": null }, "parent": 1004601001, "children": [] + }, + { + "id": 1004602002, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "IncomeStatement", + "uri": "{/base}/controlling/budget/pl?{?}", + "target": "self", + "icon": null, + "order": 2, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004602003, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Balance", + "uri": "{/base}/controlling/budget/balance?{?}", + "target": "self", + "icon": null, + "order": 3, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004603001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Sales", + "uri": "{/base}/controlling/budget/sales?{?}", + "target": "self", + "icon": null, + "order": 5, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004604001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Material", + "uri": "{/base}/controlling/budget/material?{?}", + "target": "self", + "icon": null, + "order": 10, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004605001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "OPEX", + "uri": "{/base}/controlling/budget/opex?{?}", + "target": "self", + "icon": null, + "order": 15, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004605002, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Marketing", + "uri": "{/base}/controlling/budget/marketing?{?}", + "target": "self", + "icon": null, + "order": 16, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004605003, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Event", + "uri": "{/base}/controlling/budget/event?{?}", + "target": "self", + "icon": null, + "order": 17, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004605004, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Leasing", + "uri": "{/base}/controlling/budget/leasing?{?}", + "target": "self", + "icon": null, + "order": 18, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004606001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "HR", + "uri": "{/base}/controlling/budget/hr?{?}", + "target": "self", + "icon": null, + "order": 20, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004607001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Investment", + "uri": "{/base}/controlling/budget/investment?{?}", + "target": "self", + "icon": null, + "order": 25, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004608001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Loan", + "uri": "{/base}/controlling/budget/loan?{?}", + "target": "self", + "icon": null, + "order": 30, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004609001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Cashflow", + "uri": "{/base}/controlling/budget/cashflow?{?}", + "target": "self", + "icon": null, + "order": 35, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004610001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "ProfitCenter", + "uri": "{/base}/controlling/budget/profitcenter?{?}", + "target": "self", + "icon": null, + "order": 40, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] + }, + { + "id": 1004611001, + "pid": "/controlling/budget", + "type": 3, + "subtype": 1, + "name": "Projects", + "uri": "{/base}/controlling/budget/projects?{?}", + "target": "self", + "icon": null, + "order": 45, + "from": "BudgetManagement", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1004601001, + "children": [] } ] } diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index d616436..f9673dd 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -17,4 +17,158 @@ return [ ], ], ], + '^.*/controlling/budget/pl.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingIncomeStatement', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/balance.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingBalance', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/sales.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingSales', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/material.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingMaterial', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/opex.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingOpex', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/hr.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingHR', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/investment.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingInvestment', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/loan.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingLoan', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/cashflow.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingCashFlow', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/profitcenter.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingProfitCenter', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/projects.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingProjects', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/marketing.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingMarketing', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/event.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingEvent', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], + '^.*/controlling/budget/leasing.*$' => [ + [ + 'dest' => '\Modules\BudgetManagement\Controller\BackendController:viewBudgetingLeasing', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::READ, + 'state' => PermissionState::BUDGET, + ], + ], + ], ]; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index c3f4fc4..ed665bd 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace Modules\BudgetManagement\Controller; +use Modules\ItemManagement\Models\Attribute\ItemAttributeMapper; +use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper; use phpOMS\Contract\RenderableInterface; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; @@ -30,7 +32,7 @@ use phpOMS\Views\View; final class BackendController extends Controller { /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -47,6 +49,22 @@ final class BackendController extends Controller $view->setTemplate('/Modules/BudgetManagement/Theme/Backend/budgeting-dashboard'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004601001, $request, $response); + $result = ItemAttributeTypeMapper::getAll() + ->with('l11n') + ->with('defaults') + ->with('defaults/l11n') + ->where('name', ['segment', 'section', 'sales_group', 'product_group'], 'IN') + ->where('l11n/language', $response->header->l11n->language) + ->where('defaults/l11n/language', $response->header->l11n->language) + ->execute(); + + $segmentation = []; + foreach ($result as $seg) { + $segmentation[$seg->name] = $seg; + } + + $view->data['segmentation'] = $segmentation; + return $view; } } diff --git a/Models/PermissionState.php b/Models/PermissionState.php index 82a806a..1474a00 100644 --- a/Models/PermissionState.php +++ b/Models/PermissionState.php @@ -17,7 +17,7 @@ namespace Modules\BudgetManagement\Models; use phpOMS\Stdlib\Base\Enum; /** - * Permision state enum. + * Permission category enum. * * @package Modules\BudgetManagement\Models * @license OMS License 2.0 diff --git a/Theme/Backend/budgeting-dashboard.tpl.php b/Theme/Backend/budgeting-dashboard.tpl.php index fe05255..b47077c 100644 --- a/Theme/Backend/budgeting-dashboard.tpl.php +++ b/Theme/Backend/budgeting-dashboard.tpl.php @@ -13,3 +13,147 @@ declare(strict_types=1); echo $this->data['nav']->render(); +?> +
+
+ +
+
+ request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>> +
+
+
+
+
+
Category
+
PY-3
+
PY-2
+
PY-1
+
C
+
B
+
FC
+
B+1
+
B+2
+
B+3
+
B+4
+
B+5
+
+
+
+
+ + data['segmentation']['segment']->defaults as $segment) : ?> +
+
+
+
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+ +
+ data['segmentation']['section']->defaults as $section) : ?> +
+
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+ +
+ data['segmentation']['sales_group']->defaults as $salesgroup) : ?> +
+
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+ +
+ data['segmentation']['product_group']->defaults as $productgroup) : ?> +
+
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+ +
+ data['items'] ?? [] as $item) : ?> +
+
printHtml($item->l11n); ?>
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+0.00%
+
+ +
+ +
+ +
+ +
+
+
+ +
+ + request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>> +
+
+
+
+ + request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>> +
+
+
+
+
+
\ No newline at end of file diff --git a/info.json b/info.json index 85e5377..0b9387a 100644 --- a/info.json +++ b/info.json @@ -14,7 +14,6 @@ "name": "Jingga", "website": "jingga.app" }, - "description": "Budget Management module.", "directory": "BudgetManagement", "dependencies": { "Controlling": "*"