|
@@ -3471,6 +3471,10 @@ class Sale extends Base
|
|
|
if (empty($einfo)) {
|
|
|
return error_show(1002, "未找到销售订单数据");
|
|
|
}
|
|
|
+ $is_reurn =Db::name("sale_return")->where(['orderCode' => $outinfo['orderCode'], 'is_del' => 0])->where("status","<",4)->find();
|
|
|
+ if ($is_reurn!=false){
|
|
|
+ return error_show(1002, "销售单存在退货未处理完成");
|
|
|
+ }
|
|
|
$post_name = isset($this->post['post_name']) &&$this->post['post_name']!="" ? trim($this->post['post_name']):"";
|
|
|
if($post_name==""){
|
|
|
return error_show(1004,"参数post_name不能为空");
|
|
@@ -3489,7 +3493,9 @@ class Sale extends Base
|
|
|
$outinfo['status'] = 2;
|
|
|
$outinfo['updatetime'] = date("Y-m-d H:i:s");
|
|
|
$outinfo['remark'] = $remark;
|
|
|
-
|
|
|
+ if($einfo['wsend_num']<$outinfo['send_num']){
|
|
|
+ return error_show(1004,"订单未发货数量不足");
|
|
|
+ }
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
$up =Db::name("order_out")->save($outinfo);
|