total amount is now calculated automatically

added javascript to sales and purchase forms