currently when creating payment entry (advance payment, down payment) from purchase order and sales order, the paid amount is the full order amount, the party account is normal accounts payable/accounts receivable account( normally for invoice based payment).
- add field default advance payable account to company, party account doctype,
- add field default advance receivable account to company, party account doctype,
- add field Is Advance to payment term and payment schedule doctype
- change new payment entry creation logic: when create from purchase / sales order and advance amount is 0 and first payment schedule is Is Advance, set default advance payable/receivable account to party account, set paid amount as per first payment schedule amount
- remove the restriction on payable/receivable account for payment reconciliation in invoice