Show purchases and stock changes in the Profit and Loss ​

The usual formula for cost of goods sold (COGS) is:

text
COGS = Opening stock + Purchases - Closing stock

The Stock Balance report gives the opening and closing stock. The purchases are harder to find. With perpetual inventory, purchases go to the stock account, not to an expense account. Other stock value changes, from a Stock Entry, a Stock Reconciliation, or a Landed Cost Voucher, are also not visible in the Profit and Loss or the Trial Balance.

ERPNext v16 can book these amounts to two pairs of accounts. Each pair receives an equal debit and credit, so the net effect on your books is zero. The amounts still show in the Profit and Loss and the Trial Balance, where you can read the parts of COGS.

Account pairERPNext books it on
Purchase Expense Account and Purchase Expense Contra AccountPurchase Receipt, and Purchase Invoice with Update Stock
Expenses Added To Stock Account and Expenses Added To Stock Contra AccountStock Entry, Stock Reconciliation, and Landed Cost Voucher

Prerequisites ​

  • Four accounts for the two pairs exist in your chart of accounts. Expense accounts usually suit them.

Turn on stock expense entries ​

  1. Open Accounts Settings.
  2. In the Stock Expense Accounting section, select Book Stock Expense GL Entries.

When the checkbox is cleared (the default), ERPNext books none of these entries.

INFO

If a Company or an Item Default already had a Purchase Expense Account before the upgrade to v16, the upgrade selects Book Stock Expense GL Entries for you, so that those entries continue.

Set the accounts ​

  1. Open the Company. On the Buying and Selling tab:
    • In the Purchase Expense section, set Purchase Expense Account and Purchase Expense Contra Account.
    • In the Stock Expense section, set Expenses Added To Stock Account and Expenses Added To Stock Contra Account.
  2. To use other accounts for some items, set the same fields in the Item Defaults table of the Item, the Item Group, or the Brand.

ERPNext looks for the accounts in this order: Item, Item Group, Brand, Company.

Each company opts in by setting its accounts:

  • If a company has neither account of a pair, ERPNext books nothing for that pair.
  • If a company has only one account of a pair, ERPNext stops the transaction and asks you to set the missing account.

Accounting entries ​

For a Purchase Receipt of 10,000:

AccountDebitCredit
Purchase Expense Account10,000
Purchase Expense Contra Account10,000

For other stock transactions, the Expenses Added To Stock pair follows the change in stock value:

TransactionDebitCredit
Material Receipt, 10,000 inExpenses Added To Stock 10,000Expenses Added To Stock Contra 10,000
Material Issue, 5,000 outExpenses Added To Stock Contra 5,000Expenses Added To Stock 5,000
Manufacture, 10,000 of finished goods inExpenses Added To Stock 10,000Expenses Added To Stock Contra 10,000
Stock Reconciliation, 10,000 addedExpenses Added To Stock 10,000Expenses Added To Stock Contra 10,000
Stock Reconciliation, 5,000 removedExpenses Added To Stock Contra 5,000Expenses Added To Stock 5,000
Landed Cost Voucher, 10,000 of chargesExpenses Added To Stock 10,000Expenses Added To Stock Contra 10,000

A Material Transfer between warehouses does not change the total stock value, so ERPNext books nothing for it.