|
@@ -13,10 +13,9 @@ class InventoryController extends Controller
|
|
|
{
|
|
{
|
|
|
public function conditionQuery(Request $request,$page=null,$paginate=null){
|
|
public function conditionQuery(Request $request,$page=null,$paginate=null){
|
|
|
if(!Gate::allows("库存管理-动库报表")){ return redirect(url('/')); }
|
|
if(!Gate::allows("库存管理-动库报表")){ return redirect(url('/')); }
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
$date_start=$request->input('date_start');
|
|
$date_start=$request->input('date_start');
|
|
|
- if ($request->input('range'))$date_start=date('Y-m-d',strtotime('-'.$request->input('range')." day"));
|
|
|
|
|
|
|
+ $range = $request->input('range');
|
|
|
|
|
+ if ($range)$date_start=date('Y-m-d',strtotime('-'.$range." day"));
|
|
|
$date_end=$request->input('date_end');
|
|
$date_end=$request->input('date_end');
|
|
|
$TOLocation=$request->input('TOLocation');
|
|
$TOLocation=$request->input('TOLocation');
|
|
|
$LotAtt05=$request->input('LotAtt05');
|
|
$LotAtt05=$request->input('LotAtt05');
|
|
@@ -35,7 +34,6 @@ class InventoryController extends Controller
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='PA' ";
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='PA' ";
|
|
|
if ($date_start) $sql.=" and addtime > to_date('".$date_start." 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
|
|
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_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 ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by TOCustomerID, TOLocation,FMSKU,FMLotNum union all ';
|
|
$sql.=' group by TOCustomerID, TOLocation,FMSKU,FMLotNum union all ';
|
|
@@ -43,7 +41,6 @@ class InventoryController extends Controller
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
|
|
$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_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_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 ($TOLocation)$sql .= " and FMLOCATION like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by FMCustomerID, FMLocation,FMSKU,FMLotNum union all ';
|
|
$sql.=' group by FMCustomerID, FMLocation,FMSKU,FMLotNum union all ';
|
|
@@ -51,7 +48,6 @@ class InventoryController extends Controller
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
$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_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_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 ($TOLocation)$sql .= " and FMLocation like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by FMLocation,FMCUSTOMERID,FMSKU,FMLotNum union all ';
|
|
$sql.=' group by FMLocation,FMCUSTOMERID,FMSKU,FMLotNum union all ';
|
|
@@ -59,7 +55,6 @@ class InventoryController extends Controller
|
|
|
$sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
|
|
$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_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_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 ($TOLocation)$sql .= " and TOLocation like '".$TOLocation."' ";
|
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
if ($SKU)$sql.=" and FMSKU like '".$SKU."' ";
|
|
|
$sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
|
|
$sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
|