Open melhembitar opened 1 month ago
The logic to calculate unallocated_amount
is incorrect. It needs following corrections:
base_paid_amount
instead of base_received_amount
for calculation when Payment Entry is of type Receive. And vice-versa for Pay.The following additional changes are proposed to do above properly:
unallocated_amount
.base_paid_amount
and base_received_amount
and add the row for Exchange Gain / Loss in Payment Deductions or Loss table automatically in the client side and while saving. This row will also be auto-updated whenever exchange gain/loss changes and during save. Removal of this row will not be permitted, but changing account and cost center will be possible.Another approach that is possible is to not add exchange gain / loss in the Deductions table and create separate fields for that. But that will be more breaking.
Information about bug
Process Overview in Bullet Points: Multi-Currency Setup:
CAD is the base currency, and payments can be made from foreign currency bank accounts. Payment Preparation:
When creating a payment entry from a foreign currency bank account, the system calculates the amount based on historical exchange rates, sourced from online platforms.
Unallocated Amount: The calculated amount difference (between the base currency and foreign currency) is placed in the Write-Off section as "Unallocated Amount" in the supplier's currency. This represents the discrepancy between the actual payment amount and the amount registered by the system. Adjusting Unallocated Amount:
User Action Required: The user must adjust this "Unallocated Amount" to match the exact amount received by the supplier. Risk: If the user skips this adjustment, the payment may be saved incorrectly, resulting in a discrepancy on the third-party account. Exchange Gain/Loss:
Once the unallocated amount is adjusted, the "Set Exchange Gain/Loss" button becomes active. The user can then specify an FX Gain/Loss account, which ensures the accounting entry reflects the actual currency exchange difference.
Diagram: Multi-Currency Payment Entry Flow. point 4 if not done it ll cause the problem in question
Start | v
Module
accounts
Version
ERPNext: v15.39.2 (HEAD) - Frappe Framework: v15.45.0 (HEAD)
Installation method
None
Relevant log output / Stack trace / Full Error Message.
No response