Link a Journal Entry row to a document
A reference links one row of a Journal Entry to the document that explains the amount. On a receivable or payable row, the reference also allocates the amount to that invoice. When you submit the Journal Entry, ERPNext updates the invoice's outstanding amount.
Add a reference only when the entry really settles, adjusts, or reverses an amount of that document. For a plain note, use the User Remark of the row or an attachment.
Example: you write off 221 of a customer's submitted Sales Invoice.
| Account | Debit | Credit | Reference |
|---|---|---|---|
| Bad debts expense | 221 | ||
| Debtors (customer) | 221 | Sales Invoice, reduces its outstanding amount by 221 |
Prerequisites
- The document is submitted and belongs to the same company.
- The invoice has an outstanding amount at least as large as the row amount.
- No specific document fits better. For a receipt or a payment, use a Payment Entry. For a return, use a Credit Note or a Debit Note.
Add the reference
- Create the Journal Entry and add the balanced rows.
- Open the receivable or payable row with the edit icon.
- Select the Party Type (Customer or Supplier) and the Party.
- In the Reference section, select the Reference Type, for example Sales Invoice.
- Select the Reference Name, the exact document.
- Check the Reference Due Date that ERPNext fetches, and the row amount.
- Save and submit.
Open the invoice and check its outstanding amount. You can also check the Accounts Receivable or Accounts Payable report.
Documents that a row can reference
| Group | Reference types |
|---|---|
| Sales and purchases | Sales Invoice, Purchase Invoice, Sales Order, Purchase Order |
| Accounting | Journal Entry, Bank Transaction, Exchange Rate Revaluation, Invoice Discounting |
| Employees | Expense Claim, Payroll Entry, Employee Advance, Full and Final Statement |
| Other | Asset, Loan, Fees |
ERPNext filters Reference Name by company, party, account, and status. An order reference keeps the link for tracing but does not settle an invoice: an order has no outstanding amount.
You cannot set Payment Entry as the reference type yourself. ERPNext sets it only on system-generated entries. Use Payment Reconciliation to allocate payments.
Troubleshooting
Reference Name is empty
Select the Reference Type first. Check that the document is submitted, belongs to the same company and party, and has an outstanding amount.
The invoice outstanding amount did not change
The reference must be on the receivable or payable row, with the correct Party Type and Party. A reference on an expense, income, or bank row does not allocate.
The amount is more than the outstanding amount
Reduce the row amount to the outstanding amount, or check earlier allocations on the invoice.
The wrong invoice was referenced
Correct the draft. If the entry is submitted, cancel and amend it.