POS should not make sales invoice when (Stock Qty: 0)

hi ,
i wonder is it possible to stop POS from make sales invoice for (Stock Qty: 0) item ?
is it available in erpnext ? or should i do it manually with codes ??

I came to ask the same thing. Here are unique products (second hand ones), there are one and only one unit of each.

1 Like

and there is also somthing when you create POS profile and uncheck "update stock "
so POS employee will only create sales invoice …
and then stock man … will create a delivery note … and the Qty will be updated in the POS …this is the first scenario if you must have ( stock employee - pos employee )

other scenario create POS profile and check "update stock "
so POS employee will create sales invoice and it will update the stock dirictly, Qty will be updated right away in POS : that’s cool right ? …

my problem is in the first scenario … let’s take an example :
you have 15 iphone in your POS , you have one customer bought 12 iphone and make him a Sales invoice yet your Qty doesn’t updated ( still show in POS 15 iphone in the fact it should be 3 because your first customer bought 12 )
then another customer come and ask for 5 iphone to buy , your POS employee look at POS Qty , and saw it ( 15) but its in fact (3) since there is 12 iphone Sold but not delivered yet !!!
so your POS Employee make new sales invoice with 5 iphones … and in POS iphone Qty sitll 15 !!!

both of the two customer goes to Stock employee so he make to the first one Delivery note for 12 iphone … he have 3 left now
second customer come and ask for 5 iphones , and here is the issue … we don’t have 5 iphones , we only have 3 !!!

1 Like

A customers comes and purchases something, you aren’t not going to give them an invoice because you may have stock issues? POS is where the stock is physically there so you should allow for the stock to go to negative and adjust it later.

1 Like

i agree with you in big company or mall it might be , but we can’t adjust it , because product is limited in the stock .

For this process then you should use Sales Order process
SO - delivery - Invoice - Payment not POS.

i think im goint to write a code to write the item sold but not delivered yet , and pot it on POS image for item ,
and write a validate code to stop making sales invoice from POS if the number of item Stock Qyt= 0 or in my case "Stock Qty - sold but not devilvered ) <=0
i will share it here while testing it , might some one need it in future .

I have mentioned it in another thread but i think it is important in this conversation. In Spain (and I believe in other European countries are implementing this behaviour) a sales ticket is now a reduced invoice with the same particularities, and must be immutable, numbered sequentially and must reduce the stock if the product is collected/sended in the moment of payment (another case is dropshipping). If the customer changes opinion, even a second after issuing it, should generate a credit and increase stock. And all this movements must be related (invoices, credits, orders and stock movements).

As the companion says it is understood that in distribution and large markets can be updated stock every X time, but in physical store is not viable.

Note: The diffrerence between a reduced and a ‘standard’ invoice is that reduced is billed on default client account not in a named client account, but is the same document structure.

2 Likes

Hi @meigallodixital,

We have the same requirements in France (Major compliance requirement for France due to the POS module).

Actually a lot of issues regarding immutability and stock adjustments could maybe be handled by not authorizing to use the POS offline (could be an administrator switch maybe ?)

A lot of complexity is due to the offline functionality and currently the POS is not compliant with a few countries’ legislation.

There are some discussions on GitHub, don’t hesitate to participate :wink:

2 Likes

i did the first step …
if Stock Qty = 0 , you can’t put it in the ITEM CART

the added code start at line : 1161 ends 1163 in erpnext/accounts/page/pos/pos.js
if(JSON.stringify(me.actual_qty_dict[me.items[0].item_code] || 0) == 0){
frappe.throw("Stock Qty equal to zero ,please check item Qty in Stock ")
}

Next step , is when Qty in ITEM CART became more than the Stock Qty , show alert to the user …
final step , add field below Stock Qty called "Invoiced but not Delivered " and another field "Net Qty " will be the result of ( Stock Qty - Invoiced but not Delivered )
will not allow to add to item cart if (Net Qty = 0 ) or the ITEM CART qty > Net Qty .
i will share codes while development , so if any one want to use this case can use them .

Did the second step :
in erpnext/accounts/doctype/sales_invoice/pos.py
add at line 48 this filed
‘item_qty_not_delivered’:get_qty_not_deliverd()

and define the method like this :slight_smile:

the pos.py full code :

in /erpnext/accounts/page/pos/pos.js
at line 1019 add this line:
item_stock: __(‘Stock Qty’) + “: " + me.get_actual_qty(obj) +’)
(’+
__(‘Not updated Qty’) +”: "+me.get_invoiced_not_deliverd(obj)+’)
(’+
__(‘Net Qty’)+’: '+me.get_net_qty(obj),

and define the two functions get_invoiced_not_deliverd and get_net_qty :


the full code of pos.js:

Now should i check update stock in pos profile…?
i have stock for particular item but in pos it is showing quantity zero why?
and duplicate invoices getting created may i know why duplicate invoice is getting created.