mvdnbrk/warehouse-framework 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mvdnbrk/warehouse-framework

Composer 安装命令:

composer require mvdnbrk/warehouse-framework

包简介

Laravel Warehouse Framework

README 文档

README

PHP version Latest Version on Packagist Software License Tests Code style Total Downloads

Installation

You can install the package via composer:

composer require mvdnbrk/warehouse-framework

Run the install command:

php artisan warehouse:install

This package uses it's own database.
By default we assume that you will prepare a connection called "warehouse" in your config/database.php file.
If you would like to use a different connection you can do so by setting WAREHOUSE_DB_CONNECTION in your .env file.

Now you can run the migrations for this package with:

php artisan warehouse:migrate

Usage

Locations

You can retrieve all locations using the Just\Warehouse\Models\Location model:

Location::all();

Create a location with this artisan command:

php artisan warehouse:make:location

Inventory

Add inventory to a location with a GTIN value, you may pass an amount as the second parameter:

$location = Location::find(1);
$location->addInventory('1300000000000');
$location->addInventory('1234567890005', 2);

Move inventory to another location:

$inventory = Inventory::first();
$inventory->move($location);

You may also move inventory with it's GTIN from one location to another:

$location1 = Location::find(1);
$location2 = Location::find(2);
$location1->addInventory('1234567890005');

$location1->move('1234567890005', $location2);

Moving many items at once from one location to another:

$location->moveMany([
    '1234567890005',
    '1234567890005',
], $location2);

note: If you are trying to move many items at once and a failure occurs, an exception will be thrown and none of the items will be moved from one location to another.

Remove inventory from a location:

$location = Location::find(1);
$location->removeInventory('1234567890005');

Remove all inventory from a location:

$location = Location::find(1);
$location->removeAllInventory();

Orders

Create a new order:

$order = Order::create([
    'order_number' => 'my-first-order-0001',
]);

Add order lines with the addLine method by passing a GTIN value, you may pass an amount as the second parameter:

$order->addLine('1300000000000');
$order->addLine('1234567890005', 2);
$order->addLine(...);

note: You can only add order lines when the status of an order is either created or hold.
The same is true if you try to delete an order line.

Process the order:

$order->process();

This will update the order status to open and will be ready to be picked.

Put an order on hold

You can put an order on hold by calling the hold method. Unhold it with the unhold method:

$order->hold();
$order->unhold();

Order status

You can determine the status of an order with the following methods on the status property:

$order->status->isCreated();
$order->status->isOpen();
$order->status->isBackorder();
$order->status->isHold();
$order->status->isFulfilled();
$order->status->isDeleted();

Pick Lists

Once you have created an order you may retrieve a pick list.
To determine if a pick list is available and retrieve it:

$order->hasPickList();

$order->pickList();

The pickList method returns a collection:

$order->pickList()->each(function ($item) {
    $item->get('gtin');
    $item->get('location');
    $item->get('quantity');
});

When the order is picked you can mark it as fulfilled with the markAsFulfilled method:

$order->markAsFulfilled();

Replacing an order line

If for some reason a product is missing or for example the items is damaged you may replace an order line with the replace method:

$order->lines->first()->replace();

This will delete the reserved product from the inventory and replaces it with another item (if available).

Stock

To query stock quantities you may use the \Just\Warehouse\Facades\Stock facade:

Stock::available();
Stock::backorder();
Stock::reserved();

For a specific GTIN:

Stock::gtin('1300000000000')->available();
Stock::gtin('1300000000000')->backorder();
Stock::gtin('1300000000000')->reserved();

Events

This packages fires several events:

  • InventoryCreated
  • OrderLineCreated
  • OrderLineReplaced
  • OrderStatusUpdated
  • OrderFulfilled

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

mvdnbrk/warehouse-framework 适用场景与选型建议

mvdnbrk/warehouse-framework 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.31k 次下载、GitHub Stars 达 75, 最近一次更新时间为 2019 年 04 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「wms」 「warehouse」 「warehouse management system」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 mvdnbrk/warehouse-framework 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mvdnbrk/warehouse-framework 我们能提供哪些服务?
定制开发 / 二次开发

基于 mvdnbrk/warehouse-framework 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 75
  • 点击次数: 6
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 75
  • Watchers: 8
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-25