update total tax when other charges
This commit is contained in:
@@ -45,7 +45,8 @@ class Origami::OtherChargesController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Re-calc All Amount in Sale
|
# Re-calc All Amount in Sale
|
||||||
sale.compute_by_sale_items(sale_id, sale.sale_items, sale.total_discount)
|
# sale.compute_by_sale_items(sale_id, sale.sale_items, sale.total_discount)
|
||||||
|
sale.compute_without_void
|
||||||
end
|
end
|
||||||
|
|
||||||
dining = {:table_id => table_id, :table_type => table_type }
|
dining = {:table_id => table_id, :table_type => table_type }
|
||||||
|
|||||||
@@ -232,7 +232,6 @@ class Sale < ApplicationRecord
|
|||||||
end
|
end
|
||||||
#compute rounding adjustment
|
#compute rounding adjustment
|
||||||
# adjust_rounding
|
# adjust_rounding
|
||||||
|
|
||||||
sale.save!
|
sale.save!
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -294,6 +294,7 @@
|
|||||||
<button type="button" id="customer" class="btn btn-primary btn-block" disabled>Customer</button>
|
<button type="button" id="customer" class="btn btn-primary btn-block" disabled>Customer</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
||||||
|
<button type="button" id="other-charges" class="btn btn-primary btn-block" disabled>Charges</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||||
<button type="button" id="first_bill" class="btn btn-primary btn-block" disabled>First Bill</button>
|
<button type="button" id="first_bill" class="btn btn-primary btn-block" disabled>First Bill</button>
|
||||||
@@ -304,6 +305,7 @@
|
|||||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
||||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||||
|
<button type="button" id="other-charges" class="btn btn-primary btn-block" >Charges</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||||
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
|
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
|
||||||
@@ -429,6 +431,25 @@ $(document).ready(function(){
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add Other Charges
|
||||||
|
$('#other-charges').click(function() {
|
||||||
|
var sale = $('#sale_id').val();
|
||||||
|
if (sale!="") {
|
||||||
|
var sale_id = sale
|
||||||
|
}else{
|
||||||
|
var sale_id = $('#save_order_id').attr('data-order');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sale_id!=""){
|
||||||
|
window.location.href = '/origami/' + sale_id + '/other_charges'
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert("Please select an table!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Print for first bill
|
// Print for first bill
|
||||||
|
|||||||
Reference in New Issue
Block a user