|
@@ -648,6 +648,7 @@ class ImportOrderFromCHandleData extends Command
|
|
|
|
|
|
$merge_num = Db::name("purchease_order")
|
|
|
->where(["bkcode" => $cgdinfo['bkcode'], "order_type" => $outinfo['order_type'], "is_del" => 0])
|
|
|
+ ->where('order_source', '<>', 0)//0备库单不计算在内
|
|
|
->field("sum(send_num)-sum(th_num) as num")
|
|
|
->find();
|
|
|
$cgd['balance_num'] = $cgd['total_num'] - $merge_num['num'];
|