|
@@ -631,6 +631,11 @@ class Sale extends Base
|
|
if (empty($etid)) {
|
|
if (empty($etid)) {
|
|
return error_show(1002, "未找到数据");
|
|
return error_show(1002, "未找到数据");
|
|
}
|
|
}
|
|
|
|
+ $retrun =Db::name("sale_return")->where([["orderCode","=",$orderCode],["is_del","=",0],["status","<",4]])
|
|
|
|
+ ->count();
|
|
|
|
+ if($retrun>0){
|
|
|
|
+ return error_show(1005,"存在未完成退货订单数据");
|
|
|
|
+ }
|
|
$arrtime = isset($this->post['arrtime']) && $this->post['arrtime'] != "" ? $this->post['arrtime'] : "";
|
|
$arrtime = isset($this->post['arrtime']) && $this->post['arrtime'] != "" ? $this->post['arrtime'] : "";
|
|
$token = isset($this->post['token']) && $this->post['token'] !== "" ? trim($this->post['token']) : "";
|
|
$token = isset($this->post['token']) && $this->post['token'] !== "" ? trim($this->post['token']) : "";
|
|
$apply_id = GetUserInfo($token);
|
|
$apply_id = GetUserInfo($token);
|
|
@@ -3451,6 +3456,11 @@ class Sale extends Base
|
|
if ($orderCode == "") {
|
|
if ($orderCode == "") {
|
|
return error_show(1002, "参数orderCoder不能为空");
|
|
return error_show(1002, "参数orderCoder不能为空");
|
|
}
|
|
}
|
|
|
|
+ $retrun =Db::name("sale_return")->where([["orderCode","=",$orderCode],["is_del","=",0],["status","<",4]])
|
|
|
|
+ ->count();
|
|
|
|
+ if($retrun>0){
|
|
|
|
+ return error_show(1005,"存在未完成退货订单数据");
|
|
|
|
+ }
|
|
$der = Db::name('sale')->where(['orderCode' => $orderCode, "is_del" => 0])->find();
|
|
$der = Db::name('sale')->where(['orderCode' => $orderCode, "is_del" => 0])->find();
|
|
if ($der == "") {
|
|
if ($der == "") {
|
|
return error_show(1002, "未找到出库订单单号");
|
|
return error_show(1002, "未找到出库订单单号");
|
|
@@ -3718,6 +3728,10 @@ class Sale extends Base
|
|
'wait_id'=>$outinfo['apply_id'],
|
|
'wait_id'=>$outinfo['apply_id'],
|
|
'wait_name'=>$outinfo['apply_name'],
|
|
'wait_name'=>$outinfo['apply_name'],
|
|
]);
|
|
]);
|
|
|
|
+ if($einfo['wsend_num']<$outinfo['send_num']){
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return error_show(1002, "订单待付货数量不足");
|
|
|
|
+ }
|
|
$orderstatus = $einfo['status'];
|
|
$orderstatus = $einfo['status'];
|
|
$einfo['send_num'] += $outinfo['send_num'];
|
|
$einfo['send_num'] += $outinfo['send_num'];
|
|
$einfo['wsend_num'] -= $outinfo['send_num'];
|
|
$einfo['wsend_num'] -= $outinfo['send_num'];
|