Sales invoice for customer prevous balance

i want to add customer previous balance in ths sale invoice and then total balance can someone give me the html codes for this

There was a code posted by someone for that. But those features are obsolete as extensions and custom themes were needed for that. Btw your other options are a Custom field in which you can enter the previous balance manually or provide statement with invoice.