diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 996eb02..e4604ae 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -13,6 +13,98 @@ "permission": { "permission": 2, "category": null, "element": null }, "parent": 0, "children": [ + { + "id": 1008102001, + "pid": "/", + "type": 2, + "subtype": 1, + "name": "TaxCodes", + "uri": "{/base}/finance/tax/code/list?{?}", + "target": "self", + "icon": null, + "order": 1, + "from": "Finance", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1008101001, + "children": [ + { + "id": 1008102002, + "pid": "/finance/tax/code", + "type": 3, + "subtype": 1, + "name": "List", + "uri": "{/base}/finance/tax/code/list?{?}", + "target": "self", + "icon": null, + "order": 1, + "from": "Finance", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1008102001, + "children": [] + }, + { + "id": 1008102003, + "pid": "/finance/tax/code", + "type": 3, + "subtype": 1, + "name": "Create", + "uri": "{/base}/finance/tax/code/create?{?}", + "target": "self", + "icon": null, + "order": 5, + "from": "Finance", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1008102001, + "children": [] + } + ] + }, + { + "id": 1008103001, + "pid": "/", + "type": 2, + "subtype": 1, + "name": "TaxCombinations", + "uri": "{/base}/finance/tax/combination/list?{?}", + "target": "self", + "icon": null, + "order": 2, + "from": "Finance", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1008101001, + "children": [ + { + "id": 1008103002, + "pid": "/finance/tax/combination", + "type": 3, + "subtype": 1, + "name": "List", + "uri": "{/base}/finance/tax/combination/list?{?}", + "target": "self", + "icon": null, + "order": 1, + "from": "Finance", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1008103001, + "children": [] + }, + { + "id": 1008103003, + "pid": "/finance/tax/combination", + "type": 3, + "subtype": 1, + "name": "Create", + "uri": "{/base}/finance/tax/combination/create?{?}", + "target": "self", + "icon": null, + "order": 5, + "from": "Finance", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1008103001, + "children": [] + } + ] + } ] } ] diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index a431b9b..a27ab72 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -29,4 +29,48 @@ return [ ], ], ], + '^.*/finance/tax/code/list(\?.*$|$)' => [ + [ + 'dest' => '\Modules\Finance\Controller\BackendController:viewTaxList', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::TAX, + ], + ], + ], + '^.*/finance/tax/code/create(\?.*$|$)' => [ + [ + 'dest' => '\Modules\Finance\Controller\BackendController:viewTaxCreate', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::TAX, + ], + ], + ], + '^.*/finance/tax/combination/list(\?.*$|$)' => [ + [ + 'dest' => '\Modules\Finance\Controller\BackendController:viewCombinationList', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::TAX, + ], + ], + ], + '^.*/finance/tax/combination/create(\?.*$|$)' => [ + [ + 'dest' => '\Modules\Finance\Controller\BackendController:viewCombinationCreate', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::TAX, + ], + ], + ], ]; diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php index 49dc339..3804f56 100755 --- a/Models/PermissionCategory.php +++ b/Models/PermissionCategory.php @@ -29,4 +29,6 @@ abstract class PermissionCategory extends Enum public const ARCHIVE = 1; public const ANALYSIS = 2; + + public const TAX = 3; } diff --git a/Models/TaxCode.php b/Models/TaxCode.php index 84a1f1e..0bcb769 100755 --- a/Models/TaxCode.php +++ b/Models/TaxCode.php @@ -40,6 +40,14 @@ class TaxCode implements \JsonSerializable public int $percentageInput = 0; + // Tax accounts can be defined in: + // 1. Account (gross postings are automatically split) + // 2. Tax code + // 3. Tax combination + public ?int $taxAccount1 = null; + + public ?int $taxAccount2 = null; + /** * Localization. *