Created
August 10, 2012 04:37
-
-
Save wildanm/3311107 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("[name='sales_items[qty][]'],[name='sales_items[price][]'],[name='sales_items[discount][]']").unbind("keyup").bind("keyup", function(){ | |
var qty = $(this).parent().parent().find("[name='sales_items[qty][]']").autoNumericGet({aSep: '.', aDec: ',',aPad:true,vMax:100000000000000000}) ; | |
var price = $(this).parent().parent().find("[name='sales_items[price][]']").autoNumericGet({aSep: '.', aDec: ',',aPad:true,vMax:100000000000000000}) ; | |
var disc = $(this).parent().parent().find("[name='sales_items[discount][]']").autoNumericGet({aSep: '.', aDec: ',',aPad:true,vMax:100000000000000000}) ; | |
var total = qty*price | |
var minus = (disc/100)*total ; | |
total = total-minus ; | |
$(this).parent().parent().find("[name='sales_items[total][]']").autoNumericSet(total,{aSep: '.', aDec: ',',aPad:true,vMax:100000000000000000}); | |
}) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment