zhongzewei 7 tahun lalu
induk
melakukan
58c29a37de

+ 1 - 1
modules/ration_repository/models/ration_item.js

@@ -333,7 +333,7 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                                 }
                                 updatePrc.machinePrice = scMathUtil.roundTo(sumMaP, -2);
                             }
-                            updatePrc.basePrice = updatePrc.labourPrice + updatePrc.materialPrice + updatePrc.machinePrice;
+                            updatePrc.basePrice = scMathUtil.roundTo(updatePrc.labourPrice + updatePrc.materialPrice + updatePrc.machinePrice, -2);
                             //updateDataBase
                             rationItemModel.update({ID: rationItem.ID}, {$set: {labourPrice: updatePrc.labourPrice.toString(), materialPrice: updatePrc.materialPrice.toString(),
                                     machinePrice: updatePrc.machinePrice.toString(), basePrice: updatePrc.basePrice.toString()}},

+ 3 - 3
web/maintain/ration_repository/js/ration_glj.js

@@ -449,7 +449,7 @@ var rationGLJOprObj = {
                 });
                 let roundPrice = scMathUtil.roundTo(labourPrice, -2);
                 rst.labourPrice = roundPrice;
-                rationBasePrc += roundPrice;
+                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
             }
             if(price.gljType2.length > 0){
                 let materialPrice = 0;
@@ -458,7 +458,7 @@ var rationGLJOprObj = {
                 });
                 let roundPrice = scMathUtil.roundTo(materialPrice, -2);
                 rst.materialPrice = roundPrice;
-                rationBasePrc += roundPrice;
+                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
             }
             if(price.gljType3.length > 0){
                 let machinePrice = 0;
@@ -467,7 +467,7 @@ var rationGLJOprObj = {
                 });
                 let roundPrice = scMathUtil.roundTo(machinePrice, -2);
                 rst.machinePrice = roundPrice;
-                rationBasePrc += roundPrice;
+                rationBasePrc = scMathUtil.roundTo(rationBasePrc + roundPrice, -2);
             }
             rst.rationBasePrc = rationBasePrc;
         }