- no tax after edit, discount, other charges
- redirect after discount, edit and other changes
This commit is contained in:
DevTeam
2025-07-04 16:34:00 +06:30
parent f003900fee
commit 04e03896b9
5 changed files with 45 additions and 79 deletions

View File

@@ -32,7 +32,7 @@
<% sub_total = 0 %>
<% @sale_data.sale_items.each do |sale_item| %>
<%
sub_total += sale_item.qty*sale_item.unit_price
sub_total += sale_item.status == "Discount" ? sale_item.price : sale_item.qty*sale_item.unit_price
unless sale_item.price == 0
%>
<tr class="item-row" id=<%= sale_item.sale_item_id %> >
@@ -200,7 +200,7 @@
<%if !@table.nil?%>
<button type="button" class="btn btn-block btn-default waves-effect" onclick="window.location.href='/foodcourt/<%=@table.type.downcase%>/<%=@table.id%>'" id="back"><i class="material-icons">reply</i> Back</button>
<%else%>
<button type="button" class="btn btn-block btn-default waves-effect" onclick="window.location.href='/foodcourt/sale/<%=@sale_data.sale_id%>/<%=@cashier_type%>/payment'" id="back"><i class="material-icons">reply</i> Back</button>
<button type="button" class="btn btn-block btn-default waves-effect" id="back"><i class="material-icons">reply</i> Back</button>
<%end%>
<button type="button" class="btn btn-block btn-default waves-effect" id='refresh'>Refresh</button>
<hr>
@@ -210,6 +210,7 @@
</div>
</div>
<script type="text/javascript">
var queryParams = new URLSearchParams(window.location.search);
function otherCharges(val){
var aa = parseInt(val);
@@ -273,6 +274,10 @@
}
});
$('#back').on('click', function() {
window.location.href = '/foodcourt/<%= @sale_data.sale_id %>/qrpay/precreate';
});
// Remove selected discount items
$("#remove-item").on('click', function(e){
e.preventDefault();
@@ -336,19 +341,11 @@
text: "Success",
type:"success"
}, function () {
if (cashier_type=="quick_service" || cashier_type=="food_court") {
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
} else if (cashier_type == "food_court_qr") {
window.location.href = '/foodcourt/'+sale_id+'/qrpay/precreate';
if (cashier_type=="food_court" && queryParams.get('payment_type') == 'qr') {
window.location.href = '/foodcourt/'+sale_id+'/'+'qrpay/precreate';
} else if(cashier_type == "food_court") {
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}
else{
if(result.table_type == "Table"){
window.location.href = "/foodcourt/table/" + result.table_id
}
else {
window.location.href = "/foodcourt/room/" + result.table_id
}
}s
});
}
});