|
|
@@ -7,7 +7,7 @@ use app\common\model\StockConfig;
|
|
|
use app\common\model\ProductConfig;
|
|
|
use app\common\model\StockDetail;
|
|
|
use app\common\model\ShopDelivery;
|
|
|
-use app\common\model\CustomerSpecBack;
|
|
|
+use app\common\model\CustomerSpec;
|
|
|
/**
|
|
|
* 录入发货
|
|
|
*/
|
|
|
@@ -82,7 +82,7 @@ class SpecService{
|
|
|
'remark' => '录入出库'
|
|
|
];
|
|
|
//根据规格扣除包装箱
|
|
|
- $box_id = CustomerSpecBack::where('customer_id', $customer->id)->where('type_id', $item['variety_id'])->where('product_id', $item['spec_id'])->value('box_id');
|
|
|
+ $box_id = CustomerSpec::where('customer_id', $customer->id)->where('type_id', $item['variety_id'])->where('product_id', $item['spec_id'])->value('box_id');
|
|
|
if($box_id){
|
|
|
$boxNum = StockDetail::setStockConfigNum($box_id, (string)-$item['num'], StockConfig::PackingBox);
|
|
|
$stockData[] = [
|
|
|
@@ -120,7 +120,7 @@ class SpecService{
|
|
|
StockDetail::setStockConfigNum($delivery->variety_id, bcsub($delivery->weigh, $weight, 2), StockConfig::VarietyName);
|
|
|
|
|
|
//根据规格扣除包装箱
|
|
|
- $box_id = CustomerSpecBack::where('customer_id', $delivery->customer_id)->where('type_id', $delivery['variety_id'])->where('product_id', $delivery->spec_id)->value('box_id');
|
|
|
+ $box_id = CustomerSpec::where('customer_id', $delivery->customer_id)->where('type_id', $delivery['variety_id'])->where('product_id', $delivery->spec_id)->value('box_id');
|
|
|
if($box_id){
|
|
|
StockDetail::setStockConfigNum($box_id, bcsub((string)$delivery->num, $data['num'], 2), StockConfig::PackingBox);
|
|
|
}
|