From 6a3cbe53b6e7e6d4d5dc1fcf30e7e0b212adf5f9 Mon Sep 17 00:00:00 2001 From: Chris LOMAME Date: Wed, 3 May 2017 19:34:41 +0200 Subject: [PATCH] fix(journal): zero new transaction lines debit and credit fields (#1577) This commit zeroes out the `debit`, `credit`, `debit_equiv`, and `credit_equiv` fields of a new transaction line by default. --- client/src/js/services/grid/TransactionService.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/js/services/grid/TransactionService.js b/client/src/js/services/grid/TransactionService.js index 085238bc39..f8bab379b8 100644 --- a/client/src/js/services/grid/TransactionService.js +++ b/client/src/js/services/grid/TransactionService.js @@ -173,6 +173,12 @@ function TransactionService($timeout, util, uiGridConstants, bhConstants, Notify var transactionRow = cloneAttributes(this._entity, TRANSACTION_SHARED_ATTRIBUTES); transactionRow.uuid = uuid(); + //Set zero to a new line of a transaction in the debit, credit, debit_equiv, credit_equiv fields. + transactionRow.debit = 0; + transactionRow.credit = 0; + transactionRow.debit_equiv = 0; + transactionRow.credit_equiv = 0; + // keep track of new rows in newRows array this._entity.newRows.post(transactionRow);