Skip to content

[Bug]: Partial payment Payment Entry creation uses wrong account currencies in multi-currency setups #199

@my-dev-jour

Description

@my-dev-jour

Bug Description

The partial payment flow builds Payment Entry documents manually and sets both paid_from_account_currency and paid_to_account_currency from the invoice currency.

That diverges from ERPNext core Payment Entry logic, where party-account currency and bank/cash-account currency are resolved separately.

Expected Behavior

Partial payment Payment Entry creation should follow ERPNext core currency/account setup for:

  • party account currency
  • bank/cash account currency
  • exchange-rate handling
  • reference allocation

Actual Behavior

The custom partial payment path hardcodes account currencies from the invoice currency.

Steps to Reproduce

  1. Use POSNext partial payments in a multi-currency environment
  2. Create a sale where invoice currency differs from one or more linked accounts
  3. Add a partial payment through the POSNext flow
  4. Inspect the created Payment Entry values and resulting paid/outstanding behavior

Impact

  • incorrect paid/outstanding amounts in multi-currency sites
  • wrong exchange-rate or account-currency behavior
  • divergence from ERPNext core accounting logic

Suggested Fix

  • use ERPNext core get_payment_entry(...) flow where possible
  • or mirror ERPNext's account-currency resolution logic exactly instead of deriving both sides from invoice currency

Notes

This is separate from the partial-payment atomicity issue. The problem here is incorrect multi-currency setup even when the transaction itself succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions