|
@@ -30,7 +30,7 @@ class InventoryController extends Controller
|
|
|
$TOLocation=$request->input('TOLocation');
|
|
$TOLocation=$request->input('TOLocation');
|
|
|
$LotAtt05=$request->input('LotAtt05');
|
|
$LotAtt05=$request->input('LotAtt05');
|
|
|
$LotAtt02_start=$request->input('LotAtt02_start');
|
|
$LotAtt02_start=$request->input('LotAtt02_start');
|
|
|
- $descr_c=$request->input('descr_c');
|
|
|
|
|
|
|
+ $customerid=$request->input('customerid');
|
|
|
$SKU=$request->input('SKU');
|
|
$SKU=$request->input('SKU');
|
|
|
$ALTERNATE_SKU1=$request->input('ALTERNATE_SKU1');
|
|
$ALTERNATE_SKU1=$request->input('ALTERNATE_SKU1');
|
|
|
$LotAtt02_end=$request->input('LotAtt02_end');
|
|
$LotAtt02_end=$request->input('LotAtt02_end');
|
|
@@ -46,6 +46,15 @@ class InventoryController extends Controller
|
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
|
|
+ if ($customerid){
|
|
|
|
|
+ $sql .= ' and TOCustomerID in (';
|
|
|
|
|
+ $arr = explode(',',$customerid);
|
|
|
|
|
+ foreach ($arr as $index => $data){
|
|
|
|
|
+ if ($index != 0)$sql .= ',';
|
|
|
|
|
+ $sql .= "'".$data."'";
|
|
|
|
|
+ }
|
|
|
|
|
+ $sql .= ') ';
|
|
|
|
|
+ }
|
|
|
$sql.=' group by TOCustomerID, TOLocation,FMSKU,FMLotNum union all ';
|
|
$sql.=' group by TOCustomerID, TOLocation,FMSKU,FMLotNum union all ';
|
|
|
$sql.=' select FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
|
|
$sql.=' select FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
|
|
@@ -53,6 +62,15 @@ class InventoryController extends Controller
|
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
if ($TOLocation)$sql .= " and FMLOCATION like '".$TOLocation."' ";
|
|
if ($TOLocation)$sql .= " and FMLOCATION like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
|
|
+ if ($customerid){
|
|
|
|
|
+ $sql .= ' and FMCUSTOMERID in (';
|
|
|
|
|
+ $arr = explode(',',$customerid);
|
|
|
|
|
+ foreach ($arr as $index => $data){
|
|
|
|
|
+ if ($index != 0)$sql .= ',';
|
|
|
|
|
+ $sql .= "'".$data."'";
|
|
|
|
|
+ }
|
|
|
|
|
+ $sql .= ') ';
|
|
|
|
|
+ }
|
|
|
$sql.=' group by FMCustomerID, FMLocation,FMSKU,FMLotNum union all ';
|
|
$sql.=' group by FMCustomerID, FMLocation,FMSKU,FMLotNum union all ';
|
|
|
$sql.=' select FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量,0 as 移入数量, FMLocation as 库位 ';
|
|
$sql.=' select FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量,0 as 移入数量, FMLocation as 库位 ';
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
@@ -60,6 +78,15 @@ class InventoryController extends Controller
|
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
if ($TOLocation)$sql .= " and FMLocation like '".$TOLocation."' ";
|
|
if ($TOLocation)$sql .= " and FMLocation like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
|
|
+ if ($customerid){
|
|
|
|
|
+ $sql .= ' and FMCUSTOMERID in (';
|
|
|
|
|
+ $arr = explode(',',$customerid);
|
|
|
|
|
+ foreach ($arr as $index => $data){
|
|
|
|
|
+ if ($index != 0)$sql .= ',';
|
|
|
|
|
+ $sql .= "'".$data."'";
|
|
|
|
|
+ }
|
|
|
|
|
+ $sql .= ') ';
|
|
|
|
|
+ }
|
|
|
$sql.=' group by FMLocation,FMCUSTOMERID,FMSKU,FMLotNum union all ';
|
|
$sql.=' group by FMLocation,FMCUSTOMERID,FMSKU,FMLotNum union all ';
|
|
|
$sql.=' select FMLotNum,FMSKU,TOCustomerID 客户,0 as 移出数量,sum(TOQty_Each)as 移入数量, TOLocation as 库位 ';
|
|
$sql.=' select FMLotNum,FMSKU,TOCustomerID 客户,0 as 移出数量,sum(TOQty_Each)as 移入数量, TOLocation as 库位 ';
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
@@ -67,6 +94,15 @@ class InventoryController extends Controller
|
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
if ($date_end) $sql.=" and addtime < to_date('".$date_end." 23:59:59','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
|
|
+ if ($customerid){
|
|
|
|
|
+ $sql .= ' and TOCustomerID in (';
|
|
|
|
|
+ $arr = explode(',',$customerid);
|
|
|
|
|
+ foreach ($arr as $index => $data){
|
|
|
|
|
+ if ($index != 0)$sql .= ',';
|
|
|
|
|
+ $sql .= "'".$data."'";
|
|
|
|
|
+ }
|
|
|
|
|
+ $sql .= ') ';
|
|
|
|
|
+ }
|
|
|
$sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
|
|
$sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
|
|
|
$sql.=' left join BAS_Customer customer on customer.CustomerID=stockLog.客户 ';
|
|
$sql.=' left join BAS_Customer customer on customer.CustomerID=stockLog.客户 ';
|
|
|
$sql.=' left join BAS_SKU sku on sku.SKU=stockLog.FMSKU and sku.CUSTOMERID=stockLog.客户 ';
|
|
$sql.=' left join BAS_SKU sku on sku.SKU=stockLog.FMSKU and sku.CUSTOMERID=stockLog.客户 ';
|
|
@@ -80,15 +116,6 @@ class InventoryController extends Controller
|
|
|
if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."' ";
|
|
if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."' ";
|
|
|
if ($LotAtt02_start)$sql.=" and 失效日期 >='".$LotAtt02_start." 00:00:00' ";
|
|
if ($LotAtt02_start)$sql.=" and 失效日期 >='".$LotAtt02_start." 00:00:00' ";
|
|
|
if ($LotAtt02_end)$sql.=" and 失效日期 <='".$LotAtt02_end." 23:59:59' ";
|
|
if ($LotAtt02_end)$sql.=" and 失效日期 <='".$LotAtt02_end." 23:59:59' ";
|
|
|
- if ($descr_c){
|
|
|
|
|
- $sql .= ' and 货主 in (';
|
|
|
|
|
- $descr_cs = explode(',',$descr_c);
|
|
|
|
|
- foreach ($descr_cs as $index => $descr_c){
|
|
|
|
|
- if ($index != 0)$sql .= ',';
|
|
|
|
|
- $sql .= "'".$descr_c."'";
|
|
|
|
|
- }
|
|
|
|
|
- $sql .= ') ';
|
|
|
|
|
- }
|
|
|
|
|
if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."' ";
|
|
if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."' ";
|
|
|
if ($page&&$paginate)$sql.=" and ROWNUM<='".$page*$paginate."'";
|
|
if ($page&&$paginate)$sql.=" and ROWNUM<='".$page*$paginate."'";
|
|
|
$sql.=' ) ';
|
|
$sql.=' ) ';
|
|
@@ -149,7 +176,7 @@ class InventoryController extends Controller
|
|
|
$paginate=$request->input('paginate')??50;
|
|
$paginate=$request->input('paginate')??50;
|
|
|
$oracleActTransactingLogs=$this->conditionQuery($request,$page,$paginate);
|
|
$oracleActTransactingLogs=$this->conditionQuery($request,$page,$paginate);
|
|
|
$oracleActTransactingLogs=json_encode($oracleActTransactingLogs);
|
|
$oracleActTransactingLogs=json_encode($oracleActTransactingLogs);
|
|
|
- $owners=OracleBasCustomer::select('descr_c')->where('customer_type','OW')->where('active_flag','Y')->get();
|
|
|
|
|
|
|
+ $owners=OracleBasCustomer::select('descr_c','customerid')->where('customer_type','OW')->where('active_flag','Y')->get();
|
|
|
$isTotalStock=false;
|
|
$isTotalStock=false;
|
|
|
return view('inventory.statement.changeInventory',compact('oracleActTransactingLogs','page','owners','isTotalStock'));
|
|
return view('inventory.statement.changeInventory',compact('oracleActTransactingLogs','page','owners','isTotalStock'));
|
|
|
}
|
|
}
|