Add total waste and spoil in close cashier and Closing Balance မွာ Character ေတြ ရိုက္လို႕ရေန

This commit is contained in:
San Wai Lwin
2018-05-14 15:31:00 +06:30
parent 49319d80cc
commit 8fda04372d
32 changed files with 549 additions and 205 deletions

View File

@@ -5,6 +5,7 @@ $(function() {
$('#accepted').hide();
$('#cancel').hide();
$(".tbl_customer").hide();
$(".order_close_cashier").hide();
$(function() {
$('.first-1').click();
});
@@ -17,6 +18,7 @@ $(function() {
$('#accepted').hide();
$('#cancel').hide();
$(".tbl_customer").hide();
$(".order_close_cashier").hide();
if (type == "pending") {
$(".first-1").click();
$('#accepted').text("ACCEPT");
@@ -36,6 +38,7 @@ $(function() {
$('#accepted').attr("data-value","completed");
}else if(type == "processed"){
$(".fifth-1").click();
$(".order_close_cashier").show();
// $('#accepted').hide();
// $('#cancel').hide();
}
@@ -119,6 +122,12 @@ $(function() {
callback_url(callback,ref_no,order_id,status,type,minutes);
});
$('#order_close_cashier').on('click',function(e){
e.preventDefault(); // Prevent the href from redirecting directly
var linkURL = '/origami/shift/ordering/close';
warnBeforeRedirect(linkURL);
});
$(document).on('click','.access_number', function(event){
if(event.handled !== true) {
var original_value = $('#access_code').val();
@@ -147,8 +156,40 @@ $(function() {
return false;
}
});
// $('button[data-dismiss="modal"]').on('click', function(){ $(this).parent().parent().parent().parent().modal('hide'); });
// $(".new_order_close").on("click",function(){
// var code = $(this).attr("data-value");
// $("#"+code+"_doemal_new_order").modal("hide");
// });
// $("[data-dismiss='modal']").on('click', function() {
// $('body').addClass('modal-open-fix');
// if($('body').css("padding-right") == '15px') {
// $('body').addClass('modal-open-fix-pad');
// }
// setTimeout(function() {
// if($('body').hasClass('modal-open-fix-pad')) {
// $('body').css('padding-right', '15px');
// }
// $('body').addClass('modal-open').removeClass('modal-open-fix, modal-open-fix-pad');
// }, 1000);
// });
});
function warnBeforeRedirect(linkURL) {
swal({
title: "Alert!",
text: "Are you sure you want to close cashier?",
type: "warning",
showCancelButton: true
}, function() {
// Redirect the user
window.location.href = linkURL;
});
}
function check_emp_access_code(access_code,type) {
var url = "/origami/check_emp_access_code/" + access_code ;
$.ajax({
@@ -193,6 +234,8 @@ function refreshDetailData(){
$('#discount_amount').text("0.00");
$('#total_tax').text("0.00");
$('#grand_total').text("0.00");
$(".tbl_customer").hide();
$(".order_close_cashier").hide();
}
//show order list
@@ -280,19 +323,21 @@ function show_order_detail(url,sr_no){
$('#customer_name').text(data.customer_name);
$('#phone').text(data.phone);
$('#address').text(address);
$('#delivery_to').text(delivery.provider);
$('#ref_no').text(data.transaction_ref);
$('#callback_url').text(data.callback_url);
$('#order_id').text(data.order_reservation_id);
$("#trans_ref").text(data.transaction_ref);
if(delivery.delivery_type == "service"){
if(delivery.provider == "food2u" || delivery.provider == "yangondoor2door"){
$("#delivery_info").text("(DELIVERY)");
}else if(delivery.delivery_type == "pick_up"){
$("#delivery_to").text("DELIVERY");
}else if(delivery.provider == "pick_up"){
$("#delivery_info").text("(PICK-UP)");
$("#delivery_to").text("PICK-UP");
}else{
$("#delivery_info").text("(DIRECT DELIVERY)");
$("#delivery_to").text("DIRECT DELIVERY");
}
if(data.order_remark!=null && data.order_remark!=""){
@@ -375,6 +420,18 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
}, function () {
window.location.href = '/origami/order_reservation';
});
}else{
swal({
title: 'Oops',
text: data.message,
type: 'error',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/order_reservation';
});
}
}
});
@@ -404,27 +461,47 @@ function timeFormat(date){
return time;
}
function showNewOrder(order_reservation){
// console.log(order_reservation);
function showNewOrder(order_reservation,shop_code){
if((order_reservation!=undefined) && (order_reservation!=null) && (order_reservation!="")){
var date = new Date(order_reservation.requested_time);
var time = timeFormat(date);
var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time;
//audio play
var audio = new Audio('/beep.wav'); // define your audio
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
// $("#new_order").text(order_reservation.order_reservation_id);
// $("#new_order_date").text(requested_date);
// if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){
// $("#"+shop_code+"_doemal_new_order").removeClass("hidden");
// }
// $("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){
// $("#notify_new_order").addClass("hidden");
// $("#notify_order_send_to_kitchen").addClass("hidden");
// $("#notify_order_ready_to_delivery").addClass("hidden");
// }).on('shown.bs.modal', function(e){
// $("#"+shop_code+"_doemal_new_order").focus();
// }).on('hide.bs.modal', function (e) {
// $("#"+shop_code+"_doemal_new_order").addClass("hidden");
// }).modal({show: true, keyboard: false, backdrop: false});
swal({
html: true,
title: 'Information',
text: "You have new order <b>" + order_reservation.order_reservation_id + "</b> at <b>"+requested_date+"</b>",
target: document.getElementById(shop_code+"_notify_new_order"),
text: "You have new order "+
"<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
type: 'success',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function (isConfirm) {
if(isConfirm){
audio.pause();
swal.close();
}
});
}
}