Disable PO creation when customer fails to pay in time

I am looking for under mentioned features. Is it possible to achieve these in ERPNext out f the box or with minor modifications or does it need a vast customization ?

  1. Create payment milestones for different customers. These milestones could be monthly payment, or payment after completion of certain tasks (task milestone).

  2. Allow some grace period to customer to pay.

  3. Under failure to pay, the system should automatically disallow creation of PO against the projects/sales order associated with the customer/project.

  4. A system manager or project manager should have an option to override the 3rd step with some limitations.

Are there any ways to achieve these or some of these results in ERPNext v13 or v14 ?

I am using v13 on a self hosted server.

If you go to Customers, you can set credit limit. Once this is set (and I believe there is an option to stop or warn users, you can select stop.) So say you have a oneoff customer (single project customer) you can set a really low credit limit, forcing the customer to pay before being issued the next Sales Order.

Once this is done, you can’t submit your Sales Order and thus the by extension the PO.
Regarding PO associated with projects, that’s a bit more tricky, but doable with light customization. You can run a check before submitting the PO, to see if the customer linked to the associated project is over his/her limit. If so, you can exit the submit function.

oh, and also… there is an option in Sales Setting that allows certain user roles to bypass the credit check.