|
@@ -179,7 +179,7 @@ class NowReportHandle extends Command
|
|
|
wait_in_stock '待入库存数量',
|
|
|
wait_out_stock '待出库存数量',
|
|
|
usable_stock '可用库存数量',
|
|
|
- wait_out_stock+usable_stock '当前库存',
|
|
|
+ wait_out_stock+usable_stock '当前库存数量',
|
|
|
'' as '可用库存金额',
|
|
|
'' as '当前库存金额',
|
|
|
'' as '保质期时间',
|
|
@@ -187,7 +187,7 @@ class NowReportHandle extends Command
|
|
|
wgb.creater as 'CGD.采购员',
|
|
|
ws.`name` as '供应商名称',
|
|
|
wwi.`name` as '仓库名称',
|
|
|
- '' as '最近入库时间' ")
|
|
|
+ wp.addtime as '备库创建时间' ")
|
|
|
->leftJoin('purchease_order wpo', 'wgs.spuCode = wpo.spuCode and order_source=0')
|
|
|
->leftJoin('purchease wp', 'wp.bk_code = wpo.bkcode')
|
|
|
->leftJoin('warehouse_info wwi', 'wwi.wsm_code = wgs.wsm_code')
|
|
@@ -207,9 +207,8 @@ class NowReportHandle extends Command
|
|
|
$value['一级分类'] = isset($cat[0]['name'])?$cat[0]['name']:"";
|
|
|
$value['可用库存金额'] = bcmul((string)$value['可用库存数量'] ?? '0', (string)$value['成本单价'] ?? '0', 2);
|
|
|
$value['当前库存金额'] = bcmul((string)$value['当前库存'] ?? '0', (string)$value['成本单价'] ?? '0', 2);
|
|
|
- $value['最近入库时间'] =Db::name("purchease_order")->alias("a")->leftJoin("purchease_in c","a.cgdNo=c.cgdNo")->where(["spuCode"=>
|
|
|
- $value['产品编号'],"order_type"=>1,"order_source"=>0,"c.status"=>[4,6]])->order("a.addtime desc")->value("c.addtime","");
|
|
|
- if (!empty($value['最近入库时间'])) {
|
|
|
+// $value['最近入库时间'] =Db::name("purchease_order")->alias("a")->leftJoin("purchease_in c","a.cgdNo=c.cgdNo")->where(["spuCode"=>$value['产品编号'],"order_type"=>1,"order_source"=>0,"c.status"=>[4,6]])->order("a.addtime desc")->value("c.addtime","");
|
|
|
+ if (!empty($value['备库创建时间'])) {
|
|
|
$value['保质期时间'] = date('Y-m-d H:i:s', strtotime($value['最近入库时间']) + 31536000);//365天之后
|
|
|
$value['库存天数'] = bcdiv((string)(time() - strtotime($value['最近入库时间'])), (string)(24 * 3600));//365天之后
|
|
|
}
|
|
@@ -423,7 +422,7 @@ class NowReportHandle extends Command
|
|
|
wpo.good_name as '商品名称',
|
|
|
if(wpi.status=4,wpi.send_num,wpi.wsm_num) '入库数量',
|
|
|
round( if(wpi.status=4,wpi.send_num,wpi.wsm_num) * good_price, 2 ) '入库金额',
|
|
|
- wpo.updatetime '本次入库时间',
|
|
|
+ wpi.updatetime '本次入库时间',
|
|
|
wgb.tax/100 '采购税率',
|
|
|
'' as '不含税入库金额',
|
|
|
'' as '税额',
|
|
@@ -433,7 +432,8 @@ class NowReportHandle extends Command
|
|
|
wpo.good_price '成本裸价',
|
|
|
wsm_type '仓库类型',
|
|
|
ws.name '供应商名称',
|
|
|
- wwi.name '仓库名称'
|
|
|
+ wwi.name '仓库名称',
|
|
|
+ wp.addtime '备库创建时间'
|
|
|
")->cursor();
|
|
|
$data=[];
|
|
|
foreach($list as $value){
|