|
|
@@ -456,7 +456,7 @@ class OrderSuperLoss extends Api
|
|
|
->alias('a')
|
|
|
->field([
|
|
|
'a.Gy0_yjno', 'a.Gy0_gxh', 'RTRIM(a.Gy0_gxmc) as Gy0_gxmc','RTRIM(a.Add_gxmc) as Add_gxmc','a.Gy0_ks', 'a.Gy0_ls', 'a.Gy0_计划接货数',
|
|
|
- 'a.Gy0_计划损耗', 'a.超节损承担比例','SUM(b.sczl_zcfp) as total_fp','SUM(b.sczl_cl) as total_cl','SUM(c.sczl_cl) as cl','SUM(c.sczl_fp) as fp',
|
|
|
+ 'a.Gy0_计划损耗', 'a.无形损承担比例','a.超节损承担比例','SUM(b.sczl_zcfp) as total_fp','SUM(b.sczl_cl) as total_cl','SUM(c.sczl_cl) as cl','SUM(c.sczl_fp) as fp',
|
|
|
])
|
|
|
->join('设备_产量计酬 b', 'a.Gy0_gdbh = b.sczl_gdbh AND a.Gy0_yjno = b.sczl_yjno AND a.Gy0_gxh = b.sczl_gxh','left')
|
|
|
->join('db_sczl c', 'a.Gy0_gdbh = c.sczl_gdbh AND a.Gy0_yjno = c.sczl_yjno AND a.Gy0_gxh = c.sczl_gxh','left')
|
|
|
@@ -559,7 +559,13 @@ class OrderSuperLoss extends Api
|
|
|
$gy_data[$k]['total_fp'] = $item['total_fp'] * $item['Gy0_ls'];
|
|
|
$gy_data[$k]['total_cl'] = $item['total_cl'] * $item['Gy0_ls'];
|
|
|
//无形损
|
|
|
- $gy_data[$k]['intangible_loss'] = round(number_format($gy_data[$k]['Gy0_计划损耗']/$plan_total,4) * $data['intangible_loss']);
|
|
|
+ if (floatval($item['无形损承担比例']) > 0){
|
|
|
+ $gy_data[$k]['intangible_loss'] = round(number_format($gy_data[$k]['Gy0_计划损耗']/$plan_total,4) * $data['intangible_loss'] * floatval($item['无形损承担比例']));
|
|
|
+
|
|
|
+ }else{
|
|
|
+ $gy_data[$k]['intangible_loss'] = round(number_format($gy_data[$k]['Gy0_计划损耗']/$plan_total,4) * $data['intangible_loss']);
|
|
|
+ }
|
|
|
+// $gy_data[$k]['intangible_loss'] = round(number_format($gy_data[$k]['Gy0_计划损耗']/$plan_total,4) * $data['intangible_loss']);
|
|
|
foreach ($waste_out as $entry) {
|
|
|
for ($i = 1; $i <= 13; $i++) {
|
|
|
$gxmcKey = "fp_gxmc" . $i;
|
|
|
@@ -786,7 +792,7 @@ class OrderSuperLoss extends Api
|
|
|
}
|
|
|
$order = $params['order'];
|
|
|
$field = 'Gy0_yjno,Gy0_gxh,rtrim(Gy0_gxmc) as Gy0_gxmc,rtrim(Add_gxmc) as Add_gxmc,Gy0_rate0,Gy0_rate1,损耗系数,无形损承担比例 as loss_one,超节损承担比例 as loss_two,超节损核算单价 as loss_thr,UniqId';
|
|
|
- $data =db('工单_工艺资料')->where('Gy0_gdbh',$order)->field($field)->select();
|
|
|
+ $data =db('工单_工艺资料')->where('Gy0_gdbh',$order)->where('Gy0_yjno',$params['yjno'])->field($field)->select();
|
|
|
$this->success('请求成功',$data);
|
|
|
}
|
|
|
/**
|