second display

This commit is contained in:
NyanLinHtut
2019-06-20 15:07:18 +06:30
parent a0506f5a4e
commit 7de795ee27
12 changed files with 534 additions and 476 deletions

View File

@@ -139,7 +139,16 @@
<span class="font-15 shopinfo" >Team Viewer</span>
</p>
</li>
<%if current_login_employee.role =="cashier" %>
<li>
<p class="waves-effect waves-block p-l-30 m-b-5">
<a href="/origami/second_display" onclick="window.open('/origami/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
<i class="material-icons font-7 logout_icon shopinfo">info</i>
<span class="font-15 shopinfo" >Second Display</span>
</a>
</p>
</li>
<% end %>
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
<i class="material-icons font-10 logout_icon">exit_to_app</i>
<span class="font-18">Logout</span>

View File

@@ -1,5 +1,5 @@
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
<% type = request.path_info.include?('quick_service') || request.path_info.include?('food_court')%>
@@ -14,7 +14,7 @@
<input type="hidden" name="link_type" id="link_type" value="<%= @cashier_type %>">
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
<div class="row m-t--20">
<div class="col-lg-2 col-md-2 col-sm-2 hidden" id="menu_data">
<div class="col-lg-2 col-md-2 col-sm-2 hidden" id="menu_data">
<li class="list-menu">
<a href="javascript:void(0);" class="menu-toggle dropdown-toggle toggled my-toggle " style="">
@@ -31,7 +31,7 @@
</li>
<%end%>
</ul>
</li>
</li>
<div id="menu1-slimscroll" data-height="0">
<ul class="nav nav-tabs flex-column category_list" role="tablist" id="ul-navbar">
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
@@ -44,7 +44,7 @@
<% if type %>
<% if !menu.code.include? "SPL" %>
<li class="nav-item">
<p class="hidden menu-id"><%= menu.id %></p>
<p class="hidden menu-id"><%= menu.id %></p>
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
</a>
<ul class="sub_category_list hidden fadeInTop animated" id="sub_category_list">
@@ -56,7 +56,7 @@
<% if @table.get_current_checkout_booking.nil? %>
<% if !menu.code.include? "SPL" %>
<li class="nav-item ">
<p class="hidden menu-id"><%= menu.id %></p>
<p class="hidden menu-id"><%= menu.id %></p>
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
</a>
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
@@ -65,7 +65,7 @@
<% end%>
<% else %>
<li class="nav-item ">
<p class="hidden menu-id"><%= menu.id %></p>
<p class="hidden menu-id"><%= menu.id %></p>
<a class="nav-link menu_category sub_click first_<%=menu.id%>" data-toggle="tab" href="" role="tab" data-id="<%=menu.id%>" data-sub-id="<%=menu.get_sub_category%>"> <%= menu.name%>
</a>
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
@@ -89,7 +89,7 @@
</a>
<ul class="ml-menu menu_list aria-hidden menu_cache_list" style="border-top: 1px solid #fff">
</ul>
</li>
</li>
<div id="menu-slimscroll" data-height="0">
<ul class="nav nav-tabs flex-column category_list category_cache_list" role="tablist" id="ul-navbar">
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
@@ -210,7 +210,7 @@
<div class="col-md-1 col-lg-1 col-sm-1">
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
</button>
</div>
</div>
<% else%>
<p class="hidden" id="table_type"></p>
<div class="col-md-2 col-lg-2 col-sm-2">
@@ -219,7 +219,7 @@
<div class="col-md-3 col-lg-3 col-sm-3">
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
</button>
</div>
</div>
<% end%>
</div>
<% else %>
@@ -263,7 +263,7 @@
<tr>
<td colspan="2" style="padding:2px; text-align:" class="charges-name" width="25%"><strong>Total:</strong></td>
<td style="padding:2px;" width="15%"><strong id="total_qty">0</strong></td>
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total">0.00</strong></td>
</tr>
</table>
@@ -274,7 +274,7 @@
<%elsif !modify_order && type%>
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
<% if current_user.role != "waiter"%>
<% if @quick_service_only %>
<button type="button" class="btn btn-primary action-btn create col-md-12" id="create_pay_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
<% else %>
@@ -393,8 +393,8 @@
<p class="hidden" id="item_instances"></p>
<p class="hidden" id="item_code"></p>
</div>
<div class="col-md-7 item-detail">
<h5>Attributes</h5>
<div class="col-md-7 item-detail">
<h5>Attributes</h5>
<div class="attributes-list">
</div>
<hr>
@@ -472,8 +472,8 @@
</div>
</div>
<div class="col-md-8">
<div class="col-md-8">
<div class="instance-list row"></div>
</div>
</div>
@@ -511,14 +511,14 @@
<% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<% color="red"%>
<% else %>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
<% else %>
<% else %>
<% if table.get_checkout_booking.nil? %>
<% color="blue"%>
<% else %>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
@@ -537,13 +537,13 @@
<% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<% color="red"%>
<% else %>
<% else %>
<% color="orange"%>
<% end %>
<% else %>
<% end %>
<% else %>
<% if table.get_checkout_booking.nil? %>
<% color="blue"%>
<% else %>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
@@ -595,11 +595,11 @@
menu_cache_append(menus);
}else{
$("#menu_data").removeClass("hidden");
}
}
function menu_cache_append(menus){
$("#menu_cache").removeClass("hidden");
$(".menu_cache_name").text(menus[0]["name"])
$(".menu_cache_name").text(menus[0]["name"])
for(var i in menus) {
menu_list_template(menus[i]);
}
@@ -608,11 +608,11 @@
for(var ii in category) {
if (category[ii]["is_available"]== true){
if (category[ii]["valid_time"]== true){
if (category[ii]["parent_id"] == null ){
if (category[ii]["parent_id"] == null ){
if(cashier_type){
if (category[ii]["code"].includes("SPL") != true) {
category_list_template(category[ii]);
}
}
}else{
if ($("#table_get_current").text()) {
if (category[ii]["code"].includes("SPL") != true) {
@@ -625,7 +625,7 @@
}
}
}
}
}
}
$(".tables").on('click', function () {
@@ -659,13 +659,13 @@
var name = $(this).attr("data-name");
var menus = JSON.parse(localStorage.getItem("menus"));
if (menus != null) {
if (menus != null) {
menu_click_cache_append(name,menus,menu_id);
}else{
var url = "get_menu/"+menu_id;
show_menu_cat_list(name, url);
show_menu_cat_list(name, url);
}
});
});
//End menu category Click
function menu_click_cache_append(name,menus,menu_id) {
@@ -682,22 +682,22 @@
// +'</li>';
// $(".category_cache_list").append(row);
for(var i in menus) {
for(var i in menus) {
if (menu_id == menus[i]["id"] && menus[i]["is_active"] == true) {
// menu_list_template(menus[i]);
var category = menus[i]["categories"];
for(var ii in category) {
if (category[ii]["is_available"]== true){
for(var ii in category) {
if (category[ii]["is_available"]== true){
if (category[ii]["valid_time"]== true){
if (category[ii]["parent_id"] == null ){
if(cashier_type){
if (category[ii]["parent_id"] == null ){
if(cashier_type){
if (category[ii]["code"].includes("SPL") != true) {
category_list_template(category[ii]);
}
}else{
}
}else{
if ($("#table_get_current").text()) {
if (category[ii]["code"].includes("SPL") != true) {
category_list_template(category[ii]);
@@ -709,7 +709,7 @@
}
}
}
}
}
}
}
}
@@ -726,7 +726,7 @@
+'</ul>'
+' </li>';
$(".category_cache_list").append(row);
$(".category_cache_list").append(row);
}
function menu_list_template(menu) {
@@ -735,11 +735,11 @@
+' <a class="nav-link" data-toggle="tab" href="" role="tab"'
+' style="text-transform: lowercase;">'+menu.name+'</a>'
+'</li>';
$(".menu_cache_list").append(row);
}
$(".menu_cache_list").append(row);
}
//show menu item list when click menu category
function show_menu_cat_list(name, url_item){
function show_menu_cat_list(name, url_item){
var menu_list = $('.menu_items_list');
menu_list.empty();
@@ -759,13 +759,13 @@
url_item = url_item;
}
//Start Ajax
$.ajax({
type: "GET",
url: url_item,
$.ajax({
type: "GET",
url: url_item,
data: {},
dataType: "json",
success: function(data) {
for(var i in data) {
for(var i in data) {
if (data[i].is_available == true) {
row = '<div class="card custom-card testimonial-card animated fadeInRight menu_category sub_click" data-id="'+ data[i].id +'">'
+' <div class="card-block custom-card-block">'
@@ -778,7 +778,7 @@
list = '<li class="nav-item menu_category sub_click" data-id="'+ data[i].id +'">'
+'<p class="hidden menu-id">'+ data[i].id +'</p> '
+'<a class="nav-link" data-toggle="tab" href="" role="tab"> '+ data[i].name +''
+'<ul class=" sub_category_list hidden fadeInTop animated"'
+'<ul class=" sub_category_list hidden fadeInTop animated"'
+'id="sub_category_list">'
+'</ul>'
+'</a>'
@@ -788,15 +788,28 @@
}
}
});
//end Ajax
//end Ajax
}
//end show list function
$(document).on('click', '#clear_all', function(event){
$(".summary-items tbody").empty();
$(".summary-items tbody").empty();
$('#sub_total').text("0.00");
$(".create").attr("disabled","disabled");
});
customer_display_view(null,"reload");
});
function customer_display_view(data,status) {
url = '../../../../origami/customer_view';
$.ajax({
type: "POST",
url: url,
data: {"data":data,"status":status},
dataType: "json",
success:function(result){
}
});
}
$(document).on('click', '.cashier_number', function(event){
if(event.handled !== true) {
@@ -819,9 +832,9 @@
}
break;
case 'add':
case 'del' :
case 'clr':
$('#modal-qty').val(1);
$('#modal-qty').attr('data-value',0);
@@ -842,4 +855,4 @@
showHideNavbar(webview);
<% end %>
});
</script>
</script>

View File

@@ -17,7 +17,7 @@
else
delimiter = ""
end
%>
%>
<!-- Widgets -->
<div class="row clearfix">
@@ -114,9 +114,9 @@
<tr>
<% if payment.payment_method == 'paypar' %>
<td>Redeem Sale : </td>
<% else %>
<% else %>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% end %>
<% end %>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
@@ -143,7 +143,7 @@
</div>
</div>
</div>
<% end %>
<% end %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
@@ -211,7 +211,7 @@
<% if !@top_items.nil? %>
<tr>
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
<td align="right" width="60px"><%= @top_items.item_name %>
<td align="right" width="60px"><%= @top_items.item_name %>
<br>(<%= @top_items.item_total_price %>)</td>
</tr>
<% end %>
@@ -249,7 +249,7 @@ $(function() {
if ($('#server_mode').val() != "cloud" && display_type == 2) {
document.getElementById('second_view').click();
}
window.location.href = '/origami/quick_service';
window.location.href = '/origami/quick_service';
});
$(".fc_view").on('click', function() {
@@ -262,13 +262,13 @@ $(function() {
if ($('#server_mode').val() != "cloud" && display_type == 2) {
document.getElementById('second_view').click();
}
window.location.href = '/origami/food_court';
window.location.href = '/origami/food_court';
});
$(".order_reservation").on('click', function() {
window.location.href = '/origami/order_reservation';
});
$("#second_view").on('click', function () {
var url = $(this).attr("data-href");
window.open(url,'_blank');
@@ -278,4 +278,4 @@ $(function() {
window.location.href = '/origami/reservation';
});
});
</script>
</script>

View File

@@ -31,7 +31,7 @@
<span class="hidden" id="dining"><%if !@dining.nil?%><%= @dining.id%><%end%></span>
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Sale ID :</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></div>
</div>
<div class="row p-l-5 p-r-5">
<div class="col-lg-6 col-md-6 col-sm-6">
<strong>Customer :</strong>
@@ -186,7 +186,7 @@
</strong>
</div>
</div>
<div class="row payment cash-color p-l-5 p-r-5">
<div class="col-md-8">Cash</div>
<div class="col-md-4" id="cash" >
@@ -387,6 +387,8 @@
<div class="cashier_number border-top border- border-left payment-long" data-value="10000" data-type="add">10000</div>
</div>
<div class="row bottom">
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
<div class="pay border-top border- border-left purple payment-left" id="pay">Pay</div>
</div>
</div>
@@ -442,7 +444,7 @@
<% else %>
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
<% end %>
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
<!-- Waiter Buttons -->
@@ -468,7 +470,7 @@
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
@@ -491,11 +493,11 @@
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- pdf light box -->
<div class="modal fade" id="pdfModal" tabindex="-1" role="dialog" >
@@ -511,20 +513,20 @@
<input type="hidden" name="sale_receipt_no" id="sale_receipt_no">
<input type="hidden" name="filename" id="filename">
<input type="hidden" name="printer_name" id="printer_name">
<div class="text-center">
<div class="text-center">
<iframe id="receipt_pdf" src="" class="pdf-iframe" scrolling="no"></iframe>
</div>
</div>
<div class="modal-footer">
<button type="button" class="mr-2 m-t-5 btn-lg btn-block bg-red waves-effect print_receipt" id="print_receipt"> Print
</button>
</button>
<button type="button" class="btn-lg btn-block bg-blue waves-effect btn_pdf_close" data-dismiss="modal">
CLOSE
</button>
</div>
</div>
</div>
</div>
</div>
<!-- customer light box -->
<div class="modal fade" id="is_memberModal" tabindex="-1" role="dialog">
@@ -570,7 +572,7 @@
<div class="modal-footer"></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm" role="document">
@@ -579,7 +581,7 @@
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">&times;</button>
</div>
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
<input type="password" id="access_code" class="access_code form-control col-md-12 ">
<div class="row bottom p-l-15 p-r-15 m-t-10">
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
@@ -598,12 +600,12 @@
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- change tax modal -->
<div class="modal fade" id="change_taxModal" tabindex="-1" role="dialog">
@@ -667,7 +669,7 @@
<div class="m-r-20" align="right">
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
</div>
</div>
</div>
<!-- customer light box -->
<div class="modal fade m-t-40" id="is_paymemberModal" tabindex="-1" role="dialog">
@@ -694,14 +696,14 @@
<div class="modal-footer"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
// //control borwser back
window.location.hash="no-back-button";
window.location.hash="Again-No-back-button";//again because google chrome don't insert first hash into history
window.onhashchange=function(){window.location.hash="";}
var cashier_type = "<%= @cashier_type %>";
var cashier_type = "<%= @cashier_type %>";
var customer_id = "<%= @customer.id %>";
var customer_name = "<%= @customer.name %>";
var pdf_view = '<%=@pdf_view%>';
@@ -725,35 +727,35 @@ $(document).ready(function(){
/* start check first bill or not*/
var member_id = $('#membership_id').text();
var member_discount = $('#member_discount').text();
var receipt_no = "";
var receipt_no = "";
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim();
}
payment_type = '';
// if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
// console.log(payment_type)
// console.log(parseInt(jQuery.inArray("MPU", payment_type)))
if (member_id && member_discount) {
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
$("#credit_payment").hide();
$("#credit_payment").hide();
} else{
$("#credit_payment").show();
}
if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 ||
parseInt(jQuery.inArray("VISA", payment_type)) != -1 ||
parseInt(jQuery.inArray("JCB", payment_type)) != -1 ||
parseInt(jQuery.inArray("Master", payment_type)) != -1 ||
parseInt(jQuery.inArray("UNIONPAY", payment_type)) != -1 ||
if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 ||
parseInt(jQuery.inArray("VISA", payment_type)) != -1 ||
parseInt(jQuery.inArray("JCB", payment_type)) != -1 ||
parseInt(jQuery.inArray("Master", payment_type)) != -1 ||
parseInt(jQuery.inArray("UNIONPAY", payment_type)) != -1 ||
parseInt(jQuery.inArray("Redeem", payment_type)) != -1 ||
parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 ||
parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 ||
parseInt(jQuery.inArray("Alipay", payment_type)) != -1 ||
parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 ||
parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 ||
parseInt(jQuery.inArray("Alipay", payment_type)) != -1 ||
parseInt(jQuery.inArray("DINGA", payment_type)) != -1 ||
parseInt(jQuery.inArray("GiftVoucher", payment_type)) != -1){
$("#card_payment").show();
$("#card_payment").show();
} else{
$("#card_payment").hide();
}
@@ -775,9 +777,9 @@ $(document).ready(function(){
window.location.href = '/origami/table/'+ dining_id;
}else{
window.location.href = '/origami/'+cashier_type+'/pending_order/'+sale_id;
}
}
}
});
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
@@ -826,7 +828,7 @@ $(document).ready(function(){
swal("Oops","Please Pay with Redeem Payment","warning");
}else if(parseInt(jQuery.inArray("VISA", payment_type)) != -1 && $('#visacount').text()== 0 && sub_total != 0.0 && member){
swal("Oops","Please Pay with Visa Payment","warning");
}else if(parseInt(jQuery.inArray("JCB", payment_type)) != -1 && $('#jcbcount').text()== 0 && sub_total != 0.0 && member){
swal("Oops","Please Pay with jcb Payment","warning");
}
@@ -871,7 +873,7 @@ $(document).ready(function(){
calculate_member_discount(sale_id,tax_type);
}
// $("#pdfModal").on('shown.bs.modal', function () {
// $("#pdfModal").on('shown.bs.modal', function () {
// $('#pdfModal').focus() }).modal({show : true, backdrop : false, keyboard : false});
/* check credit payment or not*/
if(location.pathname.includes("credit_payment")){
@@ -891,7 +893,7 @@ $(document).ready(function(){
}
/* end delete receipt no in first bill*/
localStorage.removeItem("cash");
localStorage.removeItem("cash");
if (result.status) {
var msg = result.message;
}
@@ -899,7 +901,7 @@ $(document).ready(function(){
var msg = '';
}
$("#loading_wrapper" ).hide();
$("#loading_wrapper" ).hide();
if(location.pathname.includes("credit_payment")){
payment_success_alert();
}else{
@@ -922,7 +924,7 @@ $(document).ready(function(){
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
$("#pdfModalLabel").text("Sale Completed");
}else{
//PDF lightbox data
//PDF lightbox data
print_receipt();
}
}
@@ -930,10 +932,26 @@ $(document).ready(function(){
});
}
}
var second_display_lookup = $("#display_type").val();
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){
customer_display_view(null,"reload");
}
});
function customer_display_view(data,status) {
url = '../../../../origami/customer_view';
$.ajax({
type: "POST",
url: url,
data: {"data":data,"status":status},
dataType: "json",
success:function(result){
}
});
}
// $('#void').on('click',function () {
// if ($(this).attr('active') === "true") {
// if ($(this).attr('active') === "true") {
// var sale_id = $('#sale_id').text();
// var remark = $("#remark").val();
// var ajax_url = "/origami/sale/" + sale_id + '/void';
@@ -949,7 +967,7 @@ $(document).ready(function(){
// swal("Oops","You are not authorized for void","warning")
// }
// });
});
// bind survey to order or sale
@@ -960,7 +978,7 @@ $(document).ready(function(){
} else {
var sale_id = $('#dining').text();
}
//var table_id = $('.tables').attr("data-id");
//var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys";
});
@@ -1023,7 +1041,7 @@ $(document).ready(function(){
}else{
window.location.href = "/origami/table/sale/" + sale_id + "/"+cashier_type+"/edit";
}
}else{
swal("Oops","You are not authorized for void","warning")
}
@@ -1118,7 +1136,7 @@ $(document).ready(function(){
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(alipay) + parseFloat(junctionpay) + parseFloat(paymal) + parseFloat(dinga) + parseFloat(giftvoucher);
var result = parseFloat(amount_due) - parseFloat(total);
<% if precision.to_i > 0 %>
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
<% else %>
@@ -1134,7 +1152,7 @@ $(document).ready(function(){
url: '../../../customer_view',
data: {"data":data,"status":status},
dataType: "json",
success:function(result){
success:function(result){
}
});
}
@@ -1155,7 +1173,7 @@ $(document).ready(function(){
url: "/origami/" + sale_id + "/member_discount",
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':cashier_type, 'tax_type':tax_type },
async: false,
success:function(result){
success:function(result){
}
});
}
@@ -1179,7 +1197,7 @@ $(document).ready(function(){
var receipt_no = $("#sale_receipt_no").val();
var params = { 'filename':filename, 'receipt_no':receipt_no, 'printer_name':printer_name };
$.ajax({
type: "POST",
type: "POST",
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
data: params,
success:function(result){
@@ -1203,7 +1221,7 @@ $(document).ready(function(){
if (cashier_type=="quick_service"){
customer_display_view(null,"reload");
}
}
}
}
}else{
payment_success_alert();
@@ -1216,7 +1234,7 @@ $(document).ready(function(){
var title = "Payment Successful!";
if($('#balance').text() < 0){
var text = 'Changed amount ' + $('#balance').text() * (-1);
}else{
}else{
$('#pay').text("Pay");
var text = 'Thank You !';
}
@@ -1225,7 +1243,7 @@ $(document).ready(function(){
title: "Payment Successful!",
text: text,
html: true,
closeOnConfirm: false,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
@@ -1245,7 +1263,7 @@ $(document).ready(function(){
}
});
}
$(".btn_pdf_close").on('click',function(){
var flag = localStorage.getItem("trans_flag");
@@ -1257,9 +1275,9 @@ $(document).ready(function(){
window.location.href = '/origami';
}else{
window.location.href = '/origami/'+cashier_type;
}
}
}
});
$(".btn_customer_yes").on('click',function(){
@@ -1268,8 +1286,8 @@ $(document).ready(function(){
});
// Read Card Reader
$(".btn_member").on('click', function(){
var cardNo = "";
$(".btn_member").on('click', function(){
var cardNo = "";
var customer_id = '';
var customer_name = '';
var membership_id = '';
@@ -1278,13 +1296,13 @@ $(document).ready(function(){
var customer_mamber_card_no = 0;
$("#is_memberModal").hide();
$("#sxModal").show();
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
@@ -1302,7 +1320,7 @@ $(document).ready(function(){
}
}
});
});
}
},100);
});
@@ -1324,17 +1342,17 @@ $(document).ready(function(){
// QR Code Reader
$(".btn_qr_code").on('click', function(e){
$("#is_memberModal").hide();
var code = "";
var code = "";
var customer_id = '';
var customer_name = '';
var membership_id = '';
var membership_type = '';
var membership_type = '';
setTimeout(function(){
code=getQRCode();
code=getQRCode();
$("#qr_code").val(code);
});
if(sale_id != 0 && code != ""){
if(sale_id != 0 && code != ""){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
@@ -1352,13 +1370,13 @@ $(document).ready(function(){
}
}
});
}
});
}
});
// Read qrcode from java
function getQRCode(){
return code2lab.readQRCode();
return code2lab.readQRCode();
}
function update_sale(membership_id, customer_id, customer_name, sale_id) {
@@ -1393,7 +1411,7 @@ $(document).ready(function(){
location.reload();
}
}
});
});
});
}
@@ -1462,7 +1480,7 @@ $(document).ready(function(){
var cash = $('#grand_total').text();
var sub_total = $('#sub-total').text();
var sale_id = $('#sale_id').text();
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':cashier_type,'access_code':access_code };
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':cashier_type,'access_code':access_code };
swal({
title: "Alert",
text: "Are you sure want to FOC This Receipt?",
@@ -1477,8 +1495,8 @@ $(document).ready(function(){
type: "POST",
url: "/origami/payment/"+cashier_type+"/foc",
data: params,
success:function(result){
customer_display_view(null,"reload");
success:function(result){
customer_display_view(null,"reload");
if (cash >= 0) {
swal({
title: "Information!",
@@ -1498,14 +1516,14 @@ $(document).ready(function(){
window.location.href = '/origami';
}else{
window.location.href = '/origami/'+cashier_type;
}
}
}
});
}
}
});
}
});
});
});
$('#void').on('click', function () {
@@ -1543,12 +1561,12 @@ $(document).ready(function(){
window.location.href = '/origami';
}else{
window.location.href = '/origami/'+cashier_type;
}
}
}
}
})
}
});
});
});
function waste_and_spoilage(remark) {
@@ -1588,12 +1606,12 @@ $(document).ready(function(){
if(cashier_type=="quick_service"){
customer_display_view(null,"reload");
}
}
}
}
}
});
}
});
});
}
/* Start function for tax changable */
@@ -1628,12 +1646,12 @@ $(document).ready(function(){
type: "POST",
url: "/origami/payment/"+cashier_type+"/change_tax",
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: type},
success:function(data){
success:function(data){
if(data.status){
// console.log(type);
localStorage.setItem("tax_type", type);
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment';
}
}
}
});
}else{
@@ -1666,10 +1684,10 @@ $(document).ready(function(){
});
// Read Card Reader - Paymal payment for FoodCourt
$(".btn_paymal_member").on('click', function (){
var cardNo = "";
$(".btn_paymal_member").on('click', function (){
var cardNo = "";
var sale_id = $("#sale_id").text() || 0;
var receipt_no = "";
var receipt_no = "";
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim();
}
@@ -1678,15 +1696,15 @@ $(document).ready(function(){
var payment_amount = parseFloat($("#grand_total").text());
$("#is_paymemberModal").hide();
$("#sxModal").show();
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
if (customer_mamber_card_no == 0) {
customer_mamber_card_no = $("#membership_id").text() || 0;
}
if(sale_id != 0 && customer_mamber_card_no !=0){
if(sale_id != 0 && customer_mamber_card_no !=0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/send_account" ,
@@ -1743,7 +1761,7 @@ $(document).ready(function(){
});
}
}
});
});
}else{
swal({
title: 'Oops',
@@ -1763,16 +1781,16 @@ $(document).ready(function(){
// QR Code Reader
$(".btn_paymal_qr_code").on('click', function(e){
$("#is_paymemberModal").hide();
var code = "";
var code = "";
var sale_id = $("#sale_id").text() || 0;
var receipt_no = "";
var receipt_no = "";
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim();
}
var payment_amount = parseFloat($("#grand_total").text());
setTimeout(function(){
code=getQRCode();
if(sale_id != 0 && code != ""){
code=getQRCode();
if(sale_id != 0 && code != ""){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/send_account" ,
@@ -1828,8 +1846,8 @@ $(document).ready(function(){
});
}
}
});
}
});
}
},100);
});