Skip to content

Advance Payment Ledger Entry should always populate base_amount and exchange_rate for foreign currency advances #51569

@elshafei-developer

Description

@elshafei-developer

Information about bug

base_amount and exchange_rate in the Advance Payment Ledger Entry are currently populated only when
advance_voucher_type is Employee Advance.

base_amount, exchange_rate = (
		(dr_or_cr, gle.transaction_exchange_rate)
		if gle.advance_voucher_type == "Employee Advance"
		else (None, None)
	)

Pull Request #50560

This behavior does not satisfy practical accounting requirements. Any Advance Payment Ledger Entry created in a currency different from the company currency must always store the company currency amount and the applied exchange rate, regardless of advance_voucher_type.

In our case
we implemented a custom DocType Employee Loan with the same accounting flow as Employee Advance, but since its advance_voucher_type is different, these fields remain empty, resulting in inconsistent and incomplete ledger data.

The logic should be generalized to populate base_amount and exchange_rate for all foreign-currency advance entries, not hardcoded to Employee Advance only.

Module

accounts

Version

ERPNext V16

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions