Quellcode durchsuchen

台账模式隐藏金额为0

ellisran vor 5 Monaten
Ursprung
Commit
0840df97e0
1 geänderte Dateien mit 17 neuen und 17 gelöschten Zeilen
  1. 17 17
      app/public/js/change_information.js

+ 17 - 17
app/public/js/change_information.js

@@ -825,11 +825,11 @@ $(document).ready(() => {
         },
         calcNodeTp: function (node) {
             node.change_amount = ZhCalc.add(node.oamount2, node.camount);
-            node.oa_tp = ZhCalc.round(ZhCalc.mul(node.oamount2, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-            node.ca_tp = ZhCalc.round(ZhCalc.mul(node.camount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-            node.sa_tp = ZhCalc.round(ZhCalc.mul(node.samount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-            const spa_tp = ZhCalc.round(ZhCalc.mul(node.spamount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-            node.changed_tp = readOnly ? ZhCalc.add(node.oa_tp, spa_tp) || 0 :  ZhCalc.add(node.oa_tp, node.ca_tp) || 0;
+            node.oa_tp = ZhCalc.round(ZhCalc.mul(node.oamount2, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+            node.ca_tp = ZhCalc.round(ZhCalc.mul(node.camount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+            node.sa_tp = ZhCalc.round(ZhCalc.mul(node.samount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+            const spa_tp = ZhCalc.round(ZhCalc.mul(node.spamount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+            node.changed_tp = readOnly ? ZhCalc.add(node.oa_tp, spa_tp) || null :  ZhCalc.add(node.oa_tp, node.ca_tp) || null;
         },
         refreshXmjData: function() {
             SpreadJsObj.resetTopAndSelect(xmjSheet);
@@ -917,7 +917,7 @@ $(document).ready(() => {
                     changeSpreadObj.calcOneSum(node);
                     if (readOnly) {
                         for (const aid of aidList) {
-                            node['sa_tp_' + aid] = ZhCalc.round(ZhCalc.mul(node['audit_amount_' + aid], ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
+                            node['sa_tp_' + aid] = ZhCalc.round(ZhCalc.mul(node['audit_amount_' + aid], ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
                         }
                     }
                 }
@@ -2925,25 +2925,25 @@ $(document).ready(() => {
                     node.samount = samount;
                     node.spamount = spamount;
                     node.change_amount = ZhCalc.add(oamount2, camount);
-                    node.oa_tp = ZhCalc.round(ZhCalc.mul(oamount2, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                    node.ca_tp = ZhCalc.round(ZhCalc.mul(camount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                    node.sa_tp = ZhCalc.round(ZhCalc.mul(samount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                    const spa_tp = ZhCalc.round(ZhCalc.mul(spamount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                    node.changed_tp = readOnly ? ZhCalc.add(node.oa_tp, spa_tp) || 0 :  ZhCalc.add(node.oa_tp, node.ca_tp) || 0;
+                    node.oa_tp = ZhCalc.round(ZhCalc.mul(oamount2, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                    node.ca_tp = ZhCalc.round(ZhCalc.mul(camount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                    node.sa_tp = ZhCalc.round(ZhCalc.mul(samount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                    const spa_tp = ZhCalc.round(ZhCalc.mul(spamount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                    node.changed_tp = readOnly ? ZhCalc.add(node.oa_tp, spa_tp) || null :  ZhCalc.add(node.oa_tp, node.ca_tp) || null;
                 }
                 node.is_valuation = is_valuation;
             } else if (node.clid) {
                 // node.oamount2 = ZhCalc.round(node.oamount2, findDecimal(node.unit));
                 // node.camount = ZhCalc.round(node.camount, findDecimal(node.unit));
                 // node.change_amount = ZhCalc.add(node.oamount2, node.camount);
-                node.oa_tp = ZhCalc.round(ZhCalc.mul(node.oamount2, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                node.ca_tp = ZhCalc.round(ZhCalc.mul(node.camount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                node.sa_tp = ZhCalc.round(ZhCalc.mul(node.samount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                const spa_tp = ZhCalc.round(ZhCalc.mul(node.spamount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
-                node.changed_tp = readOnly ? ZhCalc.add(node.oa_tp, spa_tp) || 0 : ZhCalc.add(node.oa_tp, node.ca_tp) || 0;
+                node.oa_tp = ZhCalc.round(ZhCalc.mul(node.oamount2, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                node.ca_tp = ZhCalc.round(ZhCalc.mul(node.camount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                node.sa_tp = ZhCalc.round(ZhCalc.mul(node.samount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                const spa_tp = ZhCalc.round(ZhCalc.mul(node.spamount, ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
+                node.changed_tp = readOnly ? ZhCalc.add(node.oa_tp, spa_tp) || null : ZhCalc.add(node.oa_tp, node.ca_tp) || null;
                 if (readOnly) {
                     for (const aid of aidList) {
-                        node['sa_tp_' + aid] = ZhCalc.round(ZhCalc.mul(node['audit_amount_' + aid], ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || 0;
+                        node['sa_tp_' + aid] = ZhCalc.round(ZhCalc.mul(node['audit_amount_' + aid], ZhCalc.round(node.unit_price, unitPriceUnit)), totalPriceUnit) || null;
                     }
                 }
             }