|
|
@@ -36,32 +36,32 @@ class InventoryController extends Controller
|
|
|
if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','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 (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
- if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."%' ";
|
|
|
- if ($SKU)$sql.=" and FMSKU like '".$SKU."%' ";
|
|
|
+ if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
|
+ if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by TOCustomerID, TOLocation,FMSKU,FMLotNum union all ';
|
|
|
$sql.=' select FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
|
|
|
if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','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 (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
- if ($TOLocation)$sql .= " and FMLOCATION like '".$TOLocation."%' ";
|
|
|
- if ($SKU)$sql.=" and FMSKU like '".$SKU."%' ";
|
|
|
+ if ($TOLocation)$sql .= " and FMLOCATION like '".$TOLocation."' ";
|
|
|
+ if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by FMCustomerID, FMLocation,FMSKU,FMLotNum union all ';
|
|
|
$sql.=' select FMLotNum,FMSKU,FMCUSTOMERID 客户,sum(FMQty_Each) as 移出数量,0 as 移入数量, FMLocation as 库位 ';
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
|
if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','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 (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
- if ($TOLocation)$sql .= " and FMLocation like '".$TOLocation."%' ";
|
|
|
- if ($SKU)$sql.=" and FMSKU like '".$SKU."%' ";
|
|
|
+ if ($TOLocation)$sql .= " and FMLocation like '".$TOLocation."' ";
|
|
|
+ if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by FMLocation,FMCUSTOMERID,FMSKU,FMLotNum union all ';
|
|
|
$sql.=' select FMLotNum,FMSKU,TOCustomerID 客户,0 as 移出数量,sum(TOQty_Each)as 移入数量, TOLocation as 库位 ';
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
|
if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','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 (!$date_start && !$date_end)$sql .= " and addtime >to_date('".date('Y-m-d H:i:s',strtotime("-1 day"))."','yyyy-mm-dd hh24:mi:ss') ";
|
|
|
- if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."%' ";
|
|
|
- if ($SKU)$sql.=" and FMSKU like '".$SKU."%' ";
|
|
|
+ if ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
|
+ if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)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.客户 ';
|
|
|
@@ -72,11 +72,11 @@ class InventoryController extends Controller
|
|
|
$sql.=' ,sku.Descr_C,FMLotNum,lot.LotAtt05,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
|
|
|
$sql.=' , storeStatus.QTY, storeStatus.QtyAllocated,stockLog.客户 ';
|
|
|
$sql.=' )result where 1=1 ';
|
|
|
- if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."%' ";
|
|
|
+ if ($LotAtt05)$sql .=" and 属性仓 like '".$LotAtt05."' ";
|
|
|
if ($LotAtt02_start)$sql.=" and 失效日期 >='".$LotAtt02_start." 00:00:00' ";
|
|
|
if ($LotAtt02_end)$sql.=" and 失效日期 <='".$LotAtt02_end." 23:59:59' ";
|
|
|
if ($descr_c)$sql.=" and 货主 ='".$descr_c."' ";
|
|
|
- if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."%' ";
|
|
|
+ if ($ALTERNATE_SKU1)$sql.=" and 产品条码 like '".$ALTERNATE_SKU1."' ";
|
|
|
if ($page&&$paginate)$sql.=" and ROWNUM<='".$page*$paginate."'";
|
|
|
$sql.=' ) ';
|
|
|
if ($page&&$paginate)$sql.=" where rn>'".($page-1)*$paginate."'";
|