|
|
@@ -141,7 +141,7 @@ class OrderSuperLoss extends Api
|
|
|
->where('d.仓库编号','Y101')
|
|
|
->whereRaw('LEFT(a.成品编码, ' . $num . ') = "' . $params['code'] . '"')
|
|
|
->field('DISTINCT(a.jjcp_gdbh) as Gd_gdbh,a.jjcp_yjno,rtrim(a.jjcp_cpdh) as 成品编码,rtrim(a.jjcp_cpmc) as 成品名称,a.jjcp_sj,a.jjcp_smb,b.计量单位,
|
|
|
- b.Gd_khdh, SUM(d.st_sl) as 实际投料 ,c.yj_Yjno, c.yj_ls,c.yj_ks')
|
|
|
+ b.Gd_khdh, SUM(d.st_sl) as 实际投料 ,c.yj_Yjno, c.yj_ls,c.yj_ks,c.质量考核')
|
|
|
->order('b.Gd_khdh,a.成品编码 asc,a.jjcp_yjno,d.st_rq desc')
|
|
|
->group('a.jjcp_gdbh,a.jjcp_yjno')
|
|
|
->page($pages)
|
|
|
@@ -161,7 +161,7 @@ class OrderSuperLoss extends Api
|
|
|
->where($where)
|
|
|
->where('d.仓库编号','Y101')
|
|
|
->field('DISTINCT(a.jjcp_gdbh) as Gd_gdbh,a.jjcp_yjno,rtrim(a.jjcp_cpdh) as 成品编码,rtrim(a.jjcp_cpmc) as 成品名称,a.jjcp_sj,a.jjcp_smb,b.计量单位,
|
|
|
- b.Gd_khdh, SUM(d.st_sl) as 实际投料,c.yj_Yjno, c.yj_ls,c.yj_ks')
|
|
|
+ b.Gd_khdh, SUM(d.st_sl) as 实际投料,c.yj_Yjno, c.yj_ls,c.yj_ks,c.质量考核')
|
|
|
->order('b.Gd_khdh,a.成品编码 asc,a.jjcp_yjno,d.st_rq desc')
|
|
|
->group('a.jjcp_gdbh,a.jjcp_yjno')
|
|
|
->page($pages)
|
|
|
@@ -337,7 +337,11 @@ class OrderSuperLoss extends Api
|
|
|
|
|
|
$reward = $order_loss * $moneyRate;
|
|
|
$data[$key]['reward_rate'] = '1';
|
|
|
- $data[$key]['reward_money'] = number_format($reward,2);
|
|
|
+ if ($data['质量考核'] === 0){
|
|
|
+ $data[$key]['reward_money'] = number_format($reward,2);
|
|
|
+ }else{
|
|
|
+ $data[$key]['reward_money'] = '';
|
|
|
+ }
|
|
|
// $data[$key]['reward_money'] = '';
|
|
|
$data[$key]['材料废'] = array_sum($material); //材料废
|
|
|
$data[$key]['零头处理'] = array_sum($change); //零头处理
|
|
|
@@ -419,8 +423,12 @@ class OrderSuperLoss extends Api
|
|
|
->where('a.行号',$params['yjno'])
|
|
|
->where('c.yj_Yjno',$params['yjno'])
|
|
|
->where('b.仓库编号','Y101')
|
|
|
+ ->where('c.质量考核',0)
|
|
|
->field($field)
|
|
|
->find();
|
|
|
+ if (empty($data)){
|
|
|
+ $this->error('该工单不参与考核');
|
|
|
+ }
|
|
|
if ($data['ls'] == 0){
|
|
|
$data['ls'] === 1;
|
|
|
}
|