Merge branch 'master' into license
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
//= require custom.js
|
||||
|
||||
$(document).on('turbolinks:load', function() {
|
||||
|
||||
$(".nav-completed").on("click", function(){
|
||||
$("#completed").removeClass('hide')
|
||||
$(".oqs_append").addClass('hide')
|
||||
@@ -96,7 +95,7 @@ $(document).on('turbolinks:load', function() {
|
||||
+'</div>'
|
||||
|
||||
+'<div class="card-footer">'
|
||||
+'<button id="edit_'+ data[field]["assigned_order_item_id"]+'" class="btn btn-warning order-item order-item-edit">EDIT</button>'
|
||||
+'<button id="edit_'+ data[field]["assigned_order_item_id"] + '" data-no-turbolink="true" class="btn btn-warning order-item order-item-edit">EDIT</button>'
|
||||
+' <button id="assigned_queue_' + data[field]["assigned_order_item_id"] +'" class="btn btn-primary order-item order-complete">COMPLETE</button>'
|
||||
+'</div>'
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
$(function(){
|
||||
$(function() {
|
||||
//click menu sidebar menu category
|
||||
$(".product").on("click", function(){
|
||||
var url = $(this).attr('data-ref');
|
||||
show_product_list(url);
|
||||
console.log(url)
|
||||
});
|
||||
//show menu item list when click menu category
|
||||
function show_product_list(url_item){
|
||||
@@ -635,8 +634,9 @@ $(function(){
|
||||
|
||||
// Pay Discount for Payment
|
||||
$("#create_order").on('click', function(e){
|
||||
$(this).attr('disabled', 'disabled');
|
||||
e.preventDefault();
|
||||
$("#loading_wrapper").show();
|
||||
$("#oqs_loading_wrapper").show();
|
||||
var table_id = $('#table_id').text();
|
||||
var booking_id = $('#booking_id').text();
|
||||
if (!booking_id.length > 0) {
|
||||
@@ -651,34 +651,34 @@ $(function(){
|
||||
|
||||
var ajax_url = '../addorders/create';
|
||||
|
||||
|
||||
var params = {'order_source': "cashier", 'order_type': "dine_in",
|
||||
'customer_id': "", 'guest_info': "",
|
||||
'table_id': table_id,
|
||||
'order_items': order_items };
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: params,
|
||||
dataType: "json",
|
||||
success:function(result){
|
||||
$("#loading_wrapper").hide();
|
||||
swal({
|
||||
title: "Information !",
|
||||
text: 'Order has been successfully created',
|
||||
confirmButtonColor: "green",
|
||||
confirmButtonText: "Yes!",
|
||||
closeOnConfirm: false,
|
||||
}, function () {
|
||||
if(table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + table_id
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + table_id
|
||||
}
|
||||
});
|
||||
}
|
||||
success:function(result){
|
||||
// $("#oqs_loading_wrapper").hide();
|
||||
// swal({
|
||||
// title: "Information !",
|
||||
// text: 'Order has been successfully created',
|
||||
// confirmButtonColor: "green",
|
||||
// confirmButtonText: "Yes!",
|
||||
// closeOnConfirm: false,
|
||||
// }, function (isConfirm) {
|
||||
// if (isConfirm) {
|
||||
if(table_type == "Table"){
|
||||
window.location.href = "/origami/table/" + table_id
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + table_id
|
||||
}
|
||||
// }
|
||||
// });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
@import "BSBMaterial/themes/all-themes";
|
||||
@import "reset";
|
||||
|
||||
.sx-margin-0 {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.selected-item {
|
||||
color: #fff !important;
|
||||
background-color: #7a62d3 !important;
|
||||
|
||||
@@ -9,6 +9,37 @@
|
||||
@import "BSBMaterial/style";
|
||||
@import "BSBMaterial/themes/all-themes";
|
||||
@import "reset";
|
||||
|
||||
/* Reset */
|
||||
.col-lg-1, .col-md-1, .col-sm-1,col-xl-1{
|
||||
padding-left: 1px ;
|
||||
padding-right: 1px ;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
select.form-control {
|
||||
height: inherit !important;
|
||||
}
|
||||
|
||||
.form-horizontal .form-group {
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
|
||||
.card-columns {
|
||||
font-size: 18px !important;
|
||||
}
|
||||
|
||||
@media (min-width:769px) and (max-width:1024px) {
|
||||
.btn-block {
|
||||
font-size: 11px !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* End Reset */
|
||||
|
||||
.order-completed {
|
||||
background-color: #CCFFDD;
|
||||
}
|
||||
|
||||
@@ -128,8 +128,7 @@ section.content{
|
||||
|
||||
/*Loading gif for payment*/
|
||||
|
||||
#loading_wrapper{
|
||||
|
||||
#oqs_loading_wrapper{
|
||||
position: fixed;
|
||||
background-color: #C8C8C8 ;
|
||||
height: 100%;
|
||||
@@ -137,9 +136,9 @@ section.content{
|
||||
left: 0;
|
||||
opacity: 0.6;
|
||||
top: 0;
|
||||
z-index: 9999999;
|
||||
z-index: 100;
|
||||
}
|
||||
#loading{
|
||||
#oqs_loading{
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
@@ -147,9 +146,9 @@ section.content{
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
opacity: 1;
|
||||
z-index: 101;
|
||||
filter: alpha(opacity=100); /* ie */
|
||||
-moz-opacity: 1; /* mozilla */
|
||||
|
||||
-moz-opacity: 1; /* mozilla */
|
||||
}
|
||||
|
||||
#count ,#set_count{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Crm::DiningQueuesController < BaseCrmController
|
||||
load_and_authorize_resource
|
||||
before_action :set_dining_queue, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
|
||||
# GET /crm/dining_queues
|
||||
# GET /crm/dining_queues.json
|
||||
def index
|
||||
@@ -86,6 +86,17 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
queue = DiningQueue.find(params[:id])
|
||||
table_id = params[:table_id]
|
||||
|
||||
dining_facility = DiningFacility.find(params[:table_id])
|
||||
if dining_facility.type == "Table"
|
||||
type = "TableBooking"
|
||||
else
|
||||
type = "RoomBooking"
|
||||
end
|
||||
|
||||
booking = Booking.create({:dining_facility_id => params[:table_id],:type => type,
|
||||
:checkin_at => Time.now.utc,:customer_id => queue.customer_id,:booking_status => "assign" })
|
||||
booking.save!
|
||||
|
||||
status = queue.update_attributes(dining_facility_id: table_id,status:"Assign")
|
||||
# status = DiningFacility.find(table_id).update_attributes(status: "occupied")
|
||||
|
||||
|
||||
@@ -121,8 +121,9 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
|
||||
if status == true
|
||||
render json: JSON.generate({:status => true})
|
||||
# Re-calc All Amount in Sale
|
||||
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount)
|
||||
if(id == "SAL")
|
||||
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount)
|
||||
end
|
||||
else
|
||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||
end
|
||||
|
||||
@@ -114,7 +114,8 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
if Sale.exists?(sale_id)
|
||||
sale = Sale.find(sale_id)
|
||||
table_id = sale.bookings[0].dining_facility_id
|
||||
table_type = DiningFacility.find(table_id).type
|
||||
dining = DiningFacility.find(table_id)
|
||||
table_type = dining.type
|
||||
|
||||
discount_items = []
|
||||
#destroy all discount sale item
|
||||
@@ -133,14 +134,14 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
sale.sale_items.destroy(discount_items)
|
||||
|
||||
action_by = current_user.id
|
||||
remark = "Remove Discount Sale Id [#{sale.sale_id}]| Receipt No #{sale.receipt_no} | Table- #{table.name} "
|
||||
remark = "Remove Discount Sale Id [#{sale.sale_id}]| Receipt No #{sale.receipt_no} | Table- #{dining.name} "
|
||||
sale_audit = SaleAudit.record_audit_discount(sale.sale_id,sale.cashier_id, action_by,remark,"REMOVEALLDISCOUNT" )
|
||||
|
||||
# Re-calc All Amount in Sale
|
||||
sale.compute_by_sale_items(sale_id, sale.sale_items, 0)
|
||||
result = {:status=> "Success", :table_id => table_id, :table_type => table_type }
|
||||
result = {:status=> "Success", :table_id => table_id, :dining => dining.name, :table_type => table_type }
|
||||
else
|
||||
result = {:status=> "Please, Check Again!", :table_id => table_id, :table_type => table_type }
|
||||
result = {:status=> "Please, Check Again!", :table_id => table_id, :dining => dining.name, :table_type => table_type }
|
||||
end
|
||||
|
||||
render :json => result.to_json
|
||||
|
||||
@@ -39,7 +39,7 @@ class SaleItem < ApplicationRecord
|
||||
|
||||
# Check for actual sale items
|
||||
sale_items.each do |si|
|
||||
if si.account_id == a.id
|
||||
if si.account_id == a.id
|
||||
account_price[:price] = account_price[:price] + si.price
|
||||
end
|
||||
end
|
||||
|
||||
@@ -407,9 +407,6 @@ class SalePayment < ApplicationRecord
|
||||
rescue SocketError
|
||||
response = { "status": false, "message": "Can't connect server"}
|
||||
end
|
||||
puts response.to_json
|
||||
puts payparcost
|
||||
puts overall_dis
|
||||
redeem_amount = payparcost + overall_dis
|
||||
|
||||
total_percentage = 0
|
||||
|
||||
@@ -22,7 +22,7 @@ class CloseCashierPdf < Prawn::Document
|
||||
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
|
||||
# db font setup
|
||||
if printer_settings.font != nil
|
||||
if printer_settings.font != ""
|
||||
font_families.update("#{printer_settings.font}" => {
|
||||
:normal => "public/fonts/#{printer_settings.font}.ttf",
|
||||
:italic => "public/fonts/#{printer_settings.font}.ttf",
|
||||
|
||||
@@ -20,7 +20,7 @@ class CrmOrderPdf < Prawn::Document
|
||||
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.p_width, self.page_height])
|
||||
|
||||
# db font setup
|
||||
if printer_settings.font != nil
|
||||
if printer_settings.font != ""
|
||||
font_families.update("#{printer_settings.font}" => {
|
||||
:normal => "public/fonts/#{printer_settings.font}.ttf",
|
||||
:italic => "public/fonts/#{printer_settings.font}.ttf",
|
||||
|
||||
@@ -22,7 +22,7 @@ class StockResultPdf < Prawn::Document
|
||||
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
|
||||
# db font setup
|
||||
if printer_settings.font != nil
|
||||
if printer_settings.font != ""
|
||||
font_families.update("#{printer_settings.font}" => {
|
||||
:normal => "public/fonts/#{printer_settings.font}.ttf",
|
||||
:italic => "public/fonts/#{printer_settings.font}.ttf",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="col-lg-9 col-md-9 col-sm-9">
|
||||
<!-- <div class="main-box-body clearfix"> -->
|
||||
<div class="body table-responsive">
|
||||
<table class="table table-hover table-striped">
|
||||
@@ -19,21 +19,14 @@
|
||||
<table class="table table-striped"> -->
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
||||
<!-- <div class=" col-md-7 form-group float-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control input-xs col-md-9">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
<button type="submit" class="float-right btn btn-primary btn-md">Search</button>
|
||||
</div> -->
|
||||
<% end %>
|
||||
<td colspan="7">
|
||||
<!-- <button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||
<button id="qr_code" class="btn btn-danger btn-md">
|
||||
<span class="fa fa-credit-card"></span> QR CODE
|
||||
</button> -->
|
||||
<div class="body">
|
||||
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="body">
|
||||
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
@@ -45,9 +38,8 @@
|
||||
<button type="button" id="qr_code" class="btn bg-green btn-sm waves-effect" style="margin-right: 10px;"><%= t("views.btn.qr_code") %></button>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
@@ -91,7 +83,7 @@
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div id="custom-slimscroll">
|
||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||
</div>
|
||||
|
||||
@@ -68,27 +68,42 @@
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.date") %></th>
|
||||
<!-- <th>Redeem</th> -->
|
||||
<th><%= t("views.right_panel.detail.discount_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.amount") %></th>
|
||||
<!-- <th>Balance</th> -->
|
||||
<th><%= t("views.right_panel.detail.from_account") %></th>
|
||||
<th><%= t("views.right_panel.detail.status") %></th>
|
||||
<th><%= t("views.right_panel.detail.from_account") %></th>
|
||||
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @response["status"] == true %>
|
||||
<% @response["data"].each do |transaction| %>
|
||||
<tr>
|
||||
<td><%= transaction["date"]%></td>
|
||||
<!-- <td><%= transaction["redeem"]%></td> -->
|
||||
<td><%= transaction["deposit"] %></td>
|
||||
<!-- <td><%= transaction["balance"] %></td> -->
|
||||
<td><%= transaction["account_status"] %></td>
|
||||
<td><%= transaction["status"] %></td>
|
||||
<td><%= transaction["receipt_no"] %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
<% @response["data"].each do |transaction| %>
|
||||
<tr>
|
||||
<td><%= transaction["date"]%></td>
|
||||
<% if transaction["status"] == 'Rebate' || transaction["status"] == 'Discount'%>
|
||||
<td><%= transaction["deposit"] %></td>
|
||||
<% else %>
|
||||
<td>(<%= transaction["withdraw"] %>)</td>
|
||||
<% end %>
|
||||
<td><%= transaction["status"] %></td>
|
||||
<td><%= transaction["account_status"] %></td>
|
||||
<td><%= transaction["receipt_no"] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @response["data"].first["status"] != 'Discount'%>
|
||||
<tr style="border-top:2px solid #666;">
|
||||
<th>Balance</th>
|
||||
<th colspan="4">
|
||||
<%= @response["data"].first["balance"] %>
|
||||
</th>
|
||||
</tr>
|
||||
<%end%>
|
||||
<%else%>
|
||||
<tr style="border-top:2px solid #666;">
|
||||
<td colspan="5"><p class="align-center">There is no transaction coz of <%=@response["data"]%> ...</p>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -98,7 +113,7 @@
|
||||
|
||||
<div class="tab-pane" id="order" role="tabpanel" style="min-height:670px; max-height:670px; ">
|
||||
|
||||
<h3><%= t :order_details %></h3>
|
||||
<h5><%= t :order_details %></h5>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -128,18 +143,20 @@
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="sale" role="tabpanel" style="min-height:670px; max-height:670px; ">
|
||||
<h3><%= t :sale_details %></h3>
|
||||
<h5><%= t :sale_details %></h5>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.tax_amount") %></th>
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.total_discount") %></th>
|
||||
<th><%= t("views.right_panel.detail.tax_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.sub_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -147,12 +164,14 @@
|
||||
<% @sales.each do |sale| %>
|
||||
<tr>
|
||||
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
<td><%= sale.total_tax %></td>
|
||||
<td><%= sale.cashier_name rescue '-' %></td>
|
||||
<td> <%= sale.sale_status %> </td>
|
||||
<td> <%= sale.receipt_date.strftime("%d-%m-%Y %I:%m %p") %> </td>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td><%= sale.total_discount %></td>
|
||||
<td><%= sale.total_tax %></td>
|
||||
<td><%= sale.total_amount %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
<td><%= sale.cashier_name rescue '-' %></td>
|
||||
<td> <%= sale.sale_status %> </td>
|
||||
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
@@ -165,9 +184,8 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<br><br>
|
||||
<a href="<%= crm_customers_path%>" class="btn btn-primary btn-lg">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> <%= t("views.btn.back") %>
|
||||
<a href="<%= crm_customers_path%>" class="btn btn-default btn-sm">
|
||||
<i class="material-icons">reply</i><%= t("views.btn.back") %>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -28,15 +28,26 @@
|
||||
@bg_color = "normal"
|
||||
end
|
||||
%>
|
||||
<div class="card select-queue <%= @bg_color %>" data-id="<%= queue.id %>" style="">
|
||||
<div class="card select-queue <%= @bg_color %>" data-id="<%= queue.id %>">
|
||||
<div class="card-block">
|
||||
<p class="hidden queue-id"><%= queue.id %></p>
|
||||
<p class="hidden queue-status"><%= queue.status %></p>
|
||||
<span class="card-title"><strong> Queue No : <%= queue.queue_no %></strong></span>
|
||||
<span class="card-title float-right"><strong> Seater : <%= queue.seater %></strong></span><br>
|
||||
<span class="card-title"> Name : <%= queue.name %></span><br>
|
||||
<span class="card-title"> Contact No : <%= queue.contact_no %></span><br>
|
||||
<span class="card-title"> Remark : <%= queue.remark %></span>
|
||||
<div class="row card-title">
|
||||
<div class="col-md-auto col-sm-12 sx-margin-0">
|
||||
<p class="padding-0 margin-0">
|
||||
<strong> Queue No : <%= queue.queue_no %></strong>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-auto col-sm-12 sx-margin-0">
|
||||
<p class="padding-0 margin-0">
|
||||
<strong> Seater : <%= queue.seater %></strong>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="card-title"> Name : <%= queue.name %></p>
|
||||
<p class="card-title"> Contact No : <%= queue.contact_no %></p>
|
||||
<p class="card-title"> Remark : <%= queue.remark %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -55,9 +66,9 @@
|
||||
<div class="body">
|
||||
<h6><i class="material-icons md-18">view_headline QUEUE DETAILs</i> </h6>
|
||||
<p>
|
||||
1) Latest Queue No - <%= @complete_queue.last.queue_no%> <br>
|
||||
2) Next Queue No - <% @next = @complete_queue.last.queue_no.to_i + 1%>
|
||||
<%= @next%> <br>
|
||||
1) Latest Queue No - <%= @complete_queue.last.queue_no rescue 0 %> <br>
|
||||
2) Next Queue No - <% @next = (@complete_queue.last.queue_no.to_i rescue 0) + 1%>
|
||||
<%= @next rescue 0 %> <br>
|
||||
3) Today Completed Queue - <strong> <%= @complete_queue.count %> </strong><br>
|
||||
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
|
||||
@@ -89,10 +89,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons m-t--10">reply</i>
|
||||
Back
|
||||
</button>
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons m-t--10">reply</i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -115,8 +115,9 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#back').on('click', function () {
|
||||
window.location.href = '/oqs/';
|
||||
window.location.href = '/oqs';
|
||||
})
|
||||
|
||||
// number key pad
|
||||
|
||||
@@ -1,418 +1,187 @@
|
||||
|
||||
<!-- <div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t :OQS %></li>
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', dashboard_path %>
|
||||
</span>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
<!-- Column One -->
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="body p-l-10">
|
||||
<%= form_tag oqs_root_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
<input type="text" name="filter" class="form-control" placeholder="Search">
|
||||
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
|
||||
<button type="submit" class="btn bg-blue waves-effect waves-effect">Search</button>
|
||||
</div>
|
||||
|
||||
<!-- Column One -->
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="body p-l-10">
|
||||
<%= form_tag oqs_root_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
<input type="text" name="filter" class="form-control" placeholder="Search">
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
|
||||
<button type="submit" class="btn bg-blue waves-effect waves-effect">Search</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<!-- <li class="nav-item nav-search <%= @filter.to_s.length > 0? " " : "hide"%>">
|
||||
<a class="nav-link <%= @filter.to_s.length > 0? "active" : " "%>" data-toggle="tab" href="#search" role="tab">Searching .. <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li> -->
|
||||
<li class="nav-item nav-completed">
|
||||
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab">Processed
|
||||
<span class="badge bg-blue-grey" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li>
|
||||
<% # For Tab Disable for Station is inactive
|
||||
status=""
|
||||
i=0
|
||||
@queue_stations.each do |qsi|
|
||||
if qsi.is_active == false
|
||||
status="disabled"
|
||||
end %>
|
||||
<li class="nav-item oqs_click" data-id="<%= qsi.id %>">
|
||||
<p class="hidden oqs-id"><%= qsi.id %></p>
|
||||
<a class="nav-link" data-id="<%= qsi.id %>" data-toggle="tab" href="" role="tab" <%= status %>>
|
||||
<%= qsi.station_name %>
|
||||
<% if @filter.nil? %>
|
||||
<span class="badge bg-blue-grey oqs_count<%= i%> oqs_count" data-id="<%= qsi.id %>" id="completed_count">
|
||||
<!-- <span class="badge badge-pill badge-default oqs_count<%= i%> oqs_count" data-id="<%= qsi.id %>"> --> <%= qsi.assigned_order_items.where("delivery_status=0 AND created_at >= '#{Time.now.beginning_of_day.utc}'").count %>
|
||||
</span>
|
||||
<%else%>
|
||||
<span class="label-count badge bg-blue-grey" data-id="<%= qsi.id %>">
|
||||
<% @count.each do |c|%>
|
||||
<% if qsi.id == c.station_id %>
|
||||
<%= c.total %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<% if qsi.auto_print %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<% i+=1%>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<!-- <li class="nav-item nav-search <%= @filter.to_s.length > 0? " " : "hide"%>">
|
||||
<a class="nav-link <%= @filter.to_s.length > 0? "active" : " "%>" data-toggle="tab" href="#search" role="tab">Searching .. <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li> -->
|
||||
<li class="nav-item nav-completed">
|
||||
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab">Processed
|
||||
<span class="badge bg-blue-grey" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li>
|
||||
<% # For Tab Disable for Station is inactive
|
||||
status=""
|
||||
i=0
|
||||
@queue_stations.each do |qsi|
|
||||
if qsi.is_active == false
|
||||
status="disabled"
|
||||
end %>
|
||||
<li class="nav-item oqs_click" data-id="<%= qsi.id %>">
|
||||
<p class="hidden oqs-id"><%= qsi.id %></p>
|
||||
<a class="nav-link" data-id="<%= qsi.id %>" data-toggle="tab" href="" role="tab" <%= status %>>
|
||||
<%= qsi.station_name %>
|
||||
<% if @filter.nil? %>
|
||||
<span class="badge bg-blue-grey oqs_count<%= i%> oqs_count" data-id="<%= qsi.id %>" id="completed_count">
|
||||
<!-- <span class="badge badge-pill badge-default oqs_count<%= i%> oqs_count" data-id="<%= qsi.id %>"> --> <%= qsi.assigned_order_items.where("delivery_status=0 AND created_at >= '#{Time.now.beginning_of_day.utc}'").count %>
|
||||
</span>
|
||||
<%else%>
|
||||
<span class="label-count badge bg-blue-grey" data-id="<%= qsi.id %>">
|
||||
<% @count.each do |c|%>
|
||||
<% if qsi.id == c.station_id %>
|
||||
<%= c.total %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<% if qsi.auto_print %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<% i+=1%>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
<p class="hidden filter"><%= @filter %></p>
|
||||
<% end %>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
<p class="hidden filter"><%= @filter %></p>
|
||||
|
||||
<div class="tab-content" id="custom-slimscroll" style="">
|
||||
<!--- Panel 0 - Completed -->
|
||||
<div class="tab-content" id="custom-slimscroll" style="">
|
||||
<!--- Panel 0 - Completed -->
|
||||
|
||||
<div class="tab-pane in active" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@queue_completed_item.each do |qid|
|
||||
%>
|
||||
<div class="card queue_station">
|
||||
<div class="card-block">
|
||||
<div class="row">
|
||||
<span class="col-md-4 order-zone-type font-13"><%= qid.type %>-<%= qid.zone %></span>
|
||||
<span class="order-zone hidden font-13"><%= qid.zone %></span>
|
||||
<span class="col-md-8"><small class="float-right font-13"><%= qid.order_id %></small></span>
|
||||
</div>
|
||||
<p class="m-b--10">
|
||||
<span class="order-item font-16">
|
||||
<%= qid.item_name %>
|
||||
</span> [x
|
||||
<span class="order-qty">
|
||||
<%= qid.qty %>
|
||||
</span> ]
|
||||
</p>
|
||||
<div class="tab-pane in active" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@queue_completed_item.each do |qid|
|
||||
%>
|
||||
<div class="card queue_station">
|
||||
<div class="card-block">
|
||||
<div class="row">
|
||||
<span class="col-md-4 order-zone-type font-13"><%= qid.type %>-<%= qid.zone %></span>
|
||||
<span class="order-zone hidden font-13"><%= qid.zone %></span>
|
||||
<span class="col-md-8"><small class="float-right font-13"><%= qid.order_id %></small></span>
|
||||
</div>
|
||||
<p class="m-b--10">
|
||||
<span class="order-item font-16">
|
||||
<%= qid.item_name %>
|
||||
</span> [x
|
||||
<span class="order-qty">
|
||||
<%= qid.qty %>
|
||||
</span> ]
|
||||
</p>
|
||||
|
||||
<p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
|
||||
<p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
|
||||
|
||||
<span class="card-text">
|
||||
<span class="text-muted">Order at -
|
||||
<span class="order-at font-13">
|
||||
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
|
||||
</span> <br>
|
||||
Order By - <span class="order-by font-13">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</span>
|
||||
<span class="card-text">
|
||||
<span class="text-muted">Order at -
|
||||
<span class="order-at font-13">
|
||||
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
|
||||
</span> <br>
|
||||
Order By - <span class="order-by font-13">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<p class="hidden order-status">completed</p>
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<p class="hidden order-status">completed</p>
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- End Panel 0 - Completed -->
|
||||
<!--- Order Items -->
|
||||
<div class="card-columns oqs_append" id="oqs_container" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<!-- End Panel 0 - Completed -->
|
||||
<!--- Order Items -->
|
||||
<div class="card-columns oqs_append" id="oqs_container" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
</div>
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">ORDER DETAILS</strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
<table class="">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:33%; text-align:">Order By</th>
|
||||
<th style="width:33%; text-align:">Order At</th>
|
||||
<!-- <th style="width:33%; text-align:">Customer</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td id="order-by" style="width:33%; text-align:"></td>
|
||||
<td id="order-at" style="width:33%; text-align:"></td>
|
||||
<!-- <td id="order-customer" style="width:33%; text-align:"></td> -->
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong class="hidden cus_name">Customer</strong></td>
|
||||
<td id="order-customer" colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" id="order-detail-slimscroll" style="min-height:; max-height:; overflow:">
|
||||
<table class="table" id="oqs-order-details-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:80%; text-align:left">Items</th>
|
||||
<th style="width:20%; text-align:right">QTY</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Bind With JS -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">ORDER DETAILS</strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
<table class="">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:33%; text-align:">Order By</th>
|
||||
<th style="width:33%; text-align:">Order At</th>
|
||||
<!-- <th style="width:33%; text-align:">Customer</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td id="order-by" style="width:33%; text-align:"></td>
|
||||
<td id="order-at" style="width:33%; text-align:"></td>
|
||||
<!-- <td id="order-customer" style="width:33%; text-align:"></td> -->
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong class="hidden cus_name">Customer</strong></td>
|
||||
<td id="order-customer" colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" id="order-detail-slimscroll" style="min-height:; max-height:; overflow:">
|
||||
<table class="table" id="oqs-order-details-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:80%; text-align:left">Items</th>
|
||||
<th style="width:20%; text-align:right">QTY</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Bind With JS -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three--->
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- OQS Buttons -->
|
||||
<button type="button" title="Print Order Item" id="print_order_item" class="btn bg-blue btn-block btn-lg waves-effect">Print</a>
|
||||
<button type="button" class="btn bg-blue btn-block btn-lg waves-effect" id="print_order_summary">Print <br/>Order<br/>Summary</button>
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons m-t--10">reply</i>
|
||||
Back
|
||||
</button>
|
||||
<button type="button" title="Print Order Item" id="print_order_item" class="btn bg-blue btn-block btn-lg waves-effect">Print</button>
|
||||
<button type="button" class="btn bg-blue btn-block btn-lg waves-effect" id="print_order_summary">Print <br/>Order<br/>Summary</button>
|
||||
<!-- <a href="<%= dashboard_path %>" class="btn bg-blue btn-block btn-lg waves-effect" role="button" aria-haspopup="true"> Back </a> -->
|
||||
<!-- <button type="button" class="" id="print_order_summary">Print <br/>Order<br/>Summary</button> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$(".nav-completed").on("click", function(){
|
||||
$("#completed").removeClass('hide')
|
||||
$(".oqs_append").addClass('hide')
|
||||
});
|
||||
|
||||
$(".oqs_click").on("click", function(){
|
||||
$(".oqs_click").removeClass('oqs_active');
|
||||
$(".queue_station").removeClass('queue_station_box');
|
||||
$("#completed").addClass('hide');
|
||||
$(".oqs_append").removeClass('hide');
|
||||
$(this).addClass('oqs_active');
|
||||
$(".queue_station").addClass('queue_station_box');
|
||||
var oqs_id = $(this).find(".oqs-id").text();
|
||||
var url = 'oqs/get_items/'+oqs_id;
|
||||
|
||||
show_details(url);
|
||||
|
||||
}); //End Click
|
||||
|
||||
function show_details(url){
|
||||
var oqs_append = $('.oqs_append');
|
||||
oqs_append.empty();
|
||||
var filter = $('.filter').text();
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {'filter':filter},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
for(var field in data) {
|
||||
var price = parseFloat(data[field].price).toFixed(2);
|
||||
|
||||
if (data[field]["options"] == "[]" || data[field]["options"] == "") {
|
||||
var options = "";
|
||||
}else{
|
||||
var options = data.options;
|
||||
}
|
||||
|
||||
var date = new Date(data[field]["created_at"]);
|
||||
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||
|
||||
row ='<div class="card queue_station animated " data-date="'+data[field]["order_id"]+'">'
|
||||
+'<div class="card-block">'
|
||||
+'<h6 class="card-">'
|
||||
+'<span class="order-zone-type">'+data[field]["table_type"]+'- </span>'
|
||||
+'<span class="order-zone">'+ data[field]["zone"] +'</span>'
|
||||
+'<small class="float-right">'+ data[field]["order_id"] +'</small>'
|
||||
+'</h6>'
|
||||
|
||||
+'<h6>'
|
||||
+'<span class="order-item">'+ data[field]["item_name"] +'- </span>'
|
||||
+'<span class="order-qty">'+ data[field]["qty"] +' </span>'
|
||||
+'</h6>'
|
||||
|
||||
+'<p class="card-text item-options">'+ options +'</p>'
|
||||
|
||||
+'<p class="card-text">'
|
||||
+'<small class="text-muted">Order at'
|
||||
+'<span class="order-at">'+ show_date +'</span> - '
|
||||
|
||||
+'<span class="order-by">'+ data[field]["item_order_by"] +'</span> '
|
||||
+'</small> '
|
||||
+'</p>'
|
||||
|
||||
+'<p class="hidden order-customer">'+ data[field]["customer_name"] +'</p> '
|
||||
+'<p class="hidden assigned-order-item">'+ data[field]["assigned_order_item_id"] +'</p> '
|
||||
+'</div>'
|
||||
|
||||
+'<div class="card-footer">'
|
||||
+'<button id="edit_'+ data[field]["assigned_order_item_id"]+'" class="btn btn-warning order-item order-item-edit">EDIT</button>'
|
||||
+' <button id="assigned_queue_' + data[field]["assigned_order_item_id"] +'" class="btn btn-primary order-item order-complete">COMPLETE</button>'
|
||||
+'</div>'
|
||||
|
||||
+'</div>';
|
||||
|
||||
|
||||
|
||||
$('.oqs_append').append(row);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
//end Ajax
|
||||
|
||||
}
|
||||
|
||||
$(document).on('click', '.queue_station', function(event){
|
||||
var orderZone=$(this).children().children().children('.order-zone').text().trim();
|
||||
// var orderItem=$(this).children().children().children('.order-item').text();
|
||||
var assigned_item_id = $(this).children().find(".assigned-order-item").text();
|
||||
var orderQty = $(this).children().children().children('.order-qty').text();
|
||||
var orderBy = $(this).children().children().children().children('.order-by').text();
|
||||
var orderAt = $(this).children().children().children().children('.order-at').text();
|
||||
var orderCustomer = $(this).children().children('.order-customer').text();
|
||||
var order_status = $(this).children().children('.order-status').text();
|
||||
|
||||
$('#order-title').text("ORDER DETAILS - " + orderZone);
|
||||
$('#order-by').text(orderBy);
|
||||
$('#order-at').text(orderAt);
|
||||
$('#order-customer').text(orderCustomer);
|
||||
$('#order-from').text(orderZone);
|
||||
// clear order items
|
||||
$("#oqs-order-details-table").children("tbody").empty();
|
||||
// Call get_order_items() for Order Items by dining
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/' + orderZone,
|
||||
data: { 'status' : order_status },
|
||||
success: function(res){
|
||||
for (i = 0; i < res.length; i++) {
|
||||
var data = JSON.stringify(res[i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
|
||||
var order_item_row = "<tr>" +
|
||||
"<td class='order-items' style='width:80%; text-align:left'>" + parse_data.item_name + "</td>" +
|
||||
"<td class='order-qty' style='width:20%; text-align:right'>" + parse_data.qty + "</td>" +
|
||||
"</tr>";
|
||||
$("#oqs-order-details-table").children("tbody").append(order_item_row);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// $('#order-items').text(orderItem);
|
||||
// $('#order-qty').text(orderQty);
|
||||
|
||||
$('.queue_station').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
});
|
||||
|
||||
$(document).on('click', '.order-item-edit', function(event){
|
||||
var _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(5);
|
||||
window.location.href = '/oqs/'+ assigned_item_id + "/edit"
|
||||
});
|
||||
|
||||
// complete for queue item
|
||||
|
||||
$(document).on('click', '.order-complete', function(event){
|
||||
//e.preventDefault();
|
||||
var _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(15);
|
||||
var params = { 'id':assigned_item_id };
|
||||
|
||||
// Call update_delivery_status() for changed delivery and move to delivery
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/oqs/update_delivery',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
for (i = 0; i < data.length; i++) {
|
||||
var queue_station = $('#assigned_queue_' + data[i]).parent().parent(".queue_station");
|
||||
var station = queue_station.parent().parent().attr('id');
|
||||
|
||||
// Remove a queue card from current station
|
||||
queue_station.remove();
|
||||
|
||||
// Remove a queue card from current station
|
||||
queue_station.children('.card-footer').remove();
|
||||
|
||||
// Add removed queue card from station to completed
|
||||
$("#completed").children('.card-columns').append(queue_station);
|
||||
|
||||
// update queue item count in each station
|
||||
var station_count=parseInt($("#"+station+"_count").text()) - 1;
|
||||
$("#"+station+"_count").text(station_count);
|
||||
}
|
||||
|
||||
// update queue item count in completed station
|
||||
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
||||
|
||||
alert("updated!");
|
||||
// Page reload
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Item
|
||||
$(document).on('click', '#print_order_item', function(event){
|
||||
var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var options = $('.selected-item').children('.card-block').find('.item-options').text();
|
||||
var params = { 'options':options };
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print/'+assigned_item_id,
|
||||
success: function(data){ }
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Summary
|
||||
// $('#print_order_summary').on('click',function(){
|
||||
$(document).on('click', '#print_order_summary', function(event){
|
||||
var table_name=$('.selected-item').children().children().children('.order-zone').text().trim();
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'table_name':table_name };
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
||||
data: params,
|
||||
success: function(data){ }
|
||||
});
|
||||
});
|
||||
|
||||
// Qty update for OQS Edit Controller
|
||||
$('#qty-update').on('click', function(){
|
||||
var qty_weight = $("input[name='qty_weight']").val();
|
||||
var remarks = $("textarea[name='remarks']").val();
|
||||
var order_items_id = $(this).attr('data-id');
|
||||
var params = { 'order_items_id': order_items_id, 'qty_weight': qty_weight, 'remarks': remarks }
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/oqs/' + order_items_id,
|
||||
data: params,
|
||||
success: function(result){
|
||||
alert("Updated!");
|
||||
window.location.href = '/oqs';
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$('#back').on('click', function () {
|
||||
window.location.href = '/dashboard';
|
||||
});
|
||||
});
|
||||
});
|
||||
</script> -->
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
||||
<div id="loading_wrapper" style="display:none;">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
<div id="oqs_loading"></div>
|
||||
</div>
|
||||
|
||||
<div class="row m-t--20">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<ul class="nav nav-tabs flex-column" role="tablist" >
|
||||
|
||||
@@ -424,9 +424,11 @@
|
||||
|
||||
// Selected Items
|
||||
var sale_items = get_selected_sale_items();
|
||||
console.log(sale_items.length);
|
||||
if(sale_items.length == 0){
|
||||
//swal("Information!", "You have no selected item!");
|
||||
swal ( "Oops" , "You have no selected item!" , "error" );
|
||||
swal ( "Oops" , "You have no selected item!" , "error" );
|
||||
return;
|
||||
}
|
||||
|
||||
for(var i=0;i < sale_items.length;i++){
|
||||
@@ -434,7 +436,8 @@
|
||||
discount_items.push(sale_items[i]);
|
||||
}
|
||||
else {
|
||||
swal ("Oops" , "You have no selected item!" , "error" );
|
||||
swal ("Oops" , "You have no selected item!" , "error" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="card sales red text-white" data-id="<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<span class="pull-right font-12"><%= sale.sale_status %></span>
|
||||
<span class="float-right font-12"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<span class="pull-right font-12 new_text_<%= table.id %>"> billed</span>
|
||||
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span>
|
||||
<div style="font-size:12px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<span class="pull-right font-12 new_text_<%= table.id %>"> new</span>
|
||||
<span class="float-right font-12 new_text_<%= table.id %>"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -63,7 +63,7 @@
|
||||
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
<span class="pull-right font-12 new_text_<%= table.id %> hide"> new</span>
|
||||
<span class="float-right font-12 new_text_<%= table.id %> hide"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -81,9 +81,9 @@
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<% if room.get_booking.nil? %>
|
||||
<span class="pull-right font-12 new_text_<%= room.id %>"> billed</span>
|
||||
<span class="float-right font-12 new_text_<%= room.id %>"> billed</span>
|
||||
<% else %>
|
||||
<span class="pull-right font-12 new_text_<%= room.id %>"> new</span>
|
||||
<span class="float-right font-12 new_text_<%= room.id %>"> new</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -91,7 +91,7 @@
|
||||
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<span class="pull-right font-12 new_text_<%= room.id %> hide">
|
||||
<span class="float-right font-12 new_text_<%= room.id %> hide">
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -134,6 +134,8 @@
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
@@ -154,7 +156,16 @@
|
||||
<br>
|
||||
</div>
|
||||
<% elsif !@date.nil? %>
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 text-right">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
Order No: <span id="order_no">
|
||||
<% if @status_order == 'order' %>
|
||||
<%= @obj_order.order_id rescue '' %>
|
||||
|
||||
<% end %>
|
||||
</span>
|
||||
<br>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></span>
|
||||
<br>
|
||||
</div>
|
||||
@@ -162,15 +173,16 @@
|
||||
</div>
|
||||
<div class="row p-l-5 p-r-5">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<% if !@sale_array.empty? %>
|
||||
|
||||
<% if @status_sale == 'sale' %>
|
||||
<p class="hidden customer-id"><%= @sale_array[0].customer_id rescue '' %></p>
|
||||
Customer : <%= @sale_array[0].customer.name rescue '' %>
|
||||
<% else %>
|
||||
<% elsif @status_order == 'order'
|
||||
%>
|
||||
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
|
||||
Customer : <%= @customer.name rescue "" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -350,7 +362,7 @@
|
||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||
<% if @dining.status != "available" %>
|
||||
<% if @status_order == 'order' %>
|
||||
<!-- <button type="button" id="customer" class="btn btn-block bg-blue waves-effect" disabled>Customer</button> -->
|
||||
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
||||
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" disabled>Edit</button> -->
|
||||
<!-- <button type="button" id="discount" class="btn btn-block bg-blue waves-effect" disabled>Discount</button> -->
|
||||
<!-- <button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect" disabled>Charges</button> -->
|
||||
|
||||
@@ -2,6 +2,7 @@ class DiningQueues < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :dining_queues do |t|
|
||||
t.string :name
|
||||
t.string :customer_id, :default => "CUS-000000000001"
|
||||
t.string :contact_no
|
||||
t.string :queue_no
|
||||
t.string :status
|
||||
|
||||
42
db/seeds.rb
42
db/seeds.rb
@@ -181,44 +181,6 @@ queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf
|
||||
cashier_terminal = CashierTerminal.create({name:"Terminal 1", printer_name: "Cashier"})
|
||||
|
||||
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"61", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"62", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"53", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"54", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"24", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"25", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"26", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"34", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"35", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"45", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"46", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"47", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"48", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
|
||||
zone2 = Zone.create({id:2, name: "H2", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"51", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"52", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"11", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"12", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"21", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"22", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"23", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"31", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"32", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"33", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"41", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"42", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"43", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"44", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"71", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"72", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"73", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"74", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"75", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"76", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"77", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"78", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
|
||||
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"})
|
||||
|
||||
@@ -248,7 +210,7 @@ zone_order_queue_station = OrderQueueStation.create({station_name: "K3", is_acti
|
||||
|
||||
# QueueStationZone
|
||||
zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station1, zone: zone})
|
||||
zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone2})
|
||||
zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone3})
|
||||
zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone})
|
||||
zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone})
|
||||
|
||||
puts " Finished System Default Set Up Data vWSsseoZCzxd6xcNf_uS RxzaYyAGzm7VqAZ4hKnv "
|
||||
|
||||
Reference in New Issue
Block a user