quick service tax
This commit is contained in:
@@ -1097,16 +1097,28 @@ $(function() {
|
||||
var total_price = 0;
|
||||
var total_qty = 0;
|
||||
var taxable_amount = 0;
|
||||
var exclusive_total =0;
|
||||
var inclusive_total =0;
|
||||
var inclusive_tax =$('#inclusive_tax').val();
|
||||
var exclusive_tax =$('#exclusive_tax').val();
|
||||
var item_row = $('.summary-items tbody tr');
|
||||
|
||||
$(item_row).each(function(i){
|
||||
var unit_price = parseFloat($(item_row[i]).attr('data-price'));
|
||||
var qty = parseFloat($(item_row[i]).children('#item_qty').text());
|
||||
total_qty += qty;
|
||||
total_price += qty*unit_price;
|
||||
});
|
||||
if (inclusive_tax >0){
|
||||
inclusive_total = total_price / inclusive_tax;
|
||||
}
|
||||
if (exclusive_tax >0){
|
||||
exclusive_total = total_price * exclusive_tax;
|
||||
}
|
||||
total_price = total_price + exclusive_total + inclusive_total;
|
||||
var fixed_total_price = parseFloat(total_price).toFixed(2);
|
||||
var fixed_taxable_amount = parseFloat(taxable_amount).toFixed(2);
|
||||
$('#total_tax').empty();
|
||||
$('#total_tax').append(exclusive_total + inclusive_total);
|
||||
|
||||
$('#sub_total').empty();
|
||||
$('#sub_total').append(fixed_total_price);
|
||||
|
||||
Reference in New Issue
Block a user