Skip to content

Commit

Permalink
fix(isracard): use the correct value for originalCurrency (#871)
Browse files Browse the repository at this point in the history
Co-authored-by: Baruch Odem (Rothkoff) <[email protected]>
  • Loading branch information
daniel-hauser and baruchiro authored Sep 2, 2024
1 parent 80c6757 commit 79d71a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scrapers/base-isracard-amex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ interface ScrapedTransaction {
moreInfo?: string;
dealSumOutbound: boolean;
currencyId: string;
currentPaymentCurrency: string;
dealSum: number;
fullPaymentDate?: string;
fullPurchaseDate?: string;
Expand Down Expand Up @@ -190,8 +191,9 @@ function convertTransactions(txns: ScrapedTransaction[], processedDate: string):
date: txnMoment.toISOString(),
processedDate: currentProcessedDate,
originalAmount: isOutbound ? -txn.dealSumOutbound : -txn.dealSum,
originalCurrency: convertCurrency(txn.currencyId),
originalCurrency: convertCurrency(txn.currentPaymentCurrency ?? txn.currencyId),
chargedAmount: isOutbound ? -txn.paymentSumOutbound : -txn.paymentSum,
chargedCurrency: convertCurrency(txn.currencyId),
description: isOutbound ? txn.fullSupplierNameOutbound : txn.fullSupplierNameHeb,
memo: txn.moreInfo || '',
installments: getInstallmentsInfo(txn) || undefined,
Expand Down

0 comments on commit 79d71a9

Please sign in to comment.