Bläddra i källkod

财务账面,明细汇总计算问题

MaiXinRong 1 vecka sedan
förälder
incheckning
adda56cf88

+ 2 - 2
app/public/js/cost_stage_book.js

@@ -403,7 +403,7 @@ $(document).ready(function() {
                     {title: '税率(%)', colSpan: '1', rowSpan: '1', field: 'tax', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '实付金额', colSpan: '1', rowSpan: '1', field: 'sf_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '入账金额', colSpan: '1', rowSpan: '1', field: 'in_tp', hAlign: 2, width: 80, type: 'Number'},
-                    {title: '入账金额(不含税)', colSpan: '1', rowSpan: '1', field: 'in_excl_tax_tp', hAlign: 2, width: 100, type: 'Number', readOnly: true},
+                    {title: '入账金额(不含税)', colSpan: '1', rowSpan: '1', field: 'in_excl_tax_tp', hAlign: 2, width: 100, type: 'Number'},
                     {title: '本期批注', colSpan: '1', rowSpan: '1', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
                     {title: '备注', colSpan: '1', rowSpan: '1', field: 'memo', hAlign: 0, width: 120, formatter: '@', cellType: 'ellipsisAutoTip'},
                 ],
@@ -427,7 +427,7 @@ $(document).ready(function() {
                     {title: '税率(%)', colSpan: '1', rowSpan: '1', field: 'tax', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '实付金额', colSpan: '1', rowSpan: '1', field: 'sf_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true},
                     {title: '入账金额', colSpan: '1', rowSpan: '1', field: 'in_tp', hAlign: 2, width: 80, type: 'Number'},
-                    {title: '入账金额(不含税)', colSpan: '1', rowSpan: '1', field: 'in_excl_tax_tp', hAlign: 2, width: 100, type: 'Number', readOnly: true},
+                    {title: '入账金额(不含税)', colSpan: '1', rowSpan: '1', field: 'in_excl_tax_tp', hAlign: 2, width: 100, type: 'Number'},
                     {title: '本期批注', colSpan: '1', rowSpan: '1', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
                     {title: '备注', colSpan: '1', rowSpan: '1', field: 'memo', hAlign: 0, width: 120, formatter: '@', cellType: 'ellipsisAutoTip'},
                 ],

+ 1 - 0
app/service/cost_stage_book.js

@@ -130,6 +130,7 @@ module.exports = app => {
                     const divNum = this.ctx.helper.add(1, this.ctx.helper.div(cl.tax, 100));
                     nd.in_excl_tax_tp = this.ctx.helper.div(nd.in_tp, divNum, this.ctx.costStage.decimal.tp);
                 }
+                if (d.in_excl_tax_tp !== undefined) nd.in_excl_tax_tp = this.ctx.helper.round(d.in_excl_tax_tp, this.ctx.costStage.decimal.tp);
                 if (od) {
                     updateDetail.push(nd);
                 } else {

+ 2 - 1
app/service/cost_stage_book_detail.js

@@ -122,6 +122,7 @@ module.exports = app => {
                     const divNum = this.ctx.helper.add(1, this.ctx.helper.div(cd.tax, 100));
                     nd.in_excl_tax_tp = this.ctx.helper.div(nd.in_tp, divNum, this.ctx.costStage.decimal.tp);
                 }
+                if (d.in_excl_tax_tp !== undefined) nd.in_excl_tax_tp = this.ctx.helper.round(d.in_excl_tax_tp, this.ctx.costStage.decimal.tp);
                 if (od) {
                     updateDetail.push(nd);
                 } else {
@@ -129,7 +130,7 @@ module.exports = app => {
                 }
             }
             const bookUpdate = calc ? await this._getBookUpdateData([...insertDetail, ...updateDetail], orgDetail[0].ledger_id) : null;
-            const orgBook = await this.ctx.service.costStageBook.getDataByCondition({ ledger_id: orgDetail[0].ledger_id });
+            const orgBook = await this.ctx.service.costStageBook.getDataByCondition({ stage_id: this.ctx.costStage.id, ledger_id: orgDetail[0].ledger_id });
             const orgLedger = await this.ctx.service.costStageLedger.getDataById(orgDetail[0].ledger_id);
             if (bookUpdate) {
                 if (!orgBook) {