editing discount
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user