|
@@ -461,6 +461,7 @@ class Order extends BaseController
|
|
|
$wsm_in_code = substr($wsm_in_code, 0, -2) . str_pad($i, 2, '0', STR_PAD_LEFT);
|
|
|
$i++;
|
|
|
|
|
|
+ //入库单
|
|
|
$win = Db::name("purchease_in")->insertGetId([
|
|
|
"wsm_in_code" => $wsm_in_code,
|
|
|
"cgdNo" => $cgdNo,
|
|
@@ -559,12 +560,12 @@ class Order extends BaseController
|
|
|
|
|
|
if ($upcgd == false) throw new Exception('采购单数量更新失败');
|
|
|
}
|
|
|
- if ($cgdinfo[$cgdNo]['send_status'] == 3 && $cgdinfo[$cgdNo]['order_type'] != 1) {
|
|
|
+ if ($cgdinfo[$cgdNo]['send_status'] == 1 && $cgdinfo[$cgdNo]['order_type'] != 1) {
|
|
|
$send = Db::name("order_send")->where(["cgdNo" => $cgdNo, "status" => 1])->column("outCode");
|
|
|
if (!empty($send)) {
|
|
|
$out = Db::name("order_out")->where(["outCode" => $send, "status" => 0])->select()->toArray();
|
|
|
if (!empty($out)) {
|
|
|
- $up = Db::name("order_out")->where(["outCode" => $send, "status" => 0])->update(["status" => 1, 'wsm_code' => $cgdinfo['wsm_code'], "updatetime" => date('Y-m-d H:i:s')]);
|
|
|
+ $up = Db::name("order_out")->where(["outCode" => $send, "status" => 0])->update(["status" => 1, 'wsm_code' => $cgdinfo[$cgdNo]['wsm_code'], "updatetime" => date('Y-m-d H:i:s')]);
|
|
|
if ($up == false) throw new Exception('出库单出库失败');
|
|
|
else {
|
|
|
foreach ($out as $k => $v_outCode) {
|