mirror of
https://github.com/Karaka-Management/oms-WarehouseManagement.git
synced 2026-02-15 21:58:41 +00:00
many fixes and expands and module expansions
This commit is contained in:
parent
fbf05aeb06
commit
f2d92166cf
|
|
@ -94,6 +94,46 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"warehousemgmt_stockshelf": {
|
||||||
|
"name": "warehousemgmt_stockshelf",
|
||||||
|
"fields": {
|
||||||
|
"warehousemgmt_stockshelf_id": {
|
||||||
|
"name": "warehousemgmt_stockshelf_id",
|
||||||
|
"type": "INT",
|
||||||
|
"null": false,
|
||||||
|
"primary": true,
|
||||||
|
"autoincrement": true
|
||||||
|
},
|
||||||
|
"warehousemgmt_stockshelf_name": {
|
||||||
|
"name": "warehousemgmt_stockshelf_name",
|
||||||
|
"type": "VARCHAR(255)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
|
"warehousemgmt_stockshelf_location": {
|
||||||
|
"name": "warehousemgmt_stockshelf_location",
|
||||||
|
"type": "INT",
|
||||||
|
"null": false,
|
||||||
|
"foreignTable": "warehousemgmt_stocklocation",
|
||||||
|
"foreignKey": "warehousemgmt_stocklocation_id"
|
||||||
|
},
|
||||||
|
"warehousemgmt_stockshelf_x": {
|
||||||
|
"name": "warehousemgmt_stockshelf_x",
|
||||||
|
"type": "INT",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
|
"warehousemgmt_stockshelf_y": {
|
||||||
|
"name": "warehousemgmt_stockshelf_y",
|
||||||
|
"type": "INT",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
|
"warehousemgmt_stockshelf_z": {
|
||||||
|
"description": "Height",
|
||||||
|
"name": "warehousemgmt_stockshelf_z",
|
||||||
|
"type": "INT",
|
||||||
|
"null": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"warehousemgmt_lot": {
|
"warehousemgmt_lot": {
|
||||||
"name": "warehousemgmt_lot",
|
"name": "warehousemgmt_lot",
|
||||||
"fields": {
|
"fields": {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ use Modules\WarehouseManagement\Models\Stock;
|
||||||
use Modules\WarehouseManagement\Models\StockMapper;
|
use Modules\WarehouseManagement\Models\StockMapper;
|
||||||
use Modules\WarehouseManagement\Models\StockLocation;
|
use Modules\WarehouseManagement\Models\StockLocation;
|
||||||
use Modules\WarehouseManagement\Models\StockLocationMapper;
|
use Modules\WarehouseManagement\Models\StockLocationMapper;
|
||||||
|
use Modules\WarehouseManagement\Models\StockShelf;
|
||||||
|
use Modules\WarehouseManagement\Models\StockShelfMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WarehouseManagement api controller class.
|
* WarehouseManagement api controller class.
|
||||||
|
|
@ -46,9 +48,13 @@ final class ApiController extends Controller
|
||||||
$stock->type = 1;
|
$stock->type = 1;
|
||||||
StockMapper::create($stock);
|
StockMapper::create($stock);
|
||||||
|
|
||||||
$stockLocation = new StockLocation($new->number . '-1');
|
$stockLocation = new StockLocation($stock->name . '-1');
|
||||||
$stockLocation->stock = $stock->getId();
|
$stockLocation->stock = $stock->getId();
|
||||||
StockLocationMapper::create($stockLocation);
|
StockLocationMapper::create($stockLocation);
|
||||||
|
|
||||||
|
$stockShelf = new StockShelf($stockLocation->name . '-1');
|
||||||
|
$stockShelf->location = $stockLocation->getId();
|
||||||
|
StockShelfMapper::create($stockShelf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function eventBillUpdateInternal(
|
public function eventBillUpdateInternal(
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class StockLocation
|
||||||
|
|
||||||
public string $name = '';
|
public string $name = '';
|
||||||
|
|
||||||
public $stock = 0;
|
public int | Stock $stock = 0;
|
||||||
|
|
||||||
public int $x = 0;
|
public int $x = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\WarehouseManagement\Models;
|
namespace Modules\WarehouseManagement\Models;
|
||||||
|
|
||||||
|
use Modules\Admin\Models\Account;
|
||||||
|
use Modules\Admin\Models\NullAccount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Warehouse class.
|
* Warehouse class.
|
||||||
*
|
*
|
||||||
|
|
@ -64,6 +67,12 @@ class StockMovement
|
||||||
*/
|
*/
|
||||||
public \DateTimeImmutable $createdAt;
|
public \DateTimeImmutable $createdAt;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->createdBy = new NullAccount();
|
||||||
|
$this->createdAt = new \DateTimeImmutable('now');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ID.
|
* Get ID.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
54
Models/StockShelf.php
Normal file
54
Models/StockShelf.php
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package Modules\Warehousing\Models
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\WarehouseManagement\Models;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Warehouse class.
|
||||||
|
*
|
||||||
|
* @package Modules\Warehousing\Models
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class StockShelf
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* ID.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
private int $id = 0;
|
||||||
|
|
||||||
|
public string $name = '';
|
||||||
|
|
||||||
|
public int | StockLocation $location = 0;
|
||||||
|
|
||||||
|
public int $x = 0;
|
||||||
|
|
||||||
|
public int $y = 0;
|
||||||
|
|
||||||
|
public int $z = 0;
|
||||||
|
|
||||||
|
public function __construct(string $name = '')
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId() : int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
}
|
||||||
72
Models/StockShelfMapper.php
Normal file
72
Models/StockShelfMapper.php
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package Modules\WarehouseManagement\Models
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\WarehouseManagement\Models;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WarehouseManagement mapper class.
|
||||||
|
*
|
||||||
|
* @package Modules\WarehouseManagement\Models
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
final class StockShelfMapper extends DataMapperAbstract
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Columns.
|
||||||
|
*
|
||||||
|
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected static array $columns = [
|
||||||
|
'warehousemgmt_stockshelf_id' => ['name' => 'warehousemgmt_stockshelf_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
|
'warehousemgmt_stockshelf_name' => ['name' => 'warehousemgmt_stockshelf_name', 'type' => 'string', 'internal' => 'name'],
|
||||||
|
'warehousemgmt_stockshelf_location' => ['name' => 'warehousemgmt_stockshelf_location', 'type' => 'int', 'internal' => 'location'],
|
||||||
|
'warehousemgmt_stockshelf_x' => ['name' => 'warehousemgmt_stockshelf_x', 'type' => 'int', 'internal' => 'x'],
|
||||||
|
'warehousemgmt_stockshelf_y' => ['name' => 'warehousemgmt_stockshelf_y', 'type' => 'int', 'internal' => 'y'],
|
||||||
|
'warehousemgmt_stockshelf_z' => ['name' => 'warehousemgmt_stockshelf_z', 'type' => 'int', 'internal' => 'z'],
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Belongs to.
|
||||||
|
*
|
||||||
|
* @var array<string, array{mapper:string, external:string}>
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected static array $belongsTo = [
|
||||||
|
'location' => [
|
||||||
|
'mapper' => StockMapper::class,
|
||||||
|
'external' => 'warehousemgmt_stockshelf_location',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary table.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected static string $table = 'warehousemgmt_stockshelf';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary field name.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected static string $primaryField = 'warehousemgmt_stockshelf_id';
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user