Fix the "Credit To" account error on a Purchase Invoice ​

The Credit To field of a Purchase Invoice holds the account that records what you owe the supplier until you pay. ERPNext blocks the invoice with an Invalid Account error when that account has the wrong type.

Error messages ​

MessageCause
Please ensure that the Credit To account is a Balance Sheet account. You can change the parent account to a Balance Sheet account or select a different account.Credit To is an income or expense account.
Please ensure that the Credit To account <account> is a Payable account. You can change the account type to Payable or select a different account.Credit To is a Balance Sheet account, but its Account Type is not Payable.

Fix the error ​

  1. Open the Purchase Invoice and check Credit To.
  2. Select the supplier payable account of the company, for example "Creditors".
  3. If no account fits, open the account in the Chart of Accounts. Check that it is under Liabilities and that Account Type is Payable.
  4. Submit the invoice again.

If the wrong account comes back on every new invoice, fix the default:

  • On the Supplier form, in the Per-Company Accounts table, set the payable account for the company.
  • On the Company form, set Default Payable Account.

Why the account must be a payable liability ​

A Purchase Invoice records a debt to the supplier. The debt stays in the payable account until you pay it:

DocumentDebitCredit
Purchase InvoiceExpense, stock, or asset accountSupplier payable (Credit To)
Payment EntrySupplier payableBank or cash

The expense or stock account goes on the item rows, on the debit side. It never goes in Credit To.

The correct account does not appear in Credit To ​

Check that the account belongs to the company of the invoice, is a ledger (not a group), is not disabled, and has Account Type set to Payable.