fixed conflit
This commit is contained in:
@@ -623,7 +623,7 @@ $(function() {
|
||||
row = "<h5>"+attributes[field]["type"]+"</h5>";
|
||||
|
||||
$(value).each(function(i){
|
||||
disabled = ""
|
||||
disabled = "false";
|
||||
status ="";
|
||||
if(parseInt(jQuery.inArray(value[i], selected_item)) !== -1){
|
||||
status = "selected-attribute";
|
||||
@@ -1041,7 +1041,12 @@ $(function() {
|
||||
}else if(result.data == 'OK'){
|
||||
window.location.href = '/origami/'+type+'/pending_order/' + $('#sale_id').text();
|
||||
}else{
|
||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment";
|
||||
if(result.current_user_role == 'foodcourt_cashier'){
|
||||
window.location.href = "/foodcourt/sale/"+result.data["sale_id"]+"/"+type+"/payment";
|
||||
}
|
||||
else{
|
||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ $(document).ready(function() {
|
||||
// var method = $(this).attr('data-method');
|
||||
// var url = $(this).attr('data-ref');
|
||||
// var html_text = $(this).siblings( "#delete_text" ).html();
|
||||
// //var page = url.substring(url.lastIndexOf('/') + 1);
|
||||
// //var page = url.substring(url.lastIndexOf('/') + 1);
|
||||
// swal({
|
||||
// title: "Confirmation",
|
||||
// text: html_text,
|
||||
@@ -147,11 +147,11 @@ $(document).ready(function() {
|
||||
// if (isConfirm) {
|
||||
// $.ajax({
|
||||
// type: method,
|
||||
// url: url ,
|
||||
// success: function(data) {
|
||||
// url: url ,
|
||||
// success: function(data) {
|
||||
// location.href = data.url;
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// } else {
|
||||
// swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||
// }
|
||||
@@ -167,7 +167,7 @@ $(document).ready(function() {
|
||||
var text = $("#notify_message").attr('data-message');
|
||||
|
||||
if (text != null || colorName != null){
|
||||
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
|
||||
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
|
||||
}
|
||||
|
||||
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
|
||||
@@ -222,8 +222,8 @@ function audioPlayBackground(shop_code,audio){
|
||||
function getOnlineOrderCount(){
|
||||
var count = 0;
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
async: false,
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "GET",
|
||||
url: "/origami/get_order_info",
|
||||
dataType: "json",
|
||||
@@ -234,8 +234,8 @@ function getOnlineOrderCount(){
|
||||
}
|
||||
}
|
||||
});
|
||||
//end Ajax
|
||||
//end Ajax
|
||||
// alert(count);
|
||||
return count;
|
||||
}
|
||||
/* online order count*/
|
||||
/* online order count*/
|
||||
|
||||
186
app/assets/javascripts/foodcourt.js
Normal file
186
app/assets/javascripts/foodcourt.js
Normal file
@@ -0,0 +1,186 @@
|
||||
//= require jquery
|
||||
//= require tether
|
||||
//= require jquery_ujs
|
||||
//= require bootstrap/js/popper.min
|
||||
//= require bootstrap/js/bootstrap-material-design.min
|
||||
//= require momentjs/moment
|
||||
//= require bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker
|
||||
//= require jquery-slimscroll/jquery.slimscroll.js
|
||||
//= require bootstrap-notify/bootstrap-notify.js
|
||||
//= require node-waves/waves.js
|
||||
//= require sweetalert/sweetalert.min.js
|
||||
//= require fileinput.min
|
||||
//= require cable
|
||||
//= require turbolinks
|
||||
//= require BSBMaterial/turbolink_admin.js
|
||||
//= require BSBMaterial/demo.js
|
||||
|
||||
/* Constant Varaibles */
|
||||
_CREDIT_PAYMENTS_ = "/ CREDIT PAYMENTS";
|
||||
_CUSTOMERS_ = "/ CUSTOMERS";
|
||||
_DISCOUNTS_ = "/ DISCOUNTS";
|
||||
_IN_DUTIES_ = "/ IN DUTIES";
|
||||
_JCB_ = "/ JCB PAYMENT";
|
||||
_MASTER_ = "/ MASTER PAYMENT";
|
||||
_MPU_ = "/ MPU PAYMENT";
|
||||
_ALIPAY_ = "/ Alipay";
|
||||
_JUNCTIONPAY_ = "/ JunctionPay";
|
||||
_PAYMAL_ = "/ PAYMAL";
|
||||
_DINGA_ = "/ DINGA PAYMENT";
|
||||
_GIFT_VOUCHER_ = "/ GIFT VOUCHER";
|
||||
_OTHER_CHARGES_ = "/ CHARGES";
|
||||
_OTHER_PAYMENTS_ = "/ OTHER PAYMENT";
|
||||
_PAYMENTS_ = "/ PAYMENT";
|
||||
_PAYPAR_PAYMENT_ = "/ PAYPAR PAYMENT";
|
||||
_COMMISSIONS_ = "/ COMMISSIONS";
|
||||
_REDEEM_PAYMENT_ = "/ REDEEM PAYMENT";
|
||||
_SALE_EDIT_ = "/ SALE EDIT";
|
||||
_SPLIT_BILL_ = "/ SPLIT BILL";
|
||||
_UNION_ = "/ UNION PAYMENT";
|
||||
_VISA_ = "/ VISA PAYMENT";
|
||||
_VOUCHER_ = "/ VOUCHER";
|
||||
_SURVEY_ = "/ SURVEY";
|
||||
/* Constant Varaibles */
|
||||
|
||||
$(document).on('turbolinks:load', function() {
|
||||
|
||||
$("#customer_image_path").fileinput({
|
||||
previewFileType: "image",
|
||||
allowedFileExtensions: ["jpg", "gif", "png"],
|
||||
browseClass: "btn btn-success",
|
||||
browseLabel: "Pick Image",
|
||||
browseIcon: "<i class=\"fa fa-image\"></i> ",
|
||||
removeClass: "btn btn-danger",
|
||||
removeLabel: "Delete",
|
||||
removeIcon: "<i class=\"fa fa-trash\"></i> ",
|
||||
showUpload: false,
|
||||
// uploadClass: "btn btn-info",
|
||||
// uploadLabel: "Upload",
|
||||
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
|
||||
previewTemplates: {
|
||||
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
|
||||
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
|
||||
$('.datetimepicker').bootstrapMaterialDatePicker({
|
||||
format: 'DD-MM-YYYY - HH:mm',
|
||||
clearButton: true,
|
||||
weekStart: 1
|
||||
});
|
||||
|
||||
$('.datepicker').bootstrapMaterialDatePicker({
|
||||
format: 'DD-MM-YYYY',
|
||||
clearButton: true,
|
||||
weekStart: 1,
|
||||
time: false
|
||||
});
|
||||
|
||||
$('.timepicker').bootstrapMaterialDatePicker({
|
||||
format: 'HH:mm',
|
||||
clearButton: true,
|
||||
date: false
|
||||
});
|
||||
|
||||
// For selected order return
|
||||
var order_status = "";
|
||||
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
|
||||
|
||||
|
||||
$(document).on('click', '.access_modal', function(event){
|
||||
type = $(this).data("type");
|
||||
$(".ok").attr("data-action",type);
|
||||
$('#AccessCodeModal').modal('show');
|
||||
});
|
||||
|
||||
$(document).on('click', '.access_number', function(event){
|
||||
if(event.handled !== true) {
|
||||
var original_value = $('#access_code').val();
|
||||
var input_type = $(this).attr("data-type");
|
||||
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
var input_value = $(this).attr("data-value");
|
||||
if (original_value){
|
||||
$('#access_code').val(original_value + input_value);
|
||||
}else{
|
||||
$('#access_code').val(original_value + input_value);
|
||||
}
|
||||
break;
|
||||
case 'ok':
|
||||
var type = $(this).attr("data-action");
|
||||
code = $('#access_code').val();
|
||||
check_emp_access_code(code,type)
|
||||
break;
|
||||
case 'clr':
|
||||
$('#access_code').val("");
|
||||
break;
|
||||
}
|
||||
event.handled = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function setHeaderBreadCrumb(params){
|
||||
$("#others_payment").html(params);
|
||||
}
|
||||
|
||||
//show hide nav bar for webview
|
||||
function showHideNavbar(webview,page){
|
||||
if(webview){
|
||||
$("nav.navbar").addClass("hidden");
|
||||
$("section").addClass("section-margin");
|
||||
$(".page-loader-wrapper").addClass("hidden");
|
||||
if(page!=undefined){
|
||||
$("#back").hide();
|
||||
}
|
||||
}else{
|
||||
$("nav.navbar").removeClass("hidden");
|
||||
$("section").removeClass("section-margin");
|
||||
$(".page-loader-wrapper").removeClass("hidden");
|
||||
if(page!=undefined){
|
||||
$("#back").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createAccessCode(code) {
|
||||
localStorage.setItem("access_code",code);
|
||||
}
|
||||
function check_emp_access_code(access_code,type) {
|
||||
var url = "/foodcourt/check_emp_access_code/" + access_code ;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: {},
|
||||
success: function (result) {
|
||||
if (result.status == true) {
|
||||
createAccessCode(code);
|
||||
if (type == "edit") {
|
||||
var dining_id = $('#dining').text();
|
||||
var sale_id = $('#sale_id').text();
|
||||
if (dining_id) {
|
||||
window.location.href = '/foodcourt/table/' + dining_id + "/sale/" + sale_id + "/food_court/edit";
|
||||
}else{
|
||||
window.location.href = "/foodcourt/table/sale/" + sale_id + "/food_court/edit";
|
||||
}
|
||||
}else if(type == "void"){
|
||||
$('#AccessCodeModal').modal('hide');
|
||||
$('#voidModal').modal('show');
|
||||
}else if(type == "waste") {
|
||||
waste_and_spoilage("waste")
|
||||
}else if(type == "spoile") {
|
||||
waste_and_spoilage("spoile")
|
||||
}else if(type == "foc"){
|
||||
$('#AccessCodeModal').modal('hide');
|
||||
$('#focModal').modal('show');
|
||||
}
|
||||
}else{
|
||||
swal("Oops",result.message,"warning");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user