Went through todos

This commit is contained in:
Dennis Eichhorn 2024-05-02 22:54:38 +00:00
parent 7a3bc940dc
commit c8152cc7cf
7 changed files with 118 additions and 34 deletions

View File

@ -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,
],
],

View File

@ -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

View File

@ -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
*/

View File

@ -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
{

View File

@ -586,12 +586,6 @@ echo $this->data['nav']->render(); ?>
</div>
<input type="radio" id="c-tab-15" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-15' ? ' checked' : ''; ?>>
<div class="tab">
<?php
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(20);
$footerView->setPage(1);
?>
<div class="box w-100">
<table class="default sticky">
<caption><?= $this->getHtml('Logs'); ?><i class="g-icon end-xs download btn">download</i></caption>

View File

@ -28,6 +28,8 @@ use phpOMS\Localization\RegionEnum;
use phpOMS\Message\Http\HttpHeader;
use phpOMS\Stdlib\Base\FloatInt;
use phpOMS\Stdlib\Base\SmartDateTime;
use phpOMS\System\File\ExtensionType;
use phpOMS\System\File\FileUtils;
use phpOMS\Uri\UriFactory;
/** @var \Modules\ItemManagement\Models\Item $item */
@ -47,6 +49,10 @@ $currencies = ISO4217CharEnum::getConstants();
$itemStatus = ItemStatus::getConstants();
// @performance The client, supplier and item views should not use actual tabs but individual pages for better performance
// Tabs require too many models to be loaded. Implement and then use a tab navigation if it doesn't already exist.
// https://github.com/Karaka-Management/oms-ItemManagement/issues/13
echo $this->data['nav']->render();
?>
@ -88,7 +94,10 @@ echo $this->data['nav']->render();
<div class="row">
<div class="col-xs-12 col-lg-3 last-lg">
<section class="portlet">
<form id="itemForm" method="<?= $isNew ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}item?csrf={$CSRF}'); ?>">
<form id="itemForm"
method="<?= $isNew ? 'PUT' : 'POST'; ?>"
action="<?= UriFactory::build('{/api}item?csrf={$CSRF}'); ?>"
<?= $isNew ? 'data-redirect="' . UriFactory::build('{/base}/item/view') . '?id={/0/response/id}"' : ''; ?>>
<div class="portlet-body">
<div class="form-group">
<?= $this->getHtml('ID', '0', '0'); ?></label>
@ -249,8 +258,10 @@ echo $this->data['nav']->render();
foreach ($item->files as $file) :
++$count;
$url = UriFactory::build('{/base}/media/view?{?}&id=' . $file->id);
$extensionType = FileUtils::getExtensionType($value->extension);
?>
<tr data-href="<?= $url; ?>">
<tr data-href="<?= $url; ?>"
<?= \in_array($extensionType, [ExtensionType::IMAGE, ExtensionType::PDF]) ? 'data-preview="' . UriFactory::build('{/api}media/export?id=' . $file->id . '&type=html&csrf={$CSRF}') . '"' : ''; ?>>
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->name); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->extension); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->createdAt->format('Y-m-d')); ?></a>

View File

@ -24,7 +24,10 @@ echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="materialForm" method="<?= $isNew ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}item/material?csrf={$CSRF}'); ?>">
<form id="materialForm"
method="<?= $isNew ? 'PUT' : 'POST'; ?>"
action="<?= UriFactory::build('{/api}item/material?csrf={$CSRF}'); ?>"
<?= $isNew ? 'data-redirect="' . UriFactory::build('{/base}/item/material/view') . '?id={/0/response/id}"' : ''; ?>>
<div class="portlet-head"><?= $this->getHtml('Material'); ?></div>
<div class="portlet-body">
<div class="form-group">