Percentage based invoicing

Hi,
How would I handle percentage based invoicing? which is common here(uae). Invoices are created as such.

  1. 20% of total as advance - (create 20% of total value as invoice, outstanding would be shown as this 20%)
  2. 50% on material delivery - ( deliver all items , invoice remaining 50% )
  3. 30% final invoice - ( Invoice remaining amount, SO status changes to bill )

You can use Payment Entries to enter payments before the final Sales/Purchase Invoice.

https://frappe.github.io/erpnext/user/manual/en/accounts/payment-entry