var store = Ext.StoreMgr.lookup("storePTRSALESITEMS"); var idx = store.getCount() - 1; var discountPercentage = val.value; var priceAmount = store.getAt(idx).get('PriceAmount'); var quantityTransaction = store.getAt(idx).get('QuantityTransaction'); var discount = priceAmount * quantityTransaction * discountPercentage / 100; store.getAt(idx).set('Discount', discount); var netAmount = (quantityTransaction * priceAmount) - discount; if (store.getAt(idx).get('TaxType') == '1') { var totAmount = netAmount; store.getAt(idx).set('TotAmount', totAmount); } store.getAt(idx).set('NetAmount', netAmount); var store = Ext.StoreMgr.lookup("storePTRSALESITEMS"); var idx = store.getCount() - 1; var priceAmount = val.value; var discountPercentage = store.getAt(idx).get('DiscountPercentage'); var quantityTransaction = store.getAt(idx).get('QuantityTransaction'); var discount = priceAmount * quantityTransaction * discountPercentage / 100; var netAmount = (quantityTransaction * priceAmount) - discount; if (store.getAt(idx).get('TaxType') == '1') { var totAmount = netAmount; store.getAt(idx).set('TotAmount', totAmount); } store.getAt(idx).set('Discount', discount); store.getAt(idx).set('NetAmount', netAmount); var store = Ext.StoreMgr.lookup("storePTRSALESITEMS"); var idx = store.getCount() - 1; var quantityTransaction = val.value; var priceAmount = store.getAt(idx).get('PriceAmount'); var discountPercentage = store.getAt(idx).get('DiscountPercentage'); var discount = priceAmount * quantityTransaction * discountPercentage / 100; var netAmount = (quantityTransaction * priceAmount) - discount; if (store.getAt(idx).get('TaxType') == '1') { var totAmount = netAmount; store.getAt(idx).set('TotAmount', totAmount); } store.getAt(idx).set('Discount', discount); store.getAt(idx).set('NetAmount', netAmount);