POS Closing shows incorrect Closing Amount because change_amount is not deducted from cash received

When creating POS Invoices where customers pay more than the bill and change_amount is recorded, ERPNext adds the full cash received to the POS Closing total and does not subtract the change_amount. Result: system Closing > physical cash in drawer.

Detailed description / problem

When a POS sale is made where the customer pays more than the bill, the POS Invoice stores two relevant values:

  • paid_amount (or payment record) — the amount the customer handed to the cashier (e.g. 5).
  • change_amount — the amount returned to the customer as change (e.g. 3).

Expected behavior (logical / physical cash):

  • Expected cash in drawer after the sale = Opening + paid_amount - change_amount.
    • Example: Opening = 100; Bill = 2; Customer pays = 5; Change = 3 → physical cash = 100 + 5 - 3 = 102.

Actual ERPNext behavior (observed):

  • ERPNext calculates POS Closing as Opening + SUM(payments) and does not subtract change_amount.
    • Using the example above, ERPNext shows Opening + 5 = 105. This does not match the physical cash in drawer (102).

Why this is a problem

  • Reconciliation at closing gets a false positive difference. The system will show +3 or -3 depending on how the closing is performed, causing confusion and requiring manual corrections.
  • Audits and cash reporting become inaccurate unless users manually adjust the counted cash in the POS Closing Entry.

Steps to reproduce

  1. Create or open a POS session with an Opening Amount of 100.
  2. Create a POS Invoice for a bill amount of 2.
  3. Record a payment where the customer gives 5 cash and change_amount is 3.
  • Confirm in the POS Invoice that paid_amount (or linked Sales Invoice Payment) is 5 and change_amount is 3.
  1. Go to POS Closing Entry for that session/date and observe the expected/closing totals.
  • ERPNext will show Closing = 100 + 5 = 105 (i.e. it added the full paid amount).
  1. Physically count cash: you will have 102 in the drawer, demonstrating the mismatch.