|
@@ -44,9 +44,7 @@ class handleCxData extends command
|
|
|
foreach ($results as $result) {
|
|
|
$data=$result['data'] ?? [];
|
|
|
$qrd_insert_data=$wait_insert_data=$cgd_insert_data=[];
|
|
|
- $data['cat_name']=is_array($data['cat_name']) ? $data['cat_name'] : json_decode($data['cat_name'] ,
|
|
|
- true
|
|
|
- );
|
|
|
+ $data['cat_name']=is_array($data['cat_name']) ? $data['cat_name'] : json_decode($data['cat_name'],true);
|
|
|
if ($result['order_type'] == 1) {
|
|
|
$data['total_price']=$data['total_price'] - $data['th_fee'] - $data['diff_fee'];
|
|
|
$exitReport=Db::name("report_code")->where('qrdNo' , $data['orderCode'])->findOrEmpty();
|
|
@@ -125,6 +123,7 @@ class handleCxData extends command
|
|
|
'goodPrice'=>$data['sale_price'] ,//产品单价,
|
|
|
'totalPrice'=>$data['total_price'] ,//货款总额,
|
|
|
'total_origin_price'=>$data['total_origin_price'] ,//成本总额,
|
|
|
+ 'total_plan_price'=>$data['total_origin_price_plan'] ,//成本总额,
|
|
|
'sendNum'=>$data['send_num'] ,//已发货数量,
|
|
|
'wsendNum'=>$data['wsend_num'] ,//未发货数量,
|
|
|
'apay_fee'=>0 ,//已付款,
|
|
@@ -167,6 +166,36 @@ class handleCxData extends command
|
|
|
"orderCode"=>$data['orderCode'] ,
|
|
|
"status"=>1 ,
|
|
|
];
|
|
|
+ $re=Db::name('qrd_info')
|
|
|
+ ->where('id' , $exists_qrd['id'])
|
|
|
+ ->update([
|
|
|
+ 'poCode'=>$data['poNo'] ,//po编号,
|
|
|
+ 'workCode'=>$data['workNo'] ,//业务编号,
|
|
|
+ 'zxCode'=>$data['zxNo'] ,//咨询单编号,
|
|
|
+ 'goodMaterial'=>'' ,//商品材质,
|
|
|
+ 'goodUnit'=>$data['unit'] ,//商品单位,
|
|
|
+ 'goodDesc'=>$data['cost_desc'] ,//工艺说明,
|
|
|
+ 'goodType'=>$data['good_type'] ,//商品类型,
|
|
|
+ 'goodModel'=>'' ,//商品型号,
|
|
|
+ 'metalsType'=>$data['noble_metal'] ,//贵金属种类,
|
|
|
+ 'weight'=>$data['good_weight'] ,//商品重量,
|
|
|
+ 'deliveryDay'=>$data['delivery_day'] ,//物流天数,
|
|
|
+ 'workDay'=>$data['lead_time'] ,//工期,
|
|
|
+ 'tax'=>$data['tax'] ,//税率,
|
|
|
+ 'total_origin_price'=>$data['total_origin_price'] ,//成本总额,
|
|
|
+ 'total_plan_price'=>$data['total_origin_price_plan'] ,//成本总额,
|
|
|
+ 'sendNum'=>$data['send_num'] ,//已发货数量,
|
|
|
+ 'wsendNum'=>$data['wsend_num'] ,//未发货数量,
|
|
|
+ 'sendType'=>$data['send_type'] ,//发货方式
|
|
|
+ 'sendStatus'=>$data['send_status'] ,//发货状态,
|
|
|
+ 'remark'=>"" ,//备注,
|
|
|
+ 'area'=>$data['customer_name'] ,//公司,
|
|
|
+ 'customerAttr'=>$all_branch[$data['customer_code']]['parent'] ?? '' ,//客户属性,
|
|
|
+ 'branch'=>$all_branch[$data['customer_code']]['branch'] ?? '' ,//分公司,从客户表中查
|
|
|
+ 'pay_source'=>$data['pay_source'] ?? "" ,//支付渠道,
|
|
|
+ 'updatetime'=>$date
|
|
|
+ ]
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
} else {
|
|
@@ -213,6 +242,7 @@ class handleCxData extends command
|
|
|
'goodPrice'=>$data['sale_price'] ,//产品单价,
|
|
|
'totalPrice'=>$data['total_price'] ,//货款总额,
|
|
|
'total_origin_price'=>$data['total_origin_price'] ,//成本总额,
|
|
|
+ 'total_plan_price'=>$data['total_origin_price_plan'] ,//成本总额,
|
|
|
'sendNum'=>$data['send_num'] ,//已发货数量,
|
|
|
'wsendNum'=>$data['wsend_num'] ,//未发货数量,
|
|
|
'apay_fee'=>0 ,//已付款,
|
|
@@ -356,6 +386,43 @@ class handleCxData extends command
|
|
|
"status"=>1 ,
|
|
|
];
|
|
|
|
|
|
+ Db::name('cgd_info')
|
|
|
+ ->where('id' , $exists_cgd['id'])
|
|
|
+ ->update([
|
|
|
+ 'bkCode'=>$data['bkcode'] ,//备库单编号',
|
|
|
+ 'qrdCode'=>$data['qrdNo'] ,//确认单编号',
|
|
|
+ 'goodType'=>$data['good_type'] ,//商品类型',
|
|
|
+ 'goodBrand'=>$data['brand'] ,//商品品牌',
|
|
|
+ 'goodModel'=>'' ,//商品型号',
|
|
|
+ 'goodMaterial'=>'' ,//商品材质',
|
|
|
+ 'goodUnit'=>$data['unit'] ,//商品单位',
|
|
|
+ 'goodDesc'=>$data['cost_desc'] ,//工艺说明',
|
|
|
+ 'metalsType'=>$data['noble_metal'] ,//贵金属种类',
|
|
|
+ 'weight'=>$data['weight'] ,//商品重量',
|
|
|
+ 'is_diff'=>$data['is_diff'] ,//是否有工差',
|
|
|
+ 'deliveryDay'=>$data['delivery_day'] ,//物流天数',
|
|
|
+ 'workDay'=>$data['lead_time'] ,//产品工期',
|
|
|
+ 'tax'=>$data['tax'] ,//税点',
|
|
|
+ 'barePrice'=>$data['nake_fee'] ,//裸价',
|
|
|
+ 'markPrice'=>$data['mark_fee'] ,//加标费',
|
|
|
+ 'packPrice'=>$data['pakage_fee'] ,//包装费',
|
|
|
+ 'certPrice'=>$data['cert_fee'] ,//证书费',
|
|
|
+ 'openPrice'=>$data['open_fee'] ,//开模费',
|
|
|
+ 'costPrice'=>$data['teach_fee'] ,//工艺费',
|
|
|
+ 'deliveryPrice'=>$data['delivery_fee'] ,//物流费',
|
|
|
+ 'sendType'=>$data['send_type'] ,//发货方式',
|
|
|
+ 'bkCreater'=>$data['bkcreater'] ,//备库申请人',
|
|
|
+ 'sendStatus'=>$data['send_status'] ,//发货状态',
|
|
|
+ 'wsendNum'=>$data['wsend_num'] ,//未发货数量',
|
|
|
+ 'sendNum'=>$data['send_num'] ,//已发货数量',
|
|
|
+ 'wareHouse'=>$data['wsm_code'] ,//仓库名称',
|
|
|
+ 'wsmCode'=>$data['wsm_code'] ,//仓库编号',
|
|
|
+ 'remark'=>'' ,//备注',
|
|
|
+ 'cxCode'=>$data['oldCode'] ?? "" ,//备注,
|
|
|
+ 'check_rate'=>'' ,//修正后的税率',
|
|
|
+ 'updatetime'=>$date ,
|
|
|
+ ]
|
|
|
+ );
|
|
|
}
|
|
|
} else {
|
|
|
//新增
|