ERPNext Conference 2019* Blog

Is it possible to block the creation of a sales invoice if customer has an overdue invoice? If so, how?


I’ve been trying to deal with my customers that hasn’t paid their invoices. usually I block the creationg of invoices to those customers. The problem I have es that I dont make the invoices and I have another person that does it. If she forget about that “blockage”, the client is invoiced and the products get delivered without me wanting that.
So, can I block the creation of a sales invoice if customer has an overdue invoice? If so, how?
Hope someone can help me.


You may check the status of the client in the Validate event.


You can use credit limit feature for this…


Where can i check that?


I thought about it but I need to do it manually. In the credit limit section there’s nothing like what I need


You can ‘Disable’ the customer.

No user can create a new invoice against a disabled customer.


Would that limit my ability to create sales order? I only need to limit the ability to block the creation of sales invoices


Yes, disabling a customer in the customer record would also prevent you from creating sales orders.



Then credit limit would be the way to go. Under that, once the limit is crossed, you are blocked against creating an Order or invoice. When you check the Bypass option, it allows user to create Sales Order:

Until the credit limit is cleared or increased, you cannot create an invoice for that customer.


The credit limit .AND. the overdue condition is what is necessary here. Like a client may have a $2000 credit limit. But an invoice for $500 that’s not paid on time should put the client on hold. I think this is something that many organizations would want. Maybe a bit of scripting that reduces the credit limit to 0 as long as there is an overdue invoice should do the trick.

Hope this helps