Perpetual Inventory -vs.- POS They cannot coexist

Okay, I recently stumbled over my system being set for perpetual inventory and it was really slowing everything down. I unchecked the setting and then started researching exactly what “Perpetual Inventory” was and how it is implemented in accounting systems.

This is where I ran into a “disconnect” of sorts.

The accounting term “perpetual Inventory” is a practice that immediately records sales and purchasing transactions as they occur in order to allow for better inventory tracking and (supposedly) reduce the need for frequent physical stock counts.

How exactly does that mesh with the current practice of forcing POS to only register sales at the end of a shift when the POS user closes out?!?

These two functions cannot possibly coexist in their current implementation!

In order for this to work properly there needs to be an option to make POS log all stock and ledger transactions “as they occur” instead of this weird mix of conflicting accounting practices.

Is there a way to make the native POS module go back to making accounting and stock ledger entries as they occur? This is really the only way to implement perpetual inventory. Otherwise we need to eliminate the farce of perpetual inventory as a valid accounting practice in ERPNext.

Does anyone else have a better idea of how to make all this mesh properly aside from using the POS Awesome app? I would really rathyer keep everything in the native core of frappe and erpnext but this accounting mismatch has me stumped.

Am I missing something here or is there a way to make this work properly?

BKM

While I am not a fan of the PoS invoice concept in the inbuilt POS , it does not violate the concept of perpetual Inventory.

It simply delays by a few hours the actual posting of the COGS and Sales Figures to the GL. But once the posting is done perpetual inventory concept is obeyed.

Regards

@olamide_shodunke If I have only 1 unit of an item in Stock, does the POS prevent me to sell for more than 1 customer, while it doesn’t update the stock?

Sorry, I didnt know, the POS, but I’m interested on the issue!

Stock update by the inbuilt POS is not immediate .

So yes it is possible to sell more than what is in stock .

It is a serious issue

@olamide_shodunke, so, it means POS is in conflict with perpetual inventory!

No .

To make it clearer to you try and understand the meaning of the alternatve/opposite of perpertual inventory.

The alternative to perpertual inventory is Periodic Inventory

What is a Periodic Inventory System?

A periodic inventory system only updates the ending inventory balance in the general ledger when a physical inventory count is conducted. Since physical inventory counts are time-consuming, few companies do them more than once a quarter or year. In the meantime, the inventory account in the accounting system continues to show the cost of the inventory that was recorded as of the last physical inventory count.

Under the periodic inventory system, all purchases made between physical inventory counts are recorded in a purchases account. When a physical inventory count is done, the balance in the purchases account is then shifted into the inventory account, which in turn is adjusted to match the cost of the ending inventory.

The calculation of the cost of goods sold under the periodic inventory system is:

Beginning inventory + Purchases = Cost of goods available for sale

Cost of goods available for sale – Ending inventory = Cost of goods sold

I hope you now understand why I say it really does not violate perpertual inventory ?

2 Likes

But the purpose of Perpetual Inventory is not for keep stocks amounts 100% in sync with accounting?

So, let’s go back to the original case 1 unit only available in stock.

This item is valuated at 100 USD

Let’s supose on the noon I have selled the item
But some reason, on 14pm the Stock Manager catch an small issue and decide to add some additional charges to properly adjust the item valuation rate, so him runs the Landed Cost Voucher and adjust the valuation rate of the item to 120 USD.

When the POS sync to inventory, it will leave the stocks by:

  • 100 USD valuation rate?
  • 120 USD valuation rate?

In any of the 2 cases there’s a system contradiction, due the timing of the operations.

If it leaves the stock by 100, it means I’ll stay with 0 Items in stock with 20 USD in the stock account associated with this item, that I never will be able to correct!

If it leaves the stock by 120, it means that future transactions can affect the past, what break the accounting purpose!

If multiple POS terminals in the same store can sell the same item more times than it actually exists in inventory, then YES this is a violation of the perpetual inventory accounting method.

The same is true for multiple POS terminals in different locations that sell the same item from a remote warehouse more times than it exists in that warehouse.

Both cases are examples of violating the perpetual inventory concept.

This is very dangerous for example in a group of furniture stores that are only showrooms and must sell inventory from the same remote warehouse. A very common structure in most cities where I do business.

In fact it was a furniture store owner that pointed out this flaw to me when I was trying to do a demo and asked “How can this possibly be perpetual inventory?!?”

BKM

Really, @olamide_shodunke? Does the POS Module not track the quantities and ensure that you cannot sell more than the quantities available?

But to be fair, I think it is extremely difficult to track stocks on ERPNext in a retail environment and you hate to encounter a situation where you have a customer with your product in one hand and money in the other and your counter sales guys say, sorry, can’t sell you that as I cannot see it in stock. But I go off on a tangent! All I wanted to say was that most Retail Implementations will have negative stock turned on or will not stop invoicing an item that’s “Not there in stock” on the ERP. Does POS Awesome do actual invoicing and flushing out stock and the time of closing the shift? Or does it do on a live basis?

@bkm: Pepetual inventory means that every stock transaction has a corresponding accounting transaction. So, when you make a Purchase Receipt, Current Assets Stock Assets go up and “Received but not Invoiced” account is charged on the other side.

And when you make a Delivery Note, Current Assets Stock Assets go down by the valuation amount and that gets booked as an expense (typically COGS).

Just entering this conversation. Hopefully not too randomly. :slight_smile:

Thanks

Jay

I guess it will book $120 as the COGS. Because it will book the valuation at the time the stock is flushed out.

I didn’t quite get that.

Thanks

Jay

Everytime you use landed cost voucher, the system will re calculate cost of goods as well as cost of goods sold if the item has been sold.

I do not understand the validity of this example to the discussion we are having

Hi @JayRam

The issue @bkm is highlighting is a peculiar issue with the inbuilt PoS where all transactions do not impact inventory and the GLs until the cashier shift is closed. This concept was introduced in version 12 and has the effect of not updating stock immediately the sales transaction is sold.

This concept annoys me Lol.

PoS Awesome updates stock on a live basis the same way the inbuilt PoS used to do before Version12

And I agree with you, in all my retail establishments negative stock is turned on.

Regards

@JayRam

I have selled the item with the valuation of 100 on 12:00, but since it doesn’t leave the stocks it allow someone to change it’s valuation on 14:00, to 120, so, when it leaves the stocks, by one transaction made on 12:00, it’s leaving by the updated valuation rate!

First, no one should be able to change the valuation of an item, if it’s already selled, but since the POS doesn’t make the stock transaction in realtime, you can do that!

Second, if at the end of the day, it leaves by 120, how can it is possible, since I have a voucher showing that it have been selled, before the valuation take in place!

The point, is, with the actual flow, of the POS, there’s lot’s of flows into the Stocks and Accounting!

What I’m writing here, is another possibility introduced by this bad behavior!

Does this happen with the POS set to offline? or both offline and online?

Both. ~BKM

I have worked intensely on Inventory and Costing with several commercial ERPs. And have worked lightly with a dozen others. ERPNext is the only system I’ve seen with such a crazy interpretation (and implementation) of “Perpetual Inventory”.

Here’s how I’ve seen it everywhere else:

  1. When you configure your ERP, you create 1 (or more) balance sheet accounts in the General Ledger. These represent the total cost value of your inventory.
  2. Whenever inventory is added to your company (Purchase Order, output of Manufacturing, RMA), then inventory is debited immediately in the GL accounts.
  3. Whenever inventory is removed from your company (Sales Order, material consumption, PO return), then inventory is credited in the GL accounts.
  4. As needed, quantity and value adjustments are made. Some happen automatically (late-arriving freight charges on a PO). Others manually (cycle counts, corrections). Either way, the GL is posted to immediately
  5. Periodically , the finance department runs reports. To compare the value of the inventory according to the inventory sub-system, versus what is in the General Ledger accounts.
    • If everything is configured properly, and no one has made manual Journal Entries, everything should tie out.
    • Otherwise, if there are discrepancies, Finance reconciles and adjusts.

What ERPNext is doing is trying to -automate- Step #5. Whenever anything happens to physical inventory, it immediately runs a ton of calculations. Trying to confirm that the amounts in the General Ledger (per account, per warehouse, by date), precisely match the inventory sub-ledger. And if the comparison fails? It fails to post.

This is fundamentally wrong (in my opinion) for the following 2 reasons:

1. It prevents companies from conducting business.

Assume I have a customer trying to make a purchase. ERPNext attempts to post the invoice. However, it cannot. It throws an error, because it believes the GL and inventory balances are out-of-sync.

Do I tell my customer: “I am sorry, you cannot make this purchase, my computer says there is a math error in my ledger. I’ll ask Accounting to fix. Please come back tomorrow.” ?

That conversation obviously cannot happen.

2. The functions being called introduce a devastating performance hit:
../apps/erpnext/erpnext/accounts/utils.py


def check_if_stock_and_account_balance_synced(posting_date, company, voucher_type=None, voucher_no=None):
	if not cint(erpnext.is_perpetual_inventory_enabled(company)):
		return

	accounts = get_stock_accounts(company, voucher_type, voucher_no)
	stock_adjustment_account = frappe.db.get_value("Company", company, "stock_adjustment_account")

	for account in accounts:
		account_bal, stock_bal, warehouse_list = get_stock_and_account_balance(account,
			posting_date, company)

		if abs(account_bal - stock_bal) > 0.1:
			precision = get_field_precision(frappe.get_meta("GL Entry").get_field("debit"),
				currency=frappe.get_cached_value('Company',  company,  "default_currency"))

			diff = flt(stock_bal - account_bal, precision)

			error_reason = _("Stock Value ({0}) and Account Balance ({1}) are out of sync for account {2} and it's linked warehouses as on {3}.").format(
				stock_bal, account_bal, frappe.bold(account), posting_date)
			error_resolution = _("Please create an adjustment Journal Entry for amount {0} on {1}")\
				.format(frappe.bold(diff), frappe.bold(posting_date))

			frappe.msgprint(
				msg="""{0}<br></br>{1}<br></br>""".format(error_reason, error_resolution),
				raise_exception=StockValueAndAccountBalanceOutOfSync,
				title=_('Values Out Of Sync'),
				primary_action={
					'label': _('Make Journal Entry'),
					'client_action': 'erpnext.route_to_adjustment_jv',
					'args': get_journal_entry(account, stock_adjustment_account, diff)
				})

A process that normally takes a few seconds (posting an invoice), can now take minutes in an ERPNext with a lot of history.

Equally unacceptable.

For my own clients, I’m going to have to tear apart the Perpetual Inventory code, and disable the “real-time reconcilation” components. Otherwise v13 is entirely unusable for us.

9 Likes

can you create an issue and see what other community members and the core team react?

1 Like

It has always seemed odd to me that the stock ledger tracks both quantity and value together. This was the root cause of all the debate over ledger immutability, too.

Thank you so much Brian Pond. This is the clearest explanation of what I had been trying to say about inventory, especially because of the totally unnecessary and destructive (in my opinion) Immutable Ledger thing.

Costing of inventory is a weak point. There is no differentiation between a transaction (which needs to get through as quickly as possible) and posting to ledger (which is a periodic requirement). The way ERPNext almost obsessively focuses on getting the cost of goods calculated immediately alongside Transaction Data Entry is for me not a good thing.

Correct. But not necessary, and not done in most real world implementations.