|
|
@@ -117,7 +117,7 @@ class Goods extends AuthController
|
|
|
$f = [];
|
|
|
$f[] = Form::hidden('bar_code', $bar_code);
|
|
|
$f[] = Form::radio('type', '增减', 1)->setOptions([['value' => 1, 'label' => '增加'], ['value' => 2, 'label' => '减少']]);
|
|
|
- $f[] = Form::number('in_stock', '数量', 0)->step(0.001)->min(1);
|
|
|
+ $f[] = Form::number('in_stock', '数量', 0)->step(0.001)->min(0.001);
|
|
|
$f[] = Form::textarea('info', '增减缘由', 0)->rows(10);
|
|
|
$form = Form::make_post_form('添加用户通知', $f, Url::buildUrl('save'));
|
|
|
$this->assign(compact('form'));
|
|
|
@@ -133,7 +133,7 @@ class Goods extends AuthController
|
|
|
['info', ''],
|
|
|
]);
|
|
|
if (!$this->adminInfo['store_id']) return app('json')->fail('门店铺货用通道');
|
|
|
- if ($where['in_stock'] < 1) return app('json')->fail('补货数量不能少于1');
|
|
|
+ if ($where['in_stock'] < 0.001) return app('json')->fail('补货数量不能少于0.001');
|
|
|
$info = SystemStoreStock::alias('a')->join("StoreProduct b", "a.product_id=b.id", "left")->where('a.bar_code', $where['bar_code'])->field('a.price,a.unique,a.in_stock,a.is_consumer,a.product_id,b.store_name,b.image,a.bar_code')->find();
|
|
|
if (!$info && $where['type'] != 1) return app('json')->fail('门店尚无库存无法减少');
|
|
|
if (!$info) {
|