Customer accrued balance in account

Suppose a customer has submitted Rs. 50,000 at first time while entering any contract, and after 1 month his bill is Rs. 10,000, so the Rs. 10,000 will debited from his account balance after making payment and remaining Rs. 40,000 will be his accrued balance.

This will be a good feature, lots of customer pay like this,

Duplicate of Retainer / Prepaid / Credit balance for Invoices