ソースを参照

永久材料。税率问题

MaiXinRong 10 ヶ月 前
コミット
4f0b79e885
1 ファイル変更2 行追加2 行削除
  1. 2 2
      app/service/stage_yjcl.js

+ 2 - 2
app/service/stage_yjcl.js

@@ -62,7 +62,7 @@ module.exports = app => {
                 nd.m_order = d.m_order;
                 nd.spec = d.spec || '';
                 nd.unit = d.unit || '';
-                nd.tax = d.tax ? this.ctx.helper.round(d.tax, 0) : 0;
+                nd.tax = d.tax ? Math.min(Math.max(0, this.ctx.helper.round(d.tax, 0)), 100) : 0;
                 nd.arrive_time = d.arrive_time || '';
                 nd.source = d.source || '';
                 nd.bills_code = d.bills_code || '';
@@ -123,7 +123,7 @@ module.exports = app => {
                 if (d.m_order !== undefined) nd.m_order = d.m_order;
                 if (d.spec !== undefined) nd.spec = d.spec || '';
                 if (d.unit !== undefined) nd.unit = d.unit || '';
-                if (d.tax !== undefined) nd.tax = this.ctx.helper.round(d.tax, 0);
+                if (d.tax !== undefined) nd.tax = d.tax ? Math.min(Math.max(0, this.ctx.helper.round(d.tax, 0)), 100) : 0;
 
                 if (d.arrive_time !== undefined) nd.arrive_time = d.arrive_time || '';
                 if (d.source !== undefined) nd.source = d.source || '';