diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index d2c13b5..d89e227 100755 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -44,7 +44,44 @@ return [ ], ], ], - '^.*/item/attribute$' => [ + '^.*/item(\?.*|$)$' => [ + [ + 'dest' => '\Modules\ItemManagement\Controller\ApiController:apiItemCreate', + 'verb' => RouteVerb::PUT, + 'csrf' => true, + 'active' => true, + 'permission' => [ + 'module' => ApiController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::SALES_ITEM, + ], + ], + [ + 'dest' => '\Modules\ItemManagement\Controller\ApiController:apiItemUpdate', + 'verb' => RouteVerb::SET, + 'csrf' => true, + 'active' => true, + 'permission' => [ + 'module' => ApiController::NAME, + 'type' => PermissionType::MODIFY, + 'state' => PermissionCategory::SALES_ITEM, + ], + ], + ], + '^.*/item/material(\?.*|$)$' => [ + [ + 'dest' => '\Modules\ItemManagement\Controller\ApiController:apiItemMaterialTypeCreate', + 'verb' => RouteVerb::PUT, + 'csrf' => true, + 'active' => true, + 'permission' => [ + 'module' => ApiController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::MATERIAL, + ], + ], + ], + '^.*/item/attribute(\?.*|$)$' => [ [ 'dest' => '\Modules\ItemManagement\Controller\ApiAttributeController:apiItemAttributeCreate', 'verb' => RouteVerb::PUT, @@ -52,7 +89,7 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::SALES_ITEM, ], ], @@ -63,12 +100,12 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, 'state' => PermissionCategory::SALES_ITEM, ], ], ], - '^.*/item/attribute/type$' => [ + '^.*/item/attribute/type(\?.*|$)$' => [ [ 'dest' => '\Modules\ItemManagement\Controller\ApiAttributeController:apiItemAttributeTypeCreate', 'verb' => RouteVerb::PUT, @@ -77,7 +114,7 @@ return [ 'permission' => [ 'module' => ApiController::NAME, 'type' => PermissionType::READ, - 'state' => PermissionCategory::SALES_ITEM, + 'state' => PermissionCategory::ATTRIBUTE, ], ], [ @@ -88,11 +125,11 @@ return [ 'permission' => [ 'module' => ApiController::NAME, 'type' => PermissionType::READ, - 'state' => PermissionCategory::SALES_ITEM, + 'state' => PermissionCategory::ATTRIBUTE, ], ], ], - '^.*/item/attribute/type/l11n$' => [ + '^.*/item/attribute/type/l11n(\?.*|$)$' => [ [ 'dest' => '\Modules\ItemManagement\Controller\ApiAttributeController:apiItemAttributeTypeL11nCreate', 'verb' => RouteVerb::PUT, @@ -100,8 +137,8 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::SALES_ITEM, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::ATTRIBUTE, ], ], [ @@ -111,12 +148,12 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::SALES_ITEM, + 'type' => PermissionType::MODIFY, + 'state' => PermissionCategory::ATTRIBUTE, ], ], ], - '^.*/item/attribute/value$' => [ + '^.*/item/attribute/value(\?.*|$)$' => [ [ 'dest' => '\Modules\ItemManagement\Controller\ApiAttributeController:apiItemAttributeValueCreate', 'verb' => RouteVerb::PUT, @@ -124,7 +161,7 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::SALES_ITEM, ], ], @@ -135,12 +172,12 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, 'state' => PermissionCategory::SALES_ITEM, ], ], ], - '^.*/item/attribute/value/l11n$' => [ + '^.*/item/attribute/value/l11n(\?.*|$)$' => [ [ 'dest' => '\Modules\ItemManagement\Controller\ApiAttributeController:apiItemAttributeValueL11nCreate', 'verb' => RouteVerb::PUT, @@ -148,7 +185,7 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::SALES_ITEM, ], ], @@ -159,12 +196,12 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, 'state' => PermissionCategory::SALES_ITEM, ], ], ], - '^.*/item/l11n$' => [ + '^.*/item/l11n(\?.*|$)$' => [ [ 'dest' => '\Modules\ItemManagement\Controller\ApiController:apiItemL11nCreate', 'verb' => RouteVerb::PUT, @@ -172,7 +209,7 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::SALES_ITEM, ], ], @@ -183,12 +220,12 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, 'state' => PermissionCategory::SALES_ITEM, ], ], ], - '^.*/item/l11n/type$' => [ + '^.*/item/l11n/type(\?.*|$)$' => [ [ 'dest' => '\Modules\ItemManagement\Controller\ApiController:apiItemL11nTypeCreate', 'verb' => RouteVerb::PUT, @@ -196,7 +233,7 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::SALES_ITEM, ], ], @@ -207,7 +244,7 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, 'state' => PermissionCategory::SALES_ITEM, ], ], diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 07c5655..9516a61 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -57,11 +57,16 @@ use phpOMS\System\MimeType; * @link https://jingga.app * @since 1.0.0 * - * @todo Import item prices from csv/excel sheet + * @feature Import item prices from csv/excel sheet + * Maybe create an exchange script? * https://github.com/Karaka-Management/oms-ItemManagement/issues/15 * - * @todo Perform inflation increase on all items + * @feature Perform inflation increase on all items * https://github.com/Karaka-Management/oms-ItemManagement/issues/16 + * + * @feature Implement item export with prices. + * Maybe this should be handled in the DatabaseEditor / Report generator module? + * https://github.com/Karaka-Management/oms-ItemManagement/issues/14 */ final class ApiController extends Controller { @@ -329,6 +334,11 @@ final class ApiController extends Controller } $this->createItemSegmentation($request, $response, $item); + + // @todo Try to automatically set sales_tax_code and purchase_tax_code + // This could be achieved based on other items in the same segment->section->sales_group->product_group. + // https://github.com/Karaka-Management/oms-ItemManagement/issues/20 + $this->createStandardCreateResponse($request, $response, $item); } @@ -343,6 +353,8 @@ final class ApiController extends Controller * * @return void * + * @todo Accept segmentation attributes from request and if available use these instead of default values + * * @since 1.0.0 */ private function createItemSegmentation(RequestAbstract $request, ResponseAbstract $response, Item $item) : void diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 2f6d9ec..48c286d 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -395,6 +395,23 @@ final class BackendController extends Controller * * @return View * + * @todo Add an area for markers (e.g. not sold for a x month, not purchased for x month, bad margin... etc.) + * Similar to an alarm system (maybe green, yellow, red markers?) + * https://github.com/Karaka-Management/oms-ItemManagement/issues/12 + * + * @todo Show different prices on item profile frontpage (e.g. domestic, export, quantity discount) + * https://github.com/Karaka-Management/oms-ItemManagement/issues/6 + * + * @feature Item view should be customizable since different groups have different interests and read permissions + * (e.g. sales reps, finance, etc.) + * https://github.com/Karaka-Management/oms-ItemManagement/issues/5 + * + * @feature Create a second optional list view + * The item is shown at the bottom of the list which allows the user to see the item list at the top + * and the item itself below. Either create a custom view + * or somehow append an iframe below the list which is loaded based on the selected item + * https://github.com/Karaka-Management/oms-ItemManagement/issues/9 + * * @since 1.0.0 * @codeCoverageIgnore */ diff --git a/Models/Container.php b/Models/Container.php index b859eb1..b55d079 100644 --- a/Models/Container.php +++ b/Models/Container.php @@ -21,6 +21,16 @@ namespace Modules\ItemManagement\Models; * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 + * + * @todo Fully implement different containers for items (Gebinde) + * https://github.com/Karaka-Management/oms-ItemManagement/issues/17 + * + * @todo Item Containers can be Supplier and Client specific. + * Currently they are only handled on item level not in conjunction with clients/suppliers. + * https://github.com/Karaka-Management/oms-ItemManagement/issues/18 + * + * @todo Item Containers have an effect on the package materials + * https://github.com/Karaka-Management/oms-ItemManagement/issues/19 */ class Container implements \JsonSerializable { diff --git a/Theme/Backend/item-create.tpl.php b/Theme/Backend/item-create.tpl.php index ad2890f..3719506 100755 --- a/Theme/Backend/item-create.tpl.php +++ b/Theme/Backend/item-create.tpl.php @@ -586,12 +586,6 @@ echo $this->data['nav']->render(); ?> request->uri->fragment === 'c-tab-15' ? ' checked' : ''; ?>>