mirror of
https://github.com/Karaka-Management/oms-Purchase.git
synced 2026-01-26 06:28:41 +00:00
continue implementations
This commit is contained in:
parent
b9ab6faeb5
commit
588b32ebba
72
Controller/CliController.php
Normal file
72
Controller/CliController.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Purchase
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\Controller;
|
||||
|
||||
use Modules\ItemManagement\Models\ItemMapper;
|
||||
use Modules\ItemManagement\Models\StockIdentifierType;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Views\View;
|
||||
|
||||
/**
|
||||
* Purchase controller class.
|
||||
*
|
||||
* @package Modules\Purchase
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
final class CliController extends Controller
|
||||
{
|
||||
/**
|
||||
* Method which generates the general settings view.
|
||||
*
|
||||
* In this view general settings for the entire application can be seen and adjusted. Settings which can be modified
|
||||
* here are localization, password, database, etc.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Response can be rendered
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function cliGenerateOrderSuggestion(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
// @todo define order details per item+stock
|
||||
$items = ItemMapper::getAll()
|
||||
->with('attributes')
|
||||
->with('attributes/type')
|
||||
->where('stockIdentifier', StockIdentifierType::NONE, '!=')
|
||||
->where('attributes/type/name', [
|
||||
'primary_supplier', 'lead_time', 'qc_time',
|
||||
'maximum_stock_quantity', 'minimum_stock_quantity',
|
||||
'maximum_order_interval', 'minimum_order_quantity',
|
||||
'order_suggestion_type', 'order_suggestion_optimization_type',
|
||||
'order_suggestion_history_duration', 'order_suggestion_averaging_method',
|
||||
'order_suggestion_comparison_duration_type'
|
||||
], 'IN')
|
||||
->execute();
|
||||
|
||||
foreach ($items as $item) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
10
OrderSuggestion/DefaultOrderSuggestion.php → Models/OrderSuggestion/DefaultOrderSuggestion.php
Executable file → Normal file
10
OrderSuggestion/DefaultOrderSuggestion.php → Models/OrderSuggestion/DefaultOrderSuggestion.php
Executable file → Normal file
|
|
@ -12,14 +12,14 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\OrderSuggestion;
|
||||
namespace Modules\Purchase\Models\OrderSuggestion;
|
||||
|
||||
use Modules\Purchase\Models\OrderSuggestionInterface;
|
||||
use Modules\Purchase\Models\OrderSuggestion\OrderSuggestionInterface;
|
||||
|
||||
/**
|
||||
* OMS order suggestion class
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
|
|
@ -40,7 +40,7 @@ final class DefaultOrderSuggestion implements OrderSuggestionInterface
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public int $historicComparisonDurationType = OrderSuggestionComparisonDurationType::ANNUALY;
|
||||
public int $historicComparisonDurationType = OrderSuggestionComparisonDurationType::ANNUALLY;
|
||||
|
||||
/**
|
||||
* How many years should used for the analysis.
|
||||
|
|
@ -69,7 +69,7 @@ final class DefaultOrderSuggestion implements OrderSuggestionInterface
|
|||
/**
|
||||
* How greedy should the algorithm be?
|
||||
*
|
||||
* The number represents how many items in % can be bought in additon to the optimal stock quantity.
|
||||
* The number represents how many items in % can be bought in addition to the optimal stock quantity.
|
||||
*
|
||||
* Higher means more room for adjustments.
|
||||
*
|
||||
6
Models/OrderSuggestion.php → Models/OrderSuggestion/OrderSuggestion.php
Executable file → Normal file
6
Models/OrderSuggestion.php → Models/OrderSuggestion/OrderSuggestion.php
Executable file → Normal file
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Purchase\Models
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -12,12 +12,12 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\Models;
|
||||
namespace Modules\Purchase\Models\OrderSuggestion;
|
||||
|
||||
/**
|
||||
* OrderSuggestion class.
|
||||
*
|
||||
* @package Modules\Purchase\Models
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
6
OrderSuggestion/OrderSuggestionAveragingMethod.php → Models/OrderSuggestion/OrderSuggestionAveragingMethod.php
Executable file → Normal file
6
OrderSuggestion/OrderSuggestionAveragingMethod.php → Models/OrderSuggestion/OrderSuggestionAveragingMethod.php
Executable file → Normal file
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\OrderSuggestion;
|
||||
namespace Modules\Purchase\Models\OrderSuggestion;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Suggestion type enum.
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
14
OrderSuggestion/OrderSuggestionComparisonDurationType.php → Models/OrderSuggestion/OrderSuggestionComparisonDurationType.php
Executable file → Normal file
14
OrderSuggestion/OrderSuggestionComparisonDurationType.php → Models/OrderSuggestion/OrderSuggestionComparisonDurationType.php
Executable file → Normal file
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -12,23 +12,27 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\OrderSuggestion;
|
||||
namespace Modules\Purchase\Models\OrderSuggestion;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Suggestion type enum.
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class OrderSuggestionComparisonDurationType extends Enum
|
||||
{
|
||||
public const ANNUALY = 1;
|
||||
public const ANNUALLY = 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
|
||||
public const WEEKLY = 3;
|
||||
|
||||
public const MONTHLY_ANNUAL = 4; // The basis is the same monthly, e.g. helpful for seasonal data
|
||||
|
||||
public const WEEKLY_ANNUAL = 5; // The basis is the same weekly, e.g. helpful for seasonal data
|
||||
}
|
||||
6
Models/OrderSuggestionInterface.php → Models/OrderSuggestion/OrderSuggestionInterface.php
Executable file → Normal file
6
Models/OrderSuggestionInterface.php → Models/OrderSuggestion/OrderSuggestionInterface.php
Executable file → Normal file
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Purchase\Models
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -12,12 +12,12 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\Models;
|
||||
namespace Modules\Purchase\Models\OrderSuggestion;
|
||||
|
||||
/**
|
||||
* Order suggestion interface.
|
||||
*
|
||||
* @package Modules\Purchase\Models
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
6
OrderSuggestion/OrderSuggestionOptimizationType.php → Models/OrderSuggestion/OrderSuggestionOptimizationType.php
Executable file → Normal file
6
OrderSuggestion/OrderSuggestionOptimizationType.php → Models/OrderSuggestion/OrderSuggestionOptimizationType.php
Executable file → Normal file
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\OrderSuggestion;
|
||||
namespace Modules\Purchase\Models\OrderSuggestion;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Suggestion type enum.
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
8
OrderSuggestion/OrderSuggestionType.php → Models/OrderSuggestion/OrderSuggestionType.php
Executable file → Normal file
8
OrderSuggestion/OrderSuggestionType.php → Models/OrderSuggestion/OrderSuggestionType.php
Executable file → Normal file
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Purchase\OrderSuggestion;
|
||||
namespace Modules\Purchase\Models\OrderSuggestion;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Suggestion type enum.
|
||||
*
|
||||
* @package Modules\Purchase\OrderSuggestion
|
||||
* @package Modules\Purchase\Models\OrderSuggestion
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
|
|
@ -30,5 +30,5 @@ abstract class OrderSuggestionType extends Enum
|
|||
|
||||
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
|
||||
public const TREND = 4; // Suggestion based on: available stock + current orders + trend
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user