|
@@ -64,7 +64,7 @@ class InventoryAccountService
|
|
|
//动盘查询
|
|
//动盘查询
|
|
|
public function conditionPortStock($date_start,$date_end,$ownerId,$location,$barcode){
|
|
public function conditionPortStock($date_start,$date_end,$ownerId,$location,$barcode){
|
|
|
if (!$ownerId) return null;
|
|
if (!$ownerId) return null;
|
|
|
- $descr_c=Owner::where('id',$ownerId)->value('name');
|
|
|
|
|
|
|
+ $code=Owner::where('id',$ownerId)->value('code');
|
|
|
$sql='select * from (select result.*,rownum rn from (';
|
|
$sql='select * from (select result.*,rownum rn from (';
|
|
|
$sql.=' select customer.Descr_C as 货主,stockLog.客户 客户, 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码1, sku.ALTERNATE_SKU2 产品条码2, sku.ALTERNATE_SKU3 产品条码3, ';
|
|
$sql.=' select customer.Descr_C as 货主,stockLog.客户 客户, 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码1, sku.ALTERNATE_SKU2 产品条码2, sku.ALTERNATE_SKU3 产品条码3, ';
|
|
|
$sql.=' sku.Descr_C 商品名称, MAX(lot.LotAtt05) 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
|
|
$sql.=' sku.Descr_C 商品名称, MAX(lot.LotAtt05) 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
|
|
@@ -100,7 +100,7 @@ class InventoryAccountService
|
|
|
$sql.=' ,sku.Descr_C,FMLotNum,lot.LotAtt01,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
|
|
$sql.=' ,sku.Descr_C,FMLotNum,lot.LotAtt01,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
|
|
|
$sql.=' , storeStatus.QTY, storeStatus.QtyAllocated,stockLog.客户 ';
|
|
$sql.=' , storeStatus.QTY, storeStatus.QtyAllocated,stockLog.客户 ';
|
|
|
$sql.=' )result where 1=1 ';
|
|
$sql.=' )result where 1=1 ';
|
|
|
- if ($descr_c)$sql.=" and 货主 = '".$descr_c."' ";
|
|
|
|
|
|
|
+ if ($code)$sql.=" and 客户 = '".$code."' ";
|
|
|
// if ($location)$sql.=" and 库位 like '".$location."%' ";
|
|
// if ($location)$sql.=" and 库位 like '".$location."%' ";
|
|
|
if ($location){
|
|
if ($location){
|
|
|
$arr=array_filter(preg_split('/[,, ]+/is', $location));
|
|
$arr=array_filter(preg_split('/[,, ]+/is', $location));
|
|
@@ -125,7 +125,7 @@ class InventoryAccountService
|
|
|
}
|
|
}
|
|
|
//全盘查询
|
|
//全盘查询
|
|
|
private function conditionTotalStock($ownerId,$location,$barcode){
|
|
private function conditionTotalStock($ownerId,$location,$barcode){
|
|
|
- $descr_c=Owner::where('id',$ownerId)->value('name');
|
|
|
|
|
|
|
+ $code=Owner::where('id',$ownerId)->value('code');
|
|
|
$sql='select * from (select result.* from (';
|
|
$sql='select * from (select result.* from (';
|
|
|
$sql.=' select customer.Descr_C as 货主,storeStatus.CUSTOMERID 客户,storeStatus.LocationID 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码1, sku.ALTERNATE_SKU2 产品条码2, sku.ALTERNATE_SKU3 产品条码3, ';
|
|
$sql.=' select customer.Descr_C as 货主,storeStatus.CUSTOMERID 客户,storeStatus.LocationID 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码1, sku.ALTERNATE_SKU2 产品条码2, sku.ALTERNATE_SKU3 产品条码3, ';
|
|
|
$sql.=' sku.Descr_C 商品名称, MAX(lot.LotAtt05) 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
|
|
$sql.=' sku.Descr_C 商品名称, MAX(lot.LotAtt05) 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
|
|
@@ -139,7 +139,7 @@ class InventoryAccountService
|
|
|
$sql.=' ,sku.Descr_C,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
|
|
$sql.=' ,sku.Descr_C,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
|
|
|
$sql.=' ,storeStatus.CUSTOMERID,lot.LotAtt01 ';
|
|
$sql.=' ,storeStatus.CUSTOMERID,lot.LotAtt01 ';
|
|
|
$sql.=' )result where 1=1 ';
|
|
$sql.=' )result where 1=1 ';
|
|
|
- if ($descr_c)$sql.=" and 货主 = '".$descr_c."' ";
|
|
|
|
|
|
|
+ if ($code)$sql.=" and 客户 = '".$code."' ";
|
|
|
if ($location){
|
|
if ($location){
|
|
|
$arr=array_filter(preg_split('/[,, ]+/is', $location));
|
|
$arr=array_filter(preg_split('/[,, ]+/is', $location));
|
|
|
if (count($arr)==1){
|
|
if (count($arr)==1){
|