mirror of
https://github.com/Karaka-Management/oms-Purchase.git
synced 2026-02-16 07:48:39 +00:00
general fixes and tpl additions
This commit is contained in:
parent
5c52b12d44
commit
7ac1d67115
|
|
@ -19,7 +19,7 @@
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "OrderSuggestions",
|
"name": "OrderSuggestions",
|
||||||
"uri": "{/prefix}purchase/analysis?{?}",
|
"uri": "{/prefix}purchase/order/suggestion?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 15,
|
"order": 15,
|
||||||
|
|
|
||||||
|
|
@ -39,17 +39,6 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/purchase/article/recommend.*$' => [
|
|
||||||
[
|
|
||||||
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseOrderRecommendation',
|
|
||||||
'verb' => RouteVerb::GET,
|
|
||||||
'permission' => [
|
|
||||||
'module' => BackendController::MODULE_NAME,
|
|
||||||
'type' => PermissionType::READ,
|
|
||||||
'state' => PermissionState::ARTICLE,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'^.*/purchase/article/create.*$' => [
|
'^.*/purchase/article/create.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseArticleCreate',
|
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseArticleCreate',
|
||||||
|
|
@ -72,4 +61,15 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'^.*/purchase/order/suggestion.*$' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseOrderSuggestion',
|
||||||
|
'verb' => RouteVerb::GET,
|
||||||
|
'permission' => [
|
||||||
|
'module' => BackendController::MODULE_NAME,
|
||||||
|
'type' => PermissionType::READ,
|
||||||
|
'state' => PermissionState::ARTICLE,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ final class BackendController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function viewPurchaseOrderRecommendation(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewPurchaseOrderSuggestion(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Purchase/Theme/Backend/article-order-recommendation');
|
$view->setTemplate('/Modules/Purchase/Theme/Backend/article-order-recommendation');
|
||||||
|
|
|
||||||
120
OrderSuggestion/DefaultOrderSuggestion.php
Normal file
120
OrderSuggestion/DefaultOrderSuggestion.php
Normal file
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package OrderSuggestion
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\Purchase\OrderSuggestion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OMS order suggestion class
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
final class DefaultOrderSuggestion implements OrderSuggestionInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Which data should be used to create the order suggestion?
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $suggestionType = OrderSuggestionType::HISTORIC;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Comparison duration type.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $historicComparisonDurationType = OrderSuggestionComparisonDurationType::ANNUAL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How many years should used for the analysis.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $historicComparisonDuration = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Which averaging method should be used?
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $historicAveragingMethod = OrderSuggestionAveragingMethod::MEAN;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What should the focus of the order suggestion be?
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $optimizationType = OrderSuggestionOptimizationType::PRICE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How greedy should the algorithm be?
|
||||||
|
*
|
||||||
|
* The number represents how many items in % can be bought in additon to the optimal stock quantity.
|
||||||
|
*
|
||||||
|
* Higher means more room for adjustments.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $optimizationGreediness = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For how many days would you like to have stock?
|
||||||
|
*
|
||||||
|
* Or in other words, higher means you need to order less often per year.
|
||||||
|
*
|
||||||
|
* Only relevant if OptimizationType::AVAILABILITY
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $optimizationDays = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum available budget.
|
||||||
|
*
|
||||||
|
* 0 = infinite budget
|
||||||
|
*
|
||||||
|
* If a budget is defined and the optimal order is > than the available budget,
|
||||||
|
* the algorithm will try to order as many different items as possible.
|
||||||
|
*
|
||||||
|
* If not all items can be ordered will try to order the items with the highest profit.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public int $maxAvailableBudget = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* item data for algorithm:
|
||||||
|
* number
|
||||||
|
* name
|
||||||
|
* purchase price per volume
|
||||||
|
* minimum quantity per volume
|
||||||
|
* delivery time / lead time
|
||||||
|
* in-house processing time (e.g. qs time, labelling, packaging)
|
||||||
|
* ordered (order confirmations)
|
||||||
|
* stock available
|
||||||
|
* offers
|
||||||
|
* avg. profit
|
||||||
|
* demand in period N
|
||||||
|
*/
|
||||||
|
}
|
||||||
34
OrderSuggestion/OrderSuggestionAveragingMethod.php
Normal file
34
OrderSuggestion/OrderSuggestionAveragingMethod.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\Purchase\OrderSuggestion;
|
||||||
|
|
||||||
|
use phpOMS\Stdlib\Base\Enum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Suggestion type enum.
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
abstract class OrderSuggestionAveragingMethod extends Enum
|
||||||
|
{
|
||||||
|
public const MEAN = 1;
|
||||||
|
|
||||||
|
public const MEDIAN = 2;
|
||||||
|
|
||||||
|
public const MEAN_WEIGHTED = 3;
|
||||||
|
}
|
||||||
34
OrderSuggestion/OrderSuggestionComparisonDurationType.php
Normal file
34
OrderSuggestion/OrderSuggestionComparisonDurationType.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\Purchase\OrderSuggestion;
|
||||||
|
|
||||||
|
use phpOMS\Stdlib\Base\Enum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Suggestion type enum.
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
abstract class OrderSuggestionComparisonDurationType extends Enum
|
||||||
|
{
|
||||||
|
public const ANNUALY = 1;
|
||||||
|
|
||||||
|
public const MONTHLY = 2; // The basis is every month, the different months are considered the same
|
||||||
|
|
||||||
|
public const MONTHLY_ANNUAL = 3; // The basis is the same month, e.g. helpful for seasonal data
|
||||||
|
}
|
||||||
34
OrderSuggestion/OrderSuggestionOptimizationType.php
Normal file
34
OrderSuggestion/OrderSuggestionOptimizationType.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\Purchase\OrderSuggestion;
|
||||||
|
|
||||||
|
use phpOMS\Stdlib\Base\Enum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Suggestion type enum.
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
abstract class OrderSuggestionOptimizationType extends Enum
|
||||||
|
{
|
||||||
|
public const PRICE = 1; // Suggestion focuses on creating better prices if volume discounts exist.
|
||||||
|
|
||||||
|
public const JUST_IN_TIME = 2; // Suggestion focuses on calculating minimum stock quantities.
|
||||||
|
|
||||||
|
public const AVAILABILITY = 3; // Suggestion focuses on an availability for X days, days need to be specified in the algorithm.
|
||||||
|
}
|
||||||
34
OrderSuggestion/OrderSuggestionType.php
Normal file
34
OrderSuggestion/OrderSuggestionType.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\Purchase\OrderSuggestion;
|
||||||
|
|
||||||
|
use phpOMS\Stdlib\Base\Enum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Suggestion type enum.
|
||||||
|
*
|
||||||
|
* @package Modules\Purchase\Models\OrderSuggestion
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
abstract class OrderSuggestionType extends Enum
|
||||||
|
{
|
||||||
|
public const AVAILABLE = 1; // Suggestion based on: available stock + current orders
|
||||||
|
|
||||||
|
public const HISTORIC = 2; // Suggestion based on: available stock + current orders + historic demand
|
||||||
|
|
||||||
|
public const TREND = 3; // Suggestion based on: available stock + current orders + trend
|
||||||
|
}
|
||||||
0
Theme/Backend/Lang/ar.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/ar.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/cs.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/cs.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/da.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/da.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/de.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/de.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/el.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/el.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/en.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/en.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/es.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/es.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/fi.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/fi.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/fr.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/fr.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/hu.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/hu.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/it.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/it.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/ja.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/ja.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/ko.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/ko.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/no.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/no.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/pl.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/pl.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/pt.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/pt.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/ru.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/ru.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/sv.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/sv.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/th.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/th.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/tr.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/tr.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/uk.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/uk.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/zh.lang.php
Normal file → Executable file
0
Theme/Backend/Lang/zh.lang.php
Normal file → Executable file
Loading…
Reference in New Issue
Block a user