Auto reordering negative quantities

Hello
just want to make sure of the following if erpnext has an inbuilt system to do it?

Scenario :
There is a Sales Order of 10 Qty

Steps:

  1. System will check Inventory
  2. Incase there are 4 Qty in Stock, system auto creates a PO for 6 Qty
  3. Bin will reflect projected Qty as -6
  4. Projected Qty = (Actual Qty - Ordered Qty)-Reserved Qty
    i.e Projected Qty = (In Stock Qty - POs in draft) - Sales Order Qty
  5. Projected Qty turns 0 when PO is Submitted

Case 1: PO is Stopped
· Projected Qty will be -6
· Eg: If there was a PR of Qty 2 against 6 Qtys, then Projected Qty will be -4
· Now, system shall auto create a PO against this negative projected Qty i.e. 4 Qty

Case 2: PO is Cancelled
· Projected Qty will be -6
· System will auto create a PO for this projected qty i.e. 6 Qty

Case 3: PO is deleted
· Can system create a new PO against the deleted POs? Assuming that when we choose a delete option, it means that we dont want any purchases for that item.
· Projected Qty in this case will remain -6. We will have to manually create a PO for this 6 Qty.
· Now, if there is a new SO (Qty 10) for the same item. It will show a projected Qty as -16 and system will auto create a PO for 16 Qty.

Please suggest if this flow is possible using any inbuilt erpnext functionality.

Thanks

Under item list, you can set reorder level and automatically create ‘Material Request’ if the qty hit reorder level…