Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed new cal api amount field #776

Merged
merged 2 commits into from
Apr 21, 2023
Merged

Fixed new cal api amount field #776

merged 2 commits into from
Apr 21, 2023

Conversation

orzarchi
Copy link
Contributor

The CAL scraper is currently mixing up the converted amount and original amount in foreign transactions
Here's some real life data:
image

{
  ...
  "merchantName": "RYANAIR",
  "trnAmt": 175.09,
  "trnCurrencySymbol": "",
  "trnType": "רגילה",
  "trnTypeCode": "5",
  "amtBeforeConvAndIndex": 664.38,
  "debCrdCurrencySymbol": "",
  "comments": [
    {
      "key": "סכום הנחה בעמלת עסקאות מט\"ח",
      "value": "11.84"
    },
    {
      "key": "עמלת עסקת מט\"ח",
      "value": "18.42"
    },
    {
      "key": "עסקה עם הנחה בעמלת מט\"ח",
      "value": ""
    },
    {
      "key": "בתאריך 01/02/2023 בוצעה המרה ל-₪ בשער יציג 3.757",
      "value": ""
    }
  ],
  "transTypeCommentDetails": [
    "סכום העסקה - €175.09"
  ],
  ...
}

I don't blame the code, that's a VERY confusing api 😆
@baruchiro can you please take a look? 😄

@orzarchi orzarchi changed the title Fixed new cal api foreign tx handling Fixed new cal api amount field Apr 20, 2023
@orzarchi
Copy link
Contributor Author

orzarchi commented Apr 20, 2023

Upon further examination, we should always use amtBeforeConvAndIndex as the charged amount, for all currencies.
Other than foreign transaction, trnAmt is also incorrect when you get "discounted transactions" because of your loyalty club:
Screenshot 2023-04-21 at 2 24 25

{
...
  "trnNumaretor": 2,
  "trnAmt": 164,
  "trnCurrencySymbol": "",
  "trnType": "רגילה",
  "trnTypeCode": "5",
  "amtBeforeConvAndIndex": 147.6,
  "debCrdCurrencySymbol": "",
  "discountAmount": "₪16.4",
  ...
}

@esakal
Copy link
Collaborator

esakal commented Apr 21, 2023

@orzarchi is this one ready to be merged? I don't have an account there so I cannot verify the change by myself

@orzarchi
Copy link
Contributor Author

yep, I verified it

@esakal esakal merged commit 23553f9 into eshaham:master Apr 21, 2023
@github-actions
Copy link

🎉 This PR is included in version 3.8.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants