diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 23be0b0..94c3c69 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -19,7 +19,7 @@ "type": 2, "subtype": 1, "name": "OrderSuggestions", - "uri": "{/prefix}purchase/analysis?{?}", + "uri": "{/prefix}purchase/order/suggestion?{?}", "target": "self", "icon": null, "order": 15, diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 1010c8f..8d2b3c0 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -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.*$' => [ [ '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, + ], + ], + ], ]; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 2fe7427..54db7e4 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -146,7 +146,7 @@ final class BackendController extends Controller * @since 1.0.0 * @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->setTemplate('/Modules/Purchase/Theme/Backend/article-order-recommendation'); diff --git a/OrderSuggestion/DefaultOrderSuggestion.php b/OrderSuggestion/DefaultOrderSuggestion.php new file mode 100644 index 0000000..c3b9655 --- /dev/null +++ b/OrderSuggestion/DefaultOrderSuggestion.php @@ -0,0 +1,120 @@ + 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 + */ +} \ No newline at end of file diff --git a/OrderSuggestion/OrderSuggestionAveragingMethod.php b/OrderSuggestion/OrderSuggestionAveragingMethod.php new file mode 100644 index 0000000..9913bc6 --- /dev/null +++ b/OrderSuggestion/OrderSuggestionAveragingMethod.php @@ -0,0 +1,34 @@ +