Skip to content

Commit

Permalink
BRS-692: updating basic revenue formula for exporter (#60)
Browse files Browse the repository at this point in the history
* BRS-692: updating basic revenue formula for exporter

* BRS-692 deductPercentage -> inversePercentage
  • Loading branch information
cameronpettit authored Jul 6, 2022
1 parent c24955b commit 1f9c1b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lambda/formulaUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function arraySum(arr) {
return sum;
}

function deductPercentage(value, percentage) {
const result = (value * (100 - percentage)) / 100;
function inversePercentage(value, percentage) {
const result = (value * 100) / (100 + percentage)
return result;
}

Expand All @@ -53,7 +53,7 @@ exports.basicNetRevenue = function (revenues, customPercent) {
let result = null;
let percent = customPercent ? customPercent : gstPercent;
const gross = arraySum(revenues);
const net = deductPercentage(gross, percent);
const net = inversePercentage(gross, percent);
if (isValidNumber(gross)) {
result = formatMoney(net);
}
Expand Down

0 comments on commit 1f9c1b2

Please sign in to comment.