Skip to content

Commit

Permalink
fix NAN.undefined in OHADA assessment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebed-meleck committed Feb 18, 2024
1 parent 21f13b9 commit 28c4997
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions server/controllers/finance/reports/ohada_balance_sheet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,13 @@ function reporting(options, session) {
}
return item;
});

/**
* displays depreciation in positive values
*/
assetTable.forEach(item => {
item.currentAmo *= -1;
if (item.currentAmo) {
item.currentAmo *= -1;
}
});

/**
Expand All @@ -245,8 +246,12 @@ function reporting(options, session) {
* values, so for doing that we will multiply them by -1
*/
liabilityTable.forEach(item => {
item.currentNet *= -1;
item.previousNet *= -1;
if (item.currentNet) {
item.currentNet *= -1;
}
if (item.previousNet) {
item.previousNet *= -1;
}
});

_.merge(context, { assetTable, liabilityTable });
Expand Down

0 comments on commit 28c4997

Please sign in to comment.