Replace ad-hoc if/elif branches with a unified approach: 1. Read txn_currency from the transaction data 2. Convert amount → company currency via txn_rate 3. Derive each account's amount in its own currency 4. Recompute exact exchange rates from rounded amounts to keep Frappe's debit == credit in company currency Fixes the bug where a $40 debit was recorded as ~$25 debit and 40 AZN credit due to dividing instead of multiplying when the transaction currency matched the foreign account. Applies to both bank_api.py (_import_one_transaction JE path) and mapping.py (_create_journal_entry_for_brt). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| birbank_docs | ||
| kapital_bank | ||
| .editorconfig | ||
| .eslintrc | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| CLAUDE.md | ||
| README.md | ||
| api_endpoints.txt | ||
| license.txt | ||
| pyproject.toml | ||
| www.kapitalbank.az_Archive [26-03-12 17-06-17].har | ||
README.md
Kapital Bank
Kapital Bank Integration
Installation
You can install this app using the bench CLI:
cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch main
bench install-app kapital_bank
Contributing
This app uses pre-commit for code formatting and linting. Please install pre-commit and enable it for this repository:
cd apps/kapital_bank
pre-commit install
Pre-commit is configured to use the following tools for checking and formatting your code:
- ruff
- eslint
- prettier
- pyupgrade
License
unlicense