|
@@ -220,7 +220,6 @@ class BillsCalcHelper {
|
|
|
constructor (project, CalcFlag) {
|
|
|
this.project = project;
|
|
|
this.CalcFlag = CalcFlag;
|
|
|
- this.digit = 2;
|
|
|
switch (this.CalcFlag) {
|
|
|
case rationContent:
|
|
|
this.calcField = rationContentCalcFields;
|
|
@@ -250,7 +249,7 @@ class BillsCalcHelper {
|
|
|
};
|
|
|
calcRationLeaf (node, fields) {
|
|
|
nodeCalcObj.node = node;
|
|
|
- nodeCalcObj.digit = this.digit;
|
|
|
+ nodeCalcObj.digit = this.project.Decimal.unitFee;
|
|
|
calcFees.checkFields(node.data, fields);
|
|
|
let nodeCalc = nodeCalcObj, virData= null;
|
|
|
|
|
@@ -266,10 +265,10 @@ class BillsCalcHelper {
|
|
|
nodeCalcObj.field = field;
|
|
|
switch (field.unitFeeFlag) {
|
|
|
case rationContentUnitFeeFlag:
|
|
|
- node.data.feesIndex[field.type].unitFee = nodeCalcObj.rationContentUnitFee().toDecimal(this.digit);
|
|
|
+ node.data.feesIndex[field.type].unitFee = nodeCalcObj.rationContentUnitFee().toDecimal(this.project.Decimal.common.unitFee);
|
|
|
break;
|
|
|
case averageQtyUnitFeeFlag:
|
|
|
- node.data.feesIndex[field.type].unitFee = nodeCalcObj.averageQty().toDecimal(this.digit);
|
|
|
+ node.data.feesIndex[field.type].unitFee = nodeCalcObj.averageQty().toDecimal(this.project.Decimal.common.unitFee);
|
|
|
break;
|
|
|
case billsPriceUnitFeeFlag:
|
|
|
node.data.feesIndex[field.type].unitFee = virData[field.type];
|
|
@@ -279,10 +278,10 @@ class BillsCalcHelper {
|
|
|
}
|
|
|
switch (field.totalFeeFlag) {
|
|
|
case sumTotalFeeFlag:
|
|
|
- node.data.feesIndex[field.type].totalFee = nodeCalcObj.sumTotalFee().toDecimal(this.digit);
|
|
|
+ node.data.feesIndex[field.type].totalFee = nodeCalcObj.sumTotalFee().toDecimal(this.project.Decimal.common.totalFee);
|
|
|
break;
|
|
|
case totalFeeFlag:
|
|
|
- node.data.feesIndex[field.type].totalFee = nodeCalcObj.totalFee().toDecimal(this.digit);
|
|
|
+ node.data.feesIndex[field.type].totalFee = nodeCalcObj.totalFee().toDecimal(this.project.Decimal.common.totalFee);
|
|
|
break;
|
|
|
default:
|
|
|
node.data.feesIndex[field.type].totalFee = 0;
|
|
@@ -297,7 +296,7 @@ class BillsCalcHelper {
|
|
|
calcFees.checkFields(node.data, fields);
|
|
|
for (let field of fields) {
|
|
|
nodeCalcObj.field = field;
|
|
|
- node.data.feesIndex[field.type].totalFee = nodeCalcObj.sumTotalFee().toDecimal(this.digit);
|
|
|
+ node.data.feesIndex[field.type].totalFee = nodeCalcObj.sumTotalFee().toDecimal(this.project.Decimal.common.totalFee);
|
|
|
}
|
|
|
};
|
|
|
calcNodes (nodes) {
|