Why would Purchase Invoice have Cost of Goods Accounting Entry?

Having critical issue. Just notice bunch of Purchase Invoice have Cost of Goods accounting entries.

Checked ITEM and ITEM Group default expense accounts. They are set to COGS but a different gl account than the ones with the entries. Please see screen shot:

Critical now as using this to report Financials for my girlfriends canteen and I can’t trust the numbers. Please help!!


Please purchase invoice you have ticked update stock check

Yes, Update Stock is checked.

We skipped purchase order and purchase receipt and just use purchase invoice to shorten the process since it’s a very small operation. Is this an issue?

Its booking stock accounts since you have checked update stock on purchase invoice.It will book same as Purchase receipt only nice thing is here you don’t have to create two different document.If you don’t want stock accounts to be booked cancel particular purchase invoice unchecked it and submit it again

Hmmm, not getting this. FYI there are other purchase invoice with no Cost of Goods entries.

ANyway, we do want stocks updated because we are keeping track of inventory. This part is ok. The part that is confusing me is why on earth will it book to Cost of Goods Sold and for what purpose? Purchase Invoice entries should only be for Supplier and Purchases, AP and Inventory, right? Did I miss something?

Can someone please clarify this?? Seems a valid point.

It is Perpetual inventory concept.
Please read below documentation of erpnext related to perpetual inventory the concept is well explained here comparing with erpnext flow:

1 Like

Pls check item master, there would be some service item (inventory maintenance not tickets) and that’s item not linked to warehouse also,
there in erpnext company pick default purchase account from company setting which mostly was Cost of gold account.

IMO erpnext should given expense/inventory account option in item table for integration ( which we are customization right now)

I have linked the item master with the warehouse under purchase details.
Where can I find the default purchase account for company? There’s no option under the Company Doctype.

Also I have some queries pls:

The basic amount of the items and the purchase taxes and costs is as so:

However a portion of the stocks value seems to go to the COGS account as shown. How is this portion calculated? And why is it taken away from stocks in hand account?

Also the purchase costs are under the account heads that consider tax only for the total and not valuation but it seems to included in valuation in the stock ledger. Spoils the whole profit calculation.

I feel the above are valid issues and not able to figure it out. Kindly help me out here.

1 Like

Seeing similar issues but with Purchase Receipt (before Invoice) creating Cost of Goods Sold accounting entries, which doesn’t make sense.

Do you guys ever figured out why its creating Cost of Goods Sold entries? I still have the same issue but with Purchase Receipts.

Looks like the value is the difference of the current valuation rate and the difference of the rate when it comes in. Not sure why it is booking it in the Cost of Goods Sold account though.

My understanding is that the system presumes that the items would have been sold or moved out. The difference does need to be an expense, but I suppose not always COGS. Don’t see a straightforward way to change this account though.

Are you selling the items in negative stock?

1 Like

If you ensure that the Items are setup correctly and if you have Perpetual Inventory turned on and the Stock Account correctly setup a Purchase Invoice should not hit the Cost Of Goods Sold. Rather you can control the settings so that it does not hit the COGS account. Conversely, if it is hitting the COGS, something has not been setup/configured right.

Just thought I’d put it out there because an ERP has many moving parts and getting it right is a bit of a work. And that ERPNext does all of these extremely well. Extremely rarely there could be a problem with ERPNext, but most times its an issue with setup/configuration.

It’s a journey for people that adopt any system. Till the time they have confidence that the system works, they suspect that the system is at fault. But once one understands that ERPNext works correctly and predictably, one starts looking at the transactions and the setup/configuration of Items, Accounts, etc. and typically are able to solve the problem.

Hope this helps.



@Dan_Navarro should be the case, as we see COGS getting hit when the warehouse location for an item sold was at a negative stock balance, as @Saumyaseelan_Pv is alluding to

So system is passing an entry to adjust the costing. May be there is a difference in the old valuation rate and the new purchase price.