Show purchases and stock changes in the Profit and Loss
The usual formula for cost of goods sold (COGS) is:
COGS = Opening stock + Purchases - Closing stockThe 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 pair | ERPNext books it on |
|---|---|
| Purchase Expense Account and Purchase Expense Contra Account | Purchase Receipt, and Purchase Invoice with Update Stock |
| Expenses Added To Stock Account and Expenses Added To Stock Contra Account | Stock 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
- Open Accounts Settings.
- 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
- 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.
- 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:
| Account | Debit | Credit |
|---|---|---|
| Purchase Expense Account | 10,000 | |
| Purchase Expense Contra Account | 10,000 |
For other stock transactions, the Expenses Added To Stock pair follows the change in stock value:
| Transaction | Debit | Credit |
|---|---|---|
| Material Receipt, 10,000 in | Expenses Added To Stock 10,000 | Expenses Added To Stock Contra 10,000 |
| Material Issue, 5,000 out | Expenses Added To Stock Contra 5,000 | Expenses Added To Stock 5,000 |
| Manufacture, 10,000 of finished goods in | Expenses Added To Stock 10,000 | Expenses Added To Stock Contra 10,000 |
| Stock Reconciliation, 10,000 added | Expenses Added To Stock 10,000 | Expenses Added To Stock Contra 10,000 |
| Stock Reconciliation, 5,000 removed | Expenses Added To Stock Contra 5,000 | Expenses Added To Stock 5,000 |
| Landed Cost Voucher, 10,000 of charges | Expenses Added To Stock 10,000 | Expenses Added To Stock Contra 10,000 |
A Material Transfer between warehouses does not change the total stock value, so ERPNext books nothing for it.