|
|
@@ -4705,29 +4705,7 @@ class Whlabel extends Start_Controller
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if($details != 'DZ001'){
|
|
|
- $kw_info = $this->whlabel->find('warehouse = '.$warehouse['id'].' and sku = "' . $sku . '" and state = 0 and details != "DZ001"');
|
|
|
- //判断是否有货
|
|
|
- if(!empty($kw_info)){
|
|
|
- //判断是否有录入库位了
|
|
|
- if(empty($kw_info['details'])){
|
|
|
- if($kw_info['details'] != $details){
|
|
|
- $ed[] = ['msg'=>$sku . '的在系统中没有库位!'] ;
|
|
|
- $j++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }else{
|
|
|
- //如果有库位了 但是库位不匹配
|
|
|
- if($kw_info['details'] != $details){
|
|
|
- $ed[] = ['msg'=>$sku . '的系统库位是'.$kw_info['details'].'!'] ;
|
|
|
- $j++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
if ($num < 0) //扣减库存
|
|
|
{
|
|
|
@@ -4736,7 +4714,12 @@ class Whlabel extends Start_Controller
|
|
|
$j++;
|
|
|
continue;
|
|
|
}
|
|
|
- $data = $this->whlabel->find_all('warehouse = "' . $warehouse['id'] . '" and sku = "' . $sku . '" and (zd = "" or zd is null)and state = 0 and details = "'. $details .'"');
|
|
|
+ if(empty($details)){
|
|
|
+ $data = $this->whlabel->find_all('warehouse = "' . $warehouse['id'] . '" and sku = "' . $sku . '" and (zd = "" or zd is null) and state = 0');
|
|
|
+ }else{
|
|
|
+ $data = $this->whlabel->find_all('warehouse = "' . $warehouse['id'] . '" and sku = "' . $sku . '" and (zd = "" or zd is null) and state = 0 and details = "'. $details .'"');
|
|
|
+ }
|
|
|
+
|
|
|
if (count($data) < abs($num)) {
|
|
|
$ed[] = ['msg'=>$sku . '-扣减数量大于库存剩余数量!'] ;
|
|
|
$j++;
|
|
|
@@ -4760,6 +4743,25 @@ class Whlabel extends Start_Controller
|
|
|
}
|
|
|
} else if ($num > 0) //增加库存
|
|
|
{
|
|
|
+ if($details != 'DZ001'){
|
|
|
+ $kw_info = $this->whlabel->find('warehouse = '.$warehouse['id'].' and sku = "' . $sku . '" and state = 0 and details != "DZ001"');
|
|
|
+ //判断是否有货
|
|
|
+ if(!empty($kw_info)){
|
|
|
+ //判断库位是否匹配
|
|
|
+ if(empty($kw_info['details'])){
|
|
|
+ $ed[] = ['msg'=>$sku . '的在系统中没有库位!'] ;
|
|
|
+ $j++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if($kw_info['details'] != $details){
|
|
|
+ $ed[] = ['msg'=>$sku . '的系统库位是'.$kw_info['details'].'!'] ;
|
|
|
+ $j++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if ($warehouse['id'] == 5 && ($rktype == '' || ($rktype > 1 && $text == ''))) {
|
|
|
$ed[] = array('msg'=>$sku . '-增加必须填写增加类型,非类型1必须填写备注');
|
|
|
$j++;
|