editing discount

This commit is contained in:
Yan
2017-06-08 15:40:59 +06:30
parent 5203a9f4a5
commit e0e512b76b
2 changed files with 13 additions and 7 deletions

View File

@@ -152,10 +152,16 @@ $(document).on('click', '.cashier_number', function(event){
}); });
function update_balance(){ function update_balance(){
var discount_type = $('#discount-type').val();
var discount_amount = $('#discount-amount').val(); var discount_amount = $('#discount-amount').val();
var sub_total = $('#order-sub-total').text(); var sub_total = $('#order-sub-total').text();
var tax = $('#order-Tax').text(); var tax = $('#order-Tax').text();
// For Percentage Discount
if(discount_type='1'){
discount-amount=(sub_total*discount-amount)/100;
}
var total = (parseFloat(sub_total) + parseFloat(tax)) - discount_amount; var total = (parseFloat(sub_total) + parseFloat(tax)) - discount_amount;
$('#order-discount').text(discount_amount); $('#order-discount').text(discount_amount);
$('#order-grand-total').text(total); $('#order-grand-total').text(total);

View File

@@ -90,7 +90,7 @@
<form class="form-horizontal"> <form class="form-horizontal">
<div class="form-group"> <div class="form-group">
<div class="col-md-3"> <div class="col-md-3">
<select name="discount_type" class="form-control"> <select name="discount_type" id="discount-type" class="form-control">
<option val=0 >Net</option> <option val=0 >Net</option>
<option val=1 >Percentage</option> <option val=1 >Percentage</option>
</select> </select>