Skip to content

Commit

Permalink
fix(journal): catch editing errors
Browse files Browse the repository at this point in the history
This commit catches a few errors when editing the Posting Journal related to specialized editing variables.

Closes #1536.  Closes #1560.  Closes #1558.
  • Loading branch information
mbayopanda authored and jniles committed Apr 27, 2017
1 parent 57528e1 commit de7451a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions client/src/js/services/grid/TransactionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ function TransactionService($timeout, util, uiGridConstants, bhConstants, Notify
ERR_DEB_CRED_NOT_NULL = 'POSTING_JOURNAL.ERRORS.DEB_CRED_NOT_NULL',
ERR_CREDITED_DEBITED = 'POSTING_JOURNAL.ERRORS.CREDITED_DEBITED';

// If the transaction has 0 line
if (numberOfLine === 0) {
return;
}

// If the transaction are single line transaction
if (numberOfLine === 1) {
return ERR_SINGLE_LINE_TRANSACTION;
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/journal/journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ function JournalController(Journal, Sorting, Grouping,

// remove the entity
function removeEntity(row) {
if (!row.entity_uuid) { return; }
if (!row.hrEntity) { return; }

transactions.editCell(row, 'entity_uuid', null);
delete row.entity_uuid;
Expand Down
4 changes: 4 additions & 0 deletions server/controllers/finance/journal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ function transformColumns(rows, newRecord) {
delete row.account_number;
}

if (row.account_name) {
delete row.account_name;
}

if (row.hrEntity) {
// reverse barcode lookup entity
databaseRequests.push(ENTITY_QUERY);
Expand Down

0 comments on commit de7451a

Please sign in to comment.