|
@@ -457,19 +457,19 @@ $(document).ready(() => {
|
|
|
return ZhCalc.round(data.camount, findDecimal(data.unit));
|
|
|
},
|
|
|
ca_tp: function (data) {
|
|
|
- return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.camount, findDecimal(data.unit))), totalPriceUnit);
|
|
|
+ return ZhCalc.round(data.ca_tp, totalPriceUnit);
|
|
|
},
|
|
|
amount: function (data) {
|
|
|
return ZhCalc.round(data.amount, findDecimal(data.unit));
|
|
|
},
|
|
|
a_tp: function (data) {
|
|
|
- return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.amount, findDecimal(data.unit))), totalPriceUnit);
|
|
|
+ return ZhCalc.round(data.a_tp, totalPriceUnit);
|
|
|
},
|
|
|
spamount: function (data) {
|
|
|
return ZhCalc.round(data.spamount, findDecimal(data.unit));
|
|
|
},
|
|
|
spa_tp: function (data) {
|
|
|
- return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.spamount, findDecimal(data.unit))), totalPriceUnit);
|
|
|
+ return ZhCalc.round(data.spa_tp, totalPriceUnit);
|
|
|
},
|
|
|
}
|
|
|
};
|
|
@@ -477,9 +477,11 @@ $(document).ready(() => {
|
|
|
makeBackColor: function () {
|
|
|
const rowCount = hzSpread.getActiveSheet().getRowCount();
|
|
|
for (let i = 0; i < rowCount; i++) {
|
|
|
- if ([3,4,5,6,7,8].indexOf(auditStatus) !== -1 && hzSpread.getActiveSheet().zh_data[i].camount != hzSpread.getActiveSheet().zh_data[i].spamount) {
|
|
|
+ if ([3,4,5,6,8].indexOf(auditStatus) !== -1 && hzSpread.getActiveSheet().zh_data[i].camount != hzSpread.getActiveSheet().zh_data[i].spamount) {
|
|
|
+ hzSpread.getActiveSheet().getRange(i, -1, 1, -1).backColor('#ffeeba');
|
|
|
+ } else if (auditStatus === 7 && hzSpread.getActiveSheet().zh_data[i].camount != hzSpread.getActiveSheet().zh_data[i].amount) {
|
|
|
hzSpread.getActiveSheet().getRange(i, -1, 1, -1).backColor('#ffeeba');
|
|
|
- } else if ([1,2,9].indexOf(auditStatus) !== -1 && hzSpread.getActiveSheet().zh_data[i].camount != hzSpread.getActiveSheet().zh_data[i].samount) {
|
|
|
+ } else if ([1,2,9].indexOf(auditStatus) !== -1 && !(hzSpread.getActiveSheet().zh_data[i].camount === '' || hzSpread.getActiveSheet().zh_data[i].camount === 0 || hzSpread.getActiveSheet().zh_data[i].camount === null)) {
|
|
|
hzSpread.getActiveSheet().getRange(i, -1, 1, -1).backColor('#ffeeba');
|
|
|
}
|
|
|
}
|
|
@@ -519,11 +521,17 @@ $(document).ready(() => {
|
|
|
const hzIndex = _.findIndex(hzList, { code: cl.code, name: cl.name, unit: cl.unit, unit_price: cl.unit_price});
|
|
|
const audit_amount = cl.audit_amount ? cl.audit_amount.split(',') : '';
|
|
|
const amount = audit_amount ? parseFloat(audit_amount[audit_amount.length - 1]) : 0;
|
|
|
+ cl.ca_tp = ZhCalc.round(ZhCalc.mul(ZhCalc.round(cl.unit_price, unitPriceUnit), ZhCalc.round(cl.camount, findDecimal(cl.unit))), totalPriceUnit);
|
|
|
+ cl.spa_tp = ZhCalc.round(ZhCalc.mul(ZhCalc.round(cl.unit_price, unitPriceUnit), ZhCalc.round(cl.spamount, findDecimal(cl.unit))), totalPriceUnit);
|
|
|
cl.amount = amount;
|
|
|
+ cl.a_tp = ZhCalc.round(ZhCalc.mul(ZhCalc.round(cl.unit_price, unitPriceUnit), ZhCalc.round(cl.amount, findDecimal(cl.unit))), totalPriceUnit);
|
|
|
if (hzIndex !== -1) {
|
|
|
hzList[hzIndex].camount = ZhCalc.add(hzList[hzIndex].camount, cl.camount);
|
|
|
+ hzList[hzIndex].ca_tp = ZhCalc.add(hzList[hzIndex].ca_tp, cl.ca_tp);
|
|
|
hzList[hzIndex].spamount = ZhCalc.add(hzList[hzIndex].spamount, cl.spamount);
|
|
|
+ hzList[hzIndex].spa_tp = ZhCalc.add(hzList[hzIndex].spa_tp, cl.spa_tp);
|
|
|
hzList[hzIndex].amount = ZhCalc.add(hzList[hzIndex].amount, amount);
|
|
|
+ hzList[hzIndex].a_tp = ZhCalc.add(hzList[hzIndex].a_tp, cl.a_tp);
|
|
|
} else {
|
|
|
hzList.push(cl);
|
|
|
}
|