Skip to content

Commit

Permalink
calc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
needim committed Oct 1, 2024
1 parent a8efbeb commit 18f76a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/evolu-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ export const getCalculations_v2 = ({
CALC[i].result.actual[currency] ??= 0;
CALC[i].result.foresight[currency] ??= 0;

CALC[i].result.actual[currency] += actualAmount;
CALC[i].result.foresight[currency] += amount;
CALC[i].result.actual[currency] += type === "expense" ? -1 * actualAmount : actualAmount;
CALC[i].result.foresight[currency] += type === "expense" ? -1 * amount : amount;

CALC[i].result.inMainCurrency.actual[type] += actualAmount;
CALC[i].result.inMainCurrency.foresight[type] += amount;
Expand Down

0 comments on commit 18f76a8

Please sign in to comment.