Преглед изворни кода

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang пре 4 недеља
родитељ
комит
0232e2d153

+ 1 - 1
app/controller/material_controller.js

@@ -855,7 +855,7 @@ module.exports = app => {
                 }
                 }
 
 
                 // 取当前期截止上期含税金额
                 // 取当前期截止上期含税金额
-                renderData.ex_pre_tp_hs = await ctx.service.material.getExPreTpHs(ctx.tender.id, ctx.material.order, ctx.material.decimal.tp);
+                // renderData.ex_pre_tp_hs = await ctx.service.material.getExPreTpHs(ctx.tender.id, ctx.material.order, ctx.material.decimal.tp);
                 renderData.materialType = materialConst;
                 renderData.materialType = materialConst;
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.material.exponent);
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.material.exponent);
                 // 判断之前期有无调用过材料税
                 // 判断之前期有无调用过材料税

+ 1 - 1
app/public/js/measure_material.js

@@ -262,7 +262,7 @@ $(function () {
             materialTotalPrice.m_tp = ZhCalc.add(materialTotalPrice.m_tp, ZhCalc.round(s.m_tp, s.decimal.tp));
             materialTotalPrice.m_tp = ZhCalc.add(materialTotalPrice.m_tp, ZhCalc.round(s.m_tp, s.decimal.tp));
             materialTotalPrice.tax_tp = !s.material_tax ? ZhCalc.add(materialTotalPrice.tax_tp, ZhCalc.round(ZhCalc.mul(s.m_tp, 1 + s.rate / 100), s.decimal.tp)) : materialTotalPrice.tax_tp;
             materialTotalPrice.tax_tp = !s.material_tax ? ZhCalc.add(materialTotalPrice.tax_tp, ZhCalc.round(ZhCalc.mul(s.m_tp, 1 + s.rate / 100), s.decimal.tp)) : materialTotalPrice.tax_tp;
             materialTotalPrice.ex_tp = ZhCalc.add(materialTotalPrice.ex_tp, ZhCalc.round(s.ex_tp, s.decimal.tp));
             materialTotalPrice.ex_tp = ZhCalc.add(materialTotalPrice.ex_tp, ZhCalc.round(s.ex_tp, s.decimal.tp));
-            materialTotalPrice.ex_tax_tp = ZhCalc.add(materialTotalPrice.ex_tax_tp, ZhCalc.round(ZhCalc.mul(s.ex_tp, 1 + s.exponent_rate / 100), s.decimal.tp));
+            materialTotalPrice.ex_tax_tp = ZhCalc.add(materialTotalPrice.ex_tax_tp, s.ex_tax_tp);
             materialTotalPrice.m_tax_tp = s.material_tax ? ZhCalc.add(materialTotalPrice.m_tax_tp, ZhCalc.round(s.m_tax_tp, s.decimal.tp)) : materialTotalPrice.m_tax_tp;
             materialTotalPrice.m_tax_tp = s.material_tax ? ZhCalc.add(materialTotalPrice.m_tax_tp, ZhCalc.round(s.m_tax_tp, s.decimal.tp)) : materialTotalPrice.m_tax_tp;
         }
         }
         materialTotalPrice.total_tp = ZhCalc.add(materialTotalPrice.m_tp, materialTotalPrice.ex_tp);
         materialTotalPrice.total_tp = ZhCalc.add(materialTotalPrice.m_tp, materialTotalPrice.ex_tp);

+ 3 - 3
app/view/material/exponent.ejs

@@ -134,7 +134,7 @@
                                                 <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, material.exponent_decimal.tp) : null %></td>
                                                 <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, material.exponent_decimal.tp) : null %></td>
                                                 <td class="text-center"><%= material.ex_tax_tp !== null ? ctx.helper.round(material.ex_tax_tp,  material.exponent_decimal.tp) : null %></td>
                                                 <td class="text-center"><%= material.ex_tax_tp !== null ? ctx.helper.round(material.ex_tax_tp,  material.exponent_decimal.tp) : null %></td>
                                                 <td class="text-center"><%= material.ex_tp !== null || material.ex_pre_tp !== null ? ctx.helper.add(ctx.helper.round(material.ex_tp, material.exponent_decimal.tp), material.ex_pre_tp) : null %></td>
                                                 <td class="text-center"><%= material.ex_tp !== null || material.ex_pre_tp !== null ? ctx.helper.add(ctx.helper.round(material.ex_tp, material.exponent_decimal.tp), material.ex_pre_tp) : null %></td>
-                                                <td class="text-center"><%= material.ex_tax_tp !== null || ex_pre_tp_hs !== null ? ctx.helper.add(ex_pre_tp_hs, ctx.helper.round(material.ex_tax_tp, material.exponent_decimal.tp)) : null %></td>
+                                                <td class="text-center"><%= material.ex_tax_tp !== null || material.ex_tax_pre_tp !== null ? ctx.helper.add(material.ex_tax_pre_tp, ctx.helper.round(material.ex_tax_tp, material.exponent_decimal.tp)) : null %></td>
                                             </tr>
                                             </tr>
                                         <% } %>
                                         <% } %>
                                         <tr id="total_set">
                                         <tr id="total_set">
@@ -142,7 +142,7 @@
                                             <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, material.exponent_decimal.tp) : null %></td>
                                             <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, material.exponent_decimal.tp) : null %></td>
                                             <td class="text-center"><%= material.ex_tax_tp !== null ? ctx.helper.round(material.ex_tax_tp,  material.exponent_decimal.tp) : null %></td>
                                             <td class="text-center"><%= material.ex_tax_tp !== null ? ctx.helper.round(material.ex_tax_tp,  material.exponent_decimal.tp) : null %></td>
                                             <td class="text-center"><%= material.ex_tp !== null || material.ex_pre_tp !== null ? ctx.helper.add(ctx.helper.round(material.ex_tp, material.exponent_decimal.tp), material.ex_pre_tp) : null %></td>
                                             <td class="text-center"><%= material.ex_tp !== null || material.ex_pre_tp !== null ? ctx.helper.add(ctx.helper.round(material.ex_tp, material.exponent_decimal.tp), material.ex_pre_tp) : null %></td>
-                                            <td class="text-center"><%= material.ex_tax_tp !== null || ex_pre_tp_hs !== null ? ctx.helper.add(ex_pre_tp_hs, ctx.helper.round(material.ex_tax_tp, material.exponent_decimal.tp)) : null %></td>
+                                            <td class="text-center"><%= material.ex_tax_tp !== null || material.ex_tax_pre_tp !== null ? ctx.helper.add(material.ex_tax_pre_tp, ctx.helper.round(material.ex_tax_tp, material.exponent_decimal.tp)) : null %></td>
                                         </tr>
                                         </tr>
                                     </table>
                                     </table>
                                 </div>
                                 </div>
@@ -210,7 +210,7 @@
     let ex_tp = <%= material.ex_tp !== null ? material.ex_tp : 0 %>;
     let ex_tp = <%= material.ex_tp !== null ? material.ex_tp : 0 %>;
     let ex_tax_tp = <%= material.ex_tax_tp !== null ? material.ex_tax_tp : 0 %>;
     let ex_tax_tp = <%= material.ex_tax_tp !== null ? material.ex_tax_tp : 0 %>;
     const ex_pre_tp = <%= material.ex_pre_tp !== null ? material.ex_pre_tp : 0 %>;
     const ex_pre_tp = <%= material.ex_pre_tp !== null ? material.ex_pre_tp : 0 %>;
-    const ex_pre_tp_hs = <%= ex_pre_tp_hs !== null ? ex_pre_tp_hs : 0 %>;
+    const ex_pre_tp_hs = <%= material.ex_tax_pre_tp !== null ? material.ex_tax_pre_tp : 0 %>;
     const materialType = JSON.parse('<%- JSON.stringify(materialType) %>');
     const materialType = JSON.parse('<%- JSON.stringify(materialType) %>');
     let ex_calc = JSON.parse('<%- JSON.stringify(ex_calc) %>');
     let ex_calc = JSON.parse('<%- JSON.stringify(ex_calc) %>');
     let ex_calcList = [];
     let ex_calcList = [];