As you receive goods, these goods are now part of your stock. Lets say you received steel used in the manufacturing of your components worth $100.
Now you have $100 worth of steel in your warehouse, but you have neither paid for it, nor created a liability for it yet - That’s done when you do the invoice.
So, the Stock Received but not Billed is a temporary account into which a liability is created, just so that your books balance (the philosophy of double entry book keeping).
As you make a Purchase Invoice, this value in Stock Received but not Billed is nullified and in its place a liability in favor of the supplier is created. This $100 now moves to your accounts payable report.
And finally when you make a payment, your liability against your supplier is nullified and you use the money in your cash box or your bank to pay your supplier.
So, the net effect of this cycle is that you paid $100 and received $100 of steel. But because this happens on different time slices, these multiple accounts are necessary. But this has no effect on your Balance Sheet or your P&L. The money in your bank is now locked up in steel in your stores.
You can eliminate the Purchase Receipt, if you so wish, by doing a Purchase Invoice directly, but just make sure that you check the Update Stock Checkbox.
As @creamdory has detailed out, if you set up an item without checking the Maintain Stock Checkbox, the value of that item is directly expensed out.
You’d want to do this for your Category C items, that you don’t want to track stock issues for (like Cotton Waste, Printing Paper, etc.).
If you’ve made a mistake, but intended to check Maintain Stock checkbox but missed doing so, things become a bit convoluted now:
You have two options:
The Simpler (but not necessarily easier) Option:
Cancel all transactions starting from downstream transactions.
Change the Item to Maintain Stock
Redo your transactions
The more complicated option:
First check if ERPNext allows you to check Maintain Stock option for that item(s). Chances are it won’t. In which case, Duplicate Item and give it another Item Code. But remember to Check Maintain Stock this time around.
If you have completed all transactions for these items, the net effect of the transaction is that you paid $100 for an item and that has got expensed out. If you didn’t select a specific expense account in the item master or the transactions (Purchase Receipt, Purchase Invoice), it should have gotten expensed out to the default expense account. In effect your money (Balance Sheet) has moved to the expense account (P&L).
Use the general ledger to find out what account has been expensed out.
This assumes that you’ve enabled “Post an Accounting Entry for every Stock Transaction”.
Now pass a Journal Entry that reverses that account by that amount and use a Temporary Opening account for the balancing entry.
Now go to Stock>Stock Reconciliation (you can’t do this if you’ve enabled Serial Number or Batch Number on your Item, in which case use Stock Entry purpose Material Receipt) and set up a new Stock Reconciliation and inward the item at the value that you’d bought this for and use the same Temporary account for the balancing entry.
If the amounts in the Journal Entry and the Stock Reconciliation matches, the net effect of these two entries is that you have moved the value of your Inventory that you’d received from your supplier from the Expense account (P&L) to your Stock Account (Balance Sheet).
I’d recommend that you take the more complicated option, as the simpler option may not be available all the time. Plus it is natural for people to make mistakes and your diving into this will help you and your organization become more resilient form errors and mistakes.
Hope this helps.