update second display for qrpay
This commit is contained in:
@@ -289,5 +289,27 @@ App.checkin = App.cable.subscriptions.create("SecondDisplayViewChannel", {
|
||||
jQuery("#s_reload").click();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
if (status == "reload_and_update") {
|
||||
$(".second_display_items tbody").empty();
|
||||
console.log("data.data", data.data);
|
||||
var items = items.items
|
||||
for (var i in items) {
|
||||
$(".second_display_items tbody").append(
|
||||
`<tr>
|
||||
<td>${parseInt(i) + 1}</td>
|
||||
<td>${items[i].product_name}</td>
|
||||
<td>${parseInt(items[i].qty)}</td>
|
||||
<td>${items[i].price}</td>
|
||||
</tr>
|
||||
`,
|
||||
);
|
||||
}
|
||||
|
||||
$("#s_sub_total").text(data.data.subtotal);
|
||||
$("#s_tatal_tax").text(data.data.total_tax);
|
||||
$("#s_total_discount").text(data.data.total_discount);
|
||||
$("#s_grand_total").text(data.data.grand_total);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -465,6 +465,19 @@ var paymalcount = <%= @paymalcount %>;
|
||||
var customer_paypar_account = '<%= @sale_data.customer.paypar_account_no %>';
|
||||
// console.log(pdf_view)
|
||||
$(document).ready(function(){
|
||||
|
||||
$.post('/foodcourt/customer_view', {
|
||||
data: {
|
||||
items: <%= raw @sale_data.sale_items.to_json %>,
|
||||
subtotal: <%= number_with_precision(@sale_data.total_amount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i) %>,
|
||||
total_discount: <%= number_with_precision(@sale_data.total_discount, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %>,
|
||||
total_tax: <%= number_with_precision(@sale_data.total_tax, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %>,
|
||||
grand_total: <%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i) %>,
|
||||
},
|
||||
status: "reload_and_update"
|
||||
}, function(result) {}, 'json');
|
||||
|
||||
|
||||
$("#read_modal").modal('hide');
|
||||
/* replace url type*/
|
||||
if(!trans_flag){
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<td class="text-right item-attr"><strong id="s_total_discount"></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax Amount (5%):</strong></td>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="text-right item-attr"><strong id="s_tatal_tax"></strong></td>
|
||||
</tr>
|
||||
<tr class="table-active">
|
||||
|
||||
@@ -57,6 +57,9 @@
|
||||
.new-design-navbar .navbar-brand:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.new-design-navbar .navbar-brand img {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.new-design-navbar .navbar-brand .material-icons {
|
||||
margin-right: 8px;
|
||||
@@ -145,25 +148,60 @@
|
||||
font-feature-settings: 'liga';
|
||||
}
|
||||
|
||||
/* Responsive Styles */
|
||||
@media (max-width: 768px) {
|
||||
.new-design-navbar .navbar-center-section {
|
||||
/* display: none; */
|
||||
}
|
||||
|
||||
.new-design-navbar .navbar-right-section .connection-status-text,
|
||||
.new-design-navbar .navbar-right-section .user-name-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.new-design-navbar .navbar-right-section .nav-item {
|
||||
margin-left: 8px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.new-design-navbar .navbar-brand {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.new-design-navbar .bars-toggle {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.new-design-navbar .navbar-brand-text {
|
||||
display: none;
|
||||
}
|
||||
.new-design-navbar .navbar-brand img {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<%# Top Bar - New Design %>
|
||||
<% if !request.path_info.include?('second_display') %>
|
||||
<nav class="navbar new-design-navbar mb-1" style="position: sticky;">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-left-section">
|
||||
<div class="navbar-left-section d-flex justify-content-between">
|
||||
<% if current_login_employee.role != "waiter" %>
|
||||
<a href="javascript:void(0);" class="bars bars-toggle">
|
||||
<!-- <i class="material-icons">menu</i> -->
|
||||
</a>
|
||||
<% end %>
|
||||
<%# Brand Name and Icon %>
|
||||
<a class="navbar-brand" href="<%= root_path %>">
|
||||
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
|
||||
<span>SX Restaurant</span>
|
||||
<%# <span class="navbar-brand-text">SX Restaurant</span> %>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="navbar-center-section">
|
||||
<%= Shop.current_shop.name %>
|
||||
</div>
|
||||
<div class="navbar-right-section">
|
||||
<%# Connection Status %>
|
||||
<div class="nav-item" id="connection-status-item">
|
||||
@@ -175,7 +213,7 @@
|
||||
<div class="nav-item dropdown">
|
||||
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<i class="material-icons">person</i>
|
||||
<span><%= current_login_employee.name %></span>
|
||||
<span class="user-name-text"><%= current_login_employee.name %></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<% if current_login_employee.role == "administrator" %>
|
||||
|
||||
Reference in New Issue
Block a user