Skip to content

Commit

Permalink
Merge pull request #2 from olma2077/master
Browse files Browse the repository at this point in the history
Add monobank FOP support
  • Loading branch information
OSadovy authored Mar 6, 2024
2 parents 9dc6e86 + c5fc9de commit 4e5b6b5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions my_import.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ CONFIG = [
("black", "UAH"): "Liabilities:Monobank:Black",
("black", "USD"): "Assets:Monobank:Black",
("white", "UAH"): "Assets:Monobank:White",
("fop", "UAH"): "Assets:Monobank:FOP",
# ("yellow", "UAH"): "Assets:Monobank:Yellow",
}
),
Expand Down
2 changes: 1 addition & 1 deletion src/uabean/downloaders/monobank.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _account(self, obj: dict) -> Account:
obj["id"],
obj["sendId"],
self.get_currency(obj["currencyCode"]),
obj["cashbackType"],
obj.get("cashbackType"),
self.get_decimal(obj["balance"]),
self.get_decimal(obj["creditLimit"]),
obj["type"],
Expand Down
2 changes: 1 addition & 1 deletion src/uabean/importers/monobank.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def extract(self, filename, existing_entries=None):
return entries

def entry_from_row(self, meta, account, account_currency, cashback_currency, row):
meta["category"] = self.mcc_codes[row[self.MCC_COL]]
meta["category"] = self.mcc_codes[row[self.MCC_COL].zfill(4)]
postings = []
dt = self.date_from_str(row[self.DATE_COL])
meta["time"] = dt.time().strftime("%H:%M:%S")
Expand Down

0 comments on commit 4e5b6b5

Please sign in to comment.