mirror of
https://github.com/Karaka-Management/oms-StockTaking.git
synced 2026-01-10 18:18:41 +00:00
init
This commit is contained in:
commit
47e5ddb4ba
33
Admin/Install/Navigation.install.json
Normal file
33
Admin/Install/Navigation.install.json
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
[
|
||||
{
|
||||
"id": 1006701001,
|
||||
"pid": "/",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Budgeting",
|
||||
"uri": "{/prefix}warehouse/stocktaking/list?{?}",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "StockTaking",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"parent": 1001301001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1006702001,
|
||||
"pid": "/warehouse/stocktaking",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Dashboard",
|
||||
"uri": "{/prefix}warehouse/stocktaking/list?{?}",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "StockTaking",
|
||||
"permission": { "permission": 2, "type": null, "element": null },
|
||||
"parent": 1006701001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
43
Admin/Install/Navigation.php
Normal file
43
Admin/Install/Navigation.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Admin\Install;
|
||||
|
||||
use phpOMS\Application\ApplicationAbstract;
|
||||
|
||||
/**
|
||||
* Navigation class.
|
||||
*
|
||||
* @package Modules\StockTaking\Admin\Install
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Navigation
|
||||
{
|
||||
/**
|
||||
* Install navigation providing
|
||||
*
|
||||
* @param ApplicationAbstract $app Application
|
||||
* @param string $path Module path
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function install(ApplicationAbstract $app, string $path) : void
|
||||
{
|
||||
\Modules\Navigation\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Navigation.install.json']);
|
||||
}
|
||||
}
|
||||
36
Admin/Installer.php
Normal file
36
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Admin;
|
||||
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
|
||||
/**
|
||||
* Installer class.
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class Installer extends InstallerAbstract
|
||||
{
|
||||
/**
|
||||
* Path of the file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
}
|
||||
31
Admin/Routes/Web/Api.php
Normal file
31
Admin/Routes/Web/Api.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Modules\StockTaking\Controller\ApiController;
|
||||
use Modules\StockTaking\Models\PermissionState;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
'^.*/warehouse/stocktaking$' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\ApiController:apiStockTakingCreate',
|
||||
'verb' => RouteVerb::PUT,
|
||||
'permission' => [
|
||||
'module' => ApiController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/stocktaking/entry$' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\ApiController:apiStockTakingEntryCreate',
|
||||
'verb' => RouteVerb::SET,
|
||||
'permission' => [
|
||||
'module' => ApiController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
64
Admin/Routes/Web/Backend.php
Normal file
64
Admin/Routes/Web/Backend.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Modules\StockTaking\Controller\BackendController;
|
||||
use Modules\StockTaking\Models\PermissionState;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
'^.*/warehouse/stocktaking/list.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/stocktaking/overview.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingOverview',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/stocktaking/area.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingArea',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/stocktaking/entry.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingEntry',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/stocktaking/stats.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingStats',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
36
Admin/Status.php
Normal file
36
Admin/Status.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Admin;
|
||||
|
||||
use phpOMS\Module\StatusAbstract;
|
||||
|
||||
/**
|
||||
* Status class.
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class Status extends StatusAbstract
|
||||
{
|
||||
/**
|
||||
* Path of the file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
}
|
||||
36
Admin/Uninstaller.php
Normal file
36
Admin/Uninstaller.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Admin;
|
||||
|
||||
use phpOMS\Module\UninstallerAbstract;
|
||||
|
||||
/**
|
||||
* Uninstaller class.
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class Uninstaller extends UninstallerAbstract
|
||||
{
|
||||
/**
|
||||
* Path of the file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
}
|
||||
36
Admin/Updater.php
Normal file
36
Admin/Updater.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Admin;
|
||||
|
||||
use phpOMS\Module\UpdaterAbstract;
|
||||
|
||||
/**
|
||||
* Updater class.
|
||||
*
|
||||
* @package Modules\StockTaking\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class Updater extends UpdaterAbstract
|
||||
{
|
||||
/**
|
||||
* Path of the file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PATH = __DIR__;
|
||||
}
|
||||
33
Controller/ApiController.php
Normal file
33
Controller/ApiController.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Controller;
|
||||
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Views\View;
|
||||
|
||||
/**
|
||||
* Budgeting controller class.
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class ApiController extends Controller
|
||||
{
|
||||
|
||||
}
|
||||
33
Controller/BackendController.php
Normal file
33
Controller/BackendController.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Controller;
|
||||
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Views\View;
|
||||
|
||||
/**
|
||||
* Budgeting controller class.
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class BackendController extends Controller
|
||||
{
|
||||
|
||||
}
|
||||
77
Controller/Controller.php
Normal file
77
Controller/Controller.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Controller;
|
||||
|
||||
use phpOMS\Module\ModuleAbstract;
|
||||
use phpOMS\Module\WebInterface;
|
||||
|
||||
/**
|
||||
* Budgeting controller class.
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Controller extends ModuleAbstract implements WebInterface
|
||||
{
|
||||
/**
|
||||
* Module path.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_PATH = __DIR__ . '/../';
|
||||
|
||||
/**
|
||||
* Module version.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_VERSION = '1.0.0';
|
||||
|
||||
/**
|
||||
* Module name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_NAME = 'StockTaking';
|
||||
|
||||
/**
|
||||
* Module id.
|
||||
*
|
||||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_ID = 1006700000;
|
||||
|
||||
/**
|
||||
* Providing.
|
||||
*
|
||||
* @var string[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $providing = [];
|
||||
|
||||
/**
|
||||
* Dependencies.
|
||||
*
|
||||
* @var string[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $dependencies = [];
|
||||
}
|
||||
32
Models/PermissionState.php
Normal file
32
Models/PermissionState.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Permision state enum.
|
||||
*
|
||||
* @package Modules\StockTaking\Models
|
||||
* @license OMS License 1.0
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class PermissionState extends Enum
|
||||
{
|
||||
public const STOCK_TAKING_COUNTING = 1;
|
||||
|
||||
public const STOCK_TAKING_ADMINISTRATION = 2;
|
||||
}
|
||||
18
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
18
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => 'Budgeting',
|
||||
'Dashboard' => 'Dashboard',
|
||||
]];
|
||||
16
Theme/Backend/Lang/en.lang.php
Normal file
16
Theme/Backend/Lang/en.lang.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['StockTaking' => [
|
||||
]];
|
||||
0
Theme/Backend/stock-analysis.tpl.php
Normal file
0
Theme/Backend/stock-analysis.tpl.php
Normal file
15
Theme/Backend/stock-counting.tpl.php
Normal file
15
Theme/Backend/stock-counting.tpl.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.4
|
||||
*
|
||||
* @package Modules\StockTaking
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
echo $this->getData('nav')->render();
|
||||
45
info.json
Normal file
45
info.json
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"name": {
|
||||
"id": 1006700000,
|
||||
"internal": "StockTaking",
|
||||
"external": "Stock Taking"
|
||||
},
|
||||
"category": "Finance",
|
||||
"version": "1.0.0",
|
||||
"requirements": {
|
||||
"phpOMS": "1.0.0",
|
||||
"phpOMS-db": "1.0.0"
|
||||
},
|
||||
"creator": {
|
||||
"name": "Jingga",
|
||||
"website": "jingga.app"
|
||||
},
|
||||
"description": "Stock Taking module.",
|
||||
"directory": "StockTaking",
|
||||
"dependencies": {
|
||||
"Controlling": "*"
|
||||
},
|
||||
"providing": {
|
||||
"Navigation": "*"
|
||||
},
|
||||
"load": [
|
||||
{
|
||||
"pid": [
|
||||
"/warehouse/stocktaking"
|
||||
],
|
||||
"type": 4,
|
||||
"for": 0,
|
||||
"from": "StockTaking",
|
||||
"file": "StockTaking"
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
"/"
|
||||
],
|
||||
"type": 5,
|
||||
"from": "StockTaking",
|
||||
"for": "Navigation",
|
||||
"file": "Navigation"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user