unknown 18 цаг өмнө
parent
commit
8e1fb7fb49

+ 4 - 1
application/api/controller/OrderSuperLoss.php

@@ -1097,7 +1097,7 @@ class OrderSuperLoss extends Api
                 LEFT JOIN db_sczl c ON a.Gy0_gdbh = c.sczl_gdbh AND a.Gy0_yjno = c.sczl_yjno AND a.Gy0_gxh = c.sczl_gxh
                 WHERE a.Gy0_gdbh = '{$order}' and a.GY0_Yjno = '{$yjno}' GROUP BY a.Gy0_yjno, a.Gy0_gxh ORDER BY a.Gy0_yjno, a.Gy0_gxh";
         $data = Db::query($sql);
-
+        halt($data);
         //手检数据
         $handData =db('db_手工检验')->where('sczl_gdbh',$order)->field('sum(sczl_cl) as cl,rtrim(sczl_yjgx) as sczl_gxh')->select();
         //包装及成品防护数据
@@ -1798,6 +1798,9 @@ private function calculateSuperLoss($gyData, $totalClData, $wasteDetails, $data,
         // 注意:calculateProduction() 已在之前调用,total_cl 已乘以 ls 和 ks
         // 现在只需要调整卷对卷的情况
         $vv['total_cl'] = $this->adjustProduction($vv, $totalClData);
+
+        // 计算计划损耗
+        $vv['Gy0_计划损耗'] = $vv['Gy0_计划损耗'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
         
         // 根据工序总产量计算班组分摊计划损耗
         foreach ($totalClData as $v) {