Partial payment for buying and selling

How can I maintain partial payments?

I have to buy a machine from a supplier where I gave payment 20% advance, 50% after receiving products and 30% after one month of received products. How Can I maintain this with accounts.

This is similar to the selling cycle. Customers buy products with 50% advanced payments, and pay other 50% after some period of time.

How can I maintain this with accounts entry.

You can create payment terms and payment term templates for the above requirement.
https://docs.erpnext.com/docs/v13/user/manual/en/accounts/payment-terms-template

This video might help
Proforma Invoice and Advance Payments