fixed
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -41,3 +41,7 @@ config/deploy/config/*
|
||||
|
||||
# Ignore Byebug command history file.
|
||||
.byebug_history
|
||||
|
||||
# Gem files
|
||||
#Gemfile
|
||||
#Gemfile.lock
|
||||
|
||||
10
Gemfile
10
Gemfile
@@ -9,8 +9,14 @@ end
|
||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||
gem 'rails', '~> 5.1.0'
|
||||
# Use mysql as the database for Active Record
|
||||
#gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||
|
||||
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||
|
||||
gem 'pg'
|
||||
|
||||
# redis server for cable
|
||||
# gem 'redis', '~> 3.0'
|
||||
|
||||
# Use Puma as the app server
|
||||
gem 'puma', '~> 3.0'
|
||||
# Use SCSS for stylesheets
|
||||
@@ -37,6 +43,8 @@ gem 'to_xls-rails'
|
||||
#Reporting gem
|
||||
#gem 'compendium'
|
||||
|
||||
# Pagination
|
||||
gem 'kaminari', :git => "git://github.com/amatsuda/kaminari.git", :branch => 'master'
|
||||
|
||||
# Use jquery as the JavaScript library
|
||||
gem 'jquery-rails'
|
||||
|
||||
12
Gemfile.lock
12
Gemfile.lock
@@ -1,6 +1,6 @@
|
||||
GIT
|
||||
remote: git://github.com/amatsuda/kaminari.git
|
||||
revision: bc52ae73d41386d344b5d1b18e689e5a988f1a03
|
||||
revision: c3c853a944cd2bff072ae05e48c563b2c9a29597
|
||||
branch: master
|
||||
specs:
|
||||
kaminari (1.0.1)
|
||||
@@ -66,9 +66,9 @@ GEM
|
||||
sass (>= 3.4.19)
|
||||
builder (3.2.3)
|
||||
byebug (9.0.6)
|
||||
coffee-rails (4.2.1)
|
||||
coffee-rails (4.2.2)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0, < 5.2.x)
|
||||
railties (>= 4.0.0)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
@@ -114,7 +114,8 @@ GEM
|
||||
mini_portile2 (2.1.0)
|
||||
minitest (5.10.2)
|
||||
multi_json (1.12.1)
|
||||
nio4r (2.0.0)
|
||||
mysql2 (0.4.6)
|
||||
nio4r (2.1.0)
|
||||
nokogiri (1.7.2)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
pdf-core (0.7.0)
|
||||
@@ -251,6 +252,7 @@ DEPENDENCIES
|
||||
jquery-rails
|
||||
kaminari!
|
||||
listen (~> 3.0.5)
|
||||
mysql2 (>= 0.3.18, < 0.5)
|
||||
pg
|
||||
prawn
|
||||
prawn-table
|
||||
@@ -274,4 +276,4 @@ DEPENDENCIES
|
||||
web-console (>= 3.3.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.14.6
|
||||
1.15.0
|
||||
|
||||
@@ -15,3 +15,69 @@
|
||||
//= require jquery_ujs
|
||||
//= require turbolinks
|
||||
//= require cable
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.queue_station').on('click',function(){
|
||||
var orderZone=$(this).children().children().children('.order-zone').text();
|
||||
var orderItem=$(this).children().children().children('.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();
|
||||
|
||||
$('#order-title').text("ORDER DETAILS - " + orderZone);
|
||||
$('#order-by').text(orderBy);
|
||||
$('#order-at').text(orderAt);
|
||||
$('#order-customer').text(orderCustomer);
|
||||
$('#order-from').text(orderZone);
|
||||
|
||||
$('#order-items').text(orderItem);
|
||||
$('#order-qty').text(orderQty);
|
||||
|
||||
$('.queue_station').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
});
|
||||
|
||||
// complete for queue item
|
||||
$('.order-complete').on('click',function(){
|
||||
var _self= $(this);
|
||||
var assigned_item_id=$(this).attr('id').substr(15);
|
||||
var params = { 'id':assigned_item_id };
|
||||
var station=$(this).parent().parent(".queue_station").parent().parent().attr('id');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/oqs/update_delivery',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
var queue_station=_self.parent().parent(".queue_station");
|
||||
|
||||
// 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 station
|
||||
$("#"+station+"_count").text(parseInt($("#"+station+"_count").text())-1);
|
||||
$("#completed_count").text(parseInt($("#completed_count").text())+1);
|
||||
|
||||
alert("updated!");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#print_order_item').on('click',function(){
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'id':assigned_item_id };
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print/'+assigned_item_id,
|
||||
success: function(data){ }
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Action Cable provides the framework to deal with WebSockets in Rails.
|
||||
// You can generate new channels where WebSocket features live using the rails generate channel command.
|
||||
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
||||
//
|
||||
//= require action_cable
|
||||
//= require_self
|
||||
|
||||
24
app/assets/javascripts/channels/order_queue_station.js
Normal file
24
app/assets/javascripts/channels/order_queue_station.js
Normal file
@@ -0,0 +1,24 @@
|
||||
App.order_queue_station = App.cable.subscriptions.create("OrderQueueStationChannel", {
|
||||
connected: function() {},
|
||||
|
||||
disconnected: function() {},
|
||||
|
||||
received: function(message) {
|
||||
alert(message);
|
||||
},
|
||||
|
||||
order: function(message) {
|
||||
return this.perform('order', {
|
||||
message: message
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// $(function(){
|
||||
// $("#submit_order").on('click', function(event) {
|
||||
// var orderData=$("#new_order").serializeObject();
|
||||
// App.order_station.order(orderData);
|
||||
// //orderData='';
|
||||
// return event.preventDefault();
|
||||
// });
|
||||
// });
|
||||
3
app/assets/javascripts/origami/request_bills.coffee
Normal file
3
app/assets/javascripts/origami/request_bills.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
3
app/assets/javascripts/print_settings.coffee
Normal file
3
app/assets/javascripts/print_settings.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
3
app/assets/javascripts/transactions/sales.coffee
Normal file
3
app/assets/javascripts/transactions/sales.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -14,3 +14,7 @@
|
||||
.order-void {
|
||||
background-color: #FFCCDD;
|
||||
}
|
||||
|
||||
.selected-item {
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,29 @@
|
||||
// padding-top: 4.5rem;
|
||||
// }
|
||||
|
||||
.setting_nav{
|
||||
background-color: #2f5663;
|
||||
}
|
||||
|
||||
ul.navbar-nav li a{
|
||||
text-decoration :none;
|
||||
color :#e6e6e6;
|
||||
}
|
||||
|
||||
ul.dropdown-menu li a{
|
||||
text-decoration :none;
|
||||
color :#525252;
|
||||
}
|
||||
|
||||
.setting_breadcrumb{
|
||||
background-color: transparent !important;
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
.page-header{
|
||||
border-bottom :0px solid #000 !important;
|
||||
margin :0px !important;
|
||||
}
|
||||
|
||||
/*----- Order Processing Items -----*/
|
||||
.opi_ul {
|
||||
display:block;
|
||||
@@ -33,4 +56,4 @@
|
||||
|
||||
/*----- Header Bar -----*/
|
||||
|
||||
/*----- Header Bar -----*/
|
||||
/*----- Header Bar -----*/
|
||||
|
||||
3
app/assets/stylesheets/origami/request_bills.scss
Normal file
3
app/assets/stylesheets/origami/request_bills.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the origami/RequestBills controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/print_settings.scss
Normal file
3
app/assets/stylesheets/print_settings.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the print_settings controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -0,0 +1,84 @@
|
||||
body {
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
margin: 33px;
|
||||
font-family: verdana, arial, helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
p, ol, ul, td {
|
||||
font-family: verdana, arial, helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #eee;
|
||||
padding: 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #000;
|
||||
|
||||
&:visited {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: #fff;
|
||||
background-color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
th {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 0 5px 7px;
|
||||
}
|
||||
|
||||
div {
|
||||
&.field, &.actions {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
#notice {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.field_with_errors {
|
||||
padding: 2px;
|
||||
background-color: red;
|
||||
display: table;
|
||||
}
|
||||
|
||||
#error_explanation {
|
||||
width: 450px;
|
||||
border: 2px solid red;
|
||||
padding: 7px 7px 0;
|
||||
margin-bottom: 20px;
|
||||
background-color: #f0f0f0;
|
||||
|
||||
h2 {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
padding: 5px 5px 5px 15px;
|
||||
font-size: 12px;
|
||||
margin: -7px -7px 0;
|
||||
background-color: #c00;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
ul li {
|
||||
font-size: 12px;
|
||||
list-style: square;
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
3
app/assets/stylesheets/transactions/sales.scss
Normal file
3
app/assets/stylesheets/transactions/sales.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the transactions/Sales controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
@@ -1,4 +1,14 @@
|
||||
module ApplicationCable
|
||||
class Channel < ActionCable::Channel::Base
|
||||
end
|
||||
class Channel < ActionCable::Channel::Base
|
||||
end
|
||||
# Order Queue Station Channel
|
||||
class OrderChannel < ActionCable::Channel::Base
|
||||
|
||||
end
|
||||
|
||||
# Order Queue Station Channel
|
||||
class OQSChannel < ActionCable::Channel::Base
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
13
app/channels/order_queue_station_channel.rb
Normal file
13
app/channels/order_queue_station_channel.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class OrderQueueStationChannel < ApplicationCable::Channel
|
||||
def subscribed
|
||||
stream_from "order_queue_station_channel"
|
||||
end
|
||||
|
||||
def unsubscribed
|
||||
# Any cleanup needed when channel is unsubscribed
|
||||
end
|
||||
|
||||
def order(message)
|
||||
# ToDo
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,5 @@
|
||||
class Api::BookingsController < Api::ApiController
|
||||
|
||||
|
||||
skip_before_action :authenticate
|
||||
#Show customer by ID
|
||||
def index
|
||||
@customer = Customer.find_by(params[:id])
|
||||
|
||||
@@ -7,7 +7,10 @@ class Api::OrdersController < Api::ApiController
|
||||
order = Order.find(params[:order_id])
|
||||
order.order_items
|
||||
end
|
||||
|
||||
def get_order
|
||||
order = Order.find(params[:order_id])
|
||||
order.order_items
|
||||
end
|
||||
|
||||
# Description
|
||||
# This API allow new order creation
|
||||
@@ -36,7 +39,8 @@ class Api::OrdersController < Api::ApiController
|
||||
|
||||
#Create Table Booking or Room Booking
|
||||
if !params["booking_id"].nil? && params[:booking_id].to_i > 0
|
||||
@order.new_booking = false
|
||||
#@order.new_booking = false
|
||||
@order.new_booking = true
|
||||
@order.booking_id = params[:booking_id]
|
||||
end
|
||||
|
||||
|
||||
18
app/controllers/crm/bookings_controller.rb
Normal file
18
app/controllers/crm/bookings_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class Crm::BookingsController < ApplicationController
|
||||
|
||||
def update_booking
|
||||
booking = Booking.find(params[:booking_id])
|
||||
|
||||
|
||||
status = booking.update_attributes(booking_status: params[:type])
|
||||
|
||||
if status == true
|
||||
render json: JSON.generate({:status => true ,:type => params[:type]})
|
||||
|
||||
else
|
||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,5 +1,23 @@
|
||||
class Crm::HomeController < BaseCrmController
|
||||
def index
|
||||
|
||||
@booking = Booking.all
|
||||
@customer = Customer.all
|
||||
|
||||
#@booking = Booking.select("bookings.id as booking_id,
|
||||
# bookings.checkin_at,
|
||||
# bookings.checkin_by,
|
||||
# bookings.dining_facility_id,
|
||||
# od.customer_id as customer,
|
||||
# od.id as order_id,
|
||||
# od.item_count as count,
|
||||
# odt.id as order_item_id,
|
||||
# odt.item_name as item_name")
|
||||
# .joins("join booking_orders as bko ON bko.booking_id = bookings.id")
|
||||
# .joins("right join orders as od ON od.id = bko.order_id")
|
||||
# .joins("right join order_items as odt ON odt.order_id=od.id")
|
||||
# .order("bookings.id DESC")
|
||||
|
||||
end
|
||||
def show
|
||||
end
|
||||
|
||||
@@ -1,6 +1,50 @@
|
||||
class Oqs::HomeController < BaseOqsController
|
||||
def index
|
||||
queue_stations=OrderQueueStation.all
|
||||
|
||||
@queue_items_details = queue_items_query(0)
|
||||
|
||||
@queue_completed_item = queue_items_query(1)
|
||||
|
||||
@queue_stations_items=Array.new
|
||||
|
||||
# Calculate Count for each station tab
|
||||
queue_stations.each do |que|
|
||||
i=0
|
||||
@queue_items_details.each do |qid|
|
||||
if qid.station_name == que.station_name
|
||||
i=i+1
|
||||
end
|
||||
end
|
||||
@queue_stations_items.push({:station_name => que.station_name, :is_active => que.is_active ,:item_count => i })
|
||||
end
|
||||
|
||||
@queue_stations_items
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
# update delivery status when complete click
|
||||
def update_delivery_status
|
||||
assigned_item_id = params[:id]
|
||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_item.delivery_status=true
|
||||
assigned_item.save
|
||||
end
|
||||
|
||||
# Query for OQS with status
|
||||
def queue_items_query(status)
|
||||
AssignedOrderItem.select("assigned_order_items.id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
||||
.joins("join order_queue_process_by_zones as oqpz ON oqpz.order_queue_station_id = assigned_order_items.order_queue_station_id
|
||||
left join dining_facilities as df on df.zone_id = oqpz.zone_id
|
||||
left join order_queue_stations as oqs ON oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join orders as od ON od.id = assigned_order_items.order_id
|
||||
left join order_items as odt ON odt.item_code = assigned_order_items.item_code
|
||||
left join customers as cus ON cus.id = od.customer_id")
|
||||
.where("assigned_order_items.delivery_status = #{status}")
|
||||
.group("assigned_order_items.id")
|
||||
.order("odt.item_name DESC")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
16
app/controllers/oqs/print_controller.rb
Normal file
16
app/controllers/oqs/print_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class Oqs::PrintController < ApplicationController
|
||||
def print
|
||||
unique_code="OrderItemPdf"
|
||||
assigned_item_id=params[:id]
|
||||
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where('id='+assigned_item_id)
|
||||
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||
order_queue_printer.print_order_item(print_settings,assigned_order_item[0].order_id, assigned_order_item[0].item_code )
|
||||
|
||||
# update print status when complete click
|
||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_item.print_status=true
|
||||
assigned_item.save
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,15 @@
|
||||
class Origami::HomeController < BaseOrigamiController
|
||||
def index
|
||||
@order_table = Order.get_order_table()
|
||||
@order_rooms = Order.get_order_rooms()
|
||||
@orders = Order.get_orders()
|
||||
end
|
||||
def show
|
||||
str = []
|
||||
@order_details = OrderItem.get_order_items_details(params[:order_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
render :json => str.to_json
|
||||
end
|
||||
end
|
||||
|
||||
22
app/controllers/origami/request_bills_controller.rb
Normal file
22
app/controllers/origami/request_bills_controller.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class Origami::RequestBillsController < BaseOrigamiController
|
||||
def show
|
||||
@sale = Sale.new
|
||||
|
||||
check_order = Order.find_by_id(params[:id])
|
||||
if check_order
|
||||
@order_details = OrderItem.get_order_items_details(check_order.id)
|
||||
@order_details = OrderItem.get_order_items_details(check_order.id)
|
||||
@status, @sale_id = @sale.generate_invoice_from_order(check_order.id, nil,current_login_employee.name)
|
||||
@sale_data = Sale.find_by_id(@sale_id)
|
||||
@sale_items = SaleItem.where("sale_id=?",@sale_id)
|
||||
end
|
||||
unique_code="ReceiptBillPdf"
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
printer.print_receipt_bill(print_settings,@sale_items,@sale)
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
74
app/controllers/print_settings_controller.rb
Normal file
74
app/controllers/print_settings_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class PrintSettingsController < ApplicationController
|
||||
before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /print_settings
|
||||
# GET /print_settings.json
|
||||
def index
|
||||
@print_settings = PrintSetting.all
|
||||
end
|
||||
|
||||
# GET /print_settings/1
|
||||
# GET /print_settings/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /print_settings/new
|
||||
def new
|
||||
@print_setting = PrintSetting.new
|
||||
end
|
||||
|
||||
# GET /print_settings/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /print_settings
|
||||
# POST /print_settings.json
|
||||
def create
|
||||
@print_setting = PrintSetting.new(print_setting_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @print_setting.save
|
||||
format.html { redirect_to @print_setting, notice: 'Print setting was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @print_setting }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @print_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /print_settings/1
|
||||
# PATCH/PUT /print_settings/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @print_setting.update(print_setting_params)
|
||||
format.html { redirect_to @print_setting, notice: 'Print setting was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @print_setting }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @print_setting.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /print_settings/1
|
||||
# DELETE /print_settings/1.json
|
||||
def destroy
|
||||
@print_setting.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to print_settings_url, notice: 'Print setting was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_print_setting
|
||||
@print_setting = PrintSetting.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def print_setting_params
|
||||
params.require(:print_setting).permit(:name, :unique_code, :template, :db_name, :db_type, :db_username, :db_password, :printer_name, :api_settings, :page_width, :page_height, :print_copies)
|
||||
end
|
||||
end
|
||||
73
app/controllers/settings/accounts_controller.rb
Normal file
73
app/controllers/settings/accounts_controller.rb
Normal file
@@ -0,0 +1,73 @@
|
||||
class Settings::AccountsController < ApplicationController
|
||||
before_action :set_account, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/accounts
|
||||
# GET /settings/accounts.json
|
||||
def index
|
||||
@settings_accounts = Account.all
|
||||
end
|
||||
|
||||
# GET /settings/accounts/1
|
||||
# GET /settings/accounts/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /settings/accounts/new
|
||||
def new
|
||||
@settings_account = Account.new
|
||||
end
|
||||
|
||||
# GET /settings/accounts/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/accounts
|
||||
# POST /settings/accounts.json
|
||||
def create
|
||||
@settings_account = Account.new(account_params)
|
||||
respond_to do |format|
|
||||
if @settings_account.save!
|
||||
format.html { redirect_to settings_accounts_url, notice: 'Account was successfully created.' }
|
||||
format.json { render :index, status: :created, location: @settings_account }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: settings_accounts_url.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/accounts/1
|
||||
# PATCH/PUT /settings/accounts/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_account.update(account_params)
|
||||
format.html { redirect_to settings_accounts_url, notice: 'Account was successfully updated.' }
|
||||
format.json { render :index, status: :ok, location: @settings_account }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: settings_accounts_url.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/accounts/1
|
||||
# DELETE /settings/accounts/1.json
|
||||
def destroy
|
||||
@settings_account.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_accounts_url, notice: 'Account was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_account
|
||||
@settings_account = Account.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def account_params
|
||||
params.require(:account).permit(:title, :account_type)
|
||||
end
|
||||
end
|
||||
@@ -109,6 +109,8 @@ class Settings::MenuItemInstancesController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_menu_item_instance_params
|
||||
|
||||
params.require(:menu_item_instance).permit(:item_instance_code, :item_instance_name, :price, :item_attributes, :is_on_promotion, :promotion_price, :is_available,:menu_category_id,:menu_item_id)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,12 +6,14 @@ class Settings::SetMenuItemsController < ApplicationController
|
||||
def index
|
||||
@settings_menu_items = @category.menu_items.page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
|
||||
# GET /settings/menu_items/1
|
||||
# GET /settings/menu_items/1.json
|
||||
def show
|
||||
@sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10)
|
||||
|
||||
@menu_item_instance = MenuItemInstance.where("menu_item_id=?",params[:id]).page(params[:page]).per(10)
|
||||
|
||||
end
|
||||
|
||||
# GET /settings/menu_items/new
|
||||
|
||||
@@ -6,7 +6,7 @@ class Settings::SimpleMenuItemsController < ApplicationController
|
||||
def index
|
||||
@settings_menu_items = @category.menu_items.page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
|
||||
# GET /settings/menu_items/1
|
||||
# GET /settings/menu_items/1.json
|
||||
def show
|
||||
|
||||
74
app/controllers/transactions/sales_controller.rb
Normal file
74
app/controllers/transactions/sales_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class Transactions::SalesController < ApplicationController
|
||||
before_action :set_transactions_sale, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /transactions/sales
|
||||
# GET /transactions/sales.json
|
||||
def index
|
||||
@transactions_sales = Sale.all
|
||||
end
|
||||
|
||||
# GET /transactions/sales/1
|
||||
# GET /transactions/sales/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /transactions/sales/new
|
||||
def new
|
||||
@transactions_sale = Sale.new
|
||||
end
|
||||
|
||||
# GET /transactions/sales/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /transactions/sales
|
||||
# POST /transactions/sales.json
|
||||
def create
|
||||
@transactions_sale = Sale.new(transactions_sale_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @transactions_sale.save
|
||||
format.html { redirect_to @transactions_sale, notice: 'Sale was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @transactions_sale }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: @transactions_sale.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /transactions/sales/1
|
||||
# PATCH/PUT /transactions/sales/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @transactions_sale.update(transactions_sale_params)
|
||||
format.html { redirect_to @transactions_sale, notice: 'Sale was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @transactions_sale }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @transactions_sale.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /transactions/sales/1
|
||||
# DELETE /transactions/sales/1.json
|
||||
def destroy
|
||||
@transactions_sale.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to transactions_sales_url, notice: 'Sale was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_transactions_sale
|
||||
@transactions_sale = Sale.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def transactions_sale_params
|
||||
params.require(:transactions_sale).permit(:cashier_id, :cashier_name, :requested_by, :requested_at, :receipt_no, :receipt_date, :customer_id, :payment_status, :sale_status, :total_amount, :total_discount, :total_tax, :tax_type, :grand_total, :rounding_adjustment, :amount_received, :amount_changed)
|
||||
end
|
||||
end
|
||||
7
app/forms/shop_form.rb
Normal file
7
app/forms/shop_form.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
#Form object to use during the installation process - will handle creation of shop model into db after verification from the cloud
|
||||
#provising service through license verification
|
||||
|
||||
class ShopForm < ActiveModel
|
||||
:attr_accessor :logo, :name, :address, :township, :city, :state, :country, :license, :base_currency, :password, :password_confirmation
|
||||
|
||||
end
|
||||
2
app/helpers/crm/bookings_helper.rb
Normal file
2
app/helpers/crm/bookings_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Crm::BookingsHelper
|
||||
end
|
||||
2
app/helpers/oqs/print_helper.rb
Normal file
2
app/helpers/oqs/print_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Oqs::PrintHelper
|
||||
end
|
||||
2
app/helpers/origami/request_bills_helper.rb
Normal file
2
app/helpers/origami/request_bills_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Origami::RequestBillsHelper
|
||||
end
|
||||
2
app/helpers/print_settings_helper.rb
Normal file
2
app/helpers/print_settings_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PrintSettingsHelper
|
||||
end
|
||||
2
app/helpers/settings/accounts_helper.rb
Normal file
2
app/helpers/settings/accounts_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Settings::AccountsHelper
|
||||
end
|
||||
2
app/helpers/transactions/sales_helper.rb
Normal file
2
app/helpers/transactions/sales_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Transactions::SalesHelper
|
||||
end
|
||||
9
app/jobs/order_broadcast_job.rb
Normal file
9
app/jobs/order_broadcast_job.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class OrderBroadcastJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(message)
|
||||
order = Order.find(message) # message come as order_id
|
||||
ApplicationCable.server.broadcast "order_queue_station_channel", order: order
|
||||
|
||||
end
|
||||
end
|
||||
@@ -3,8 +3,9 @@ class OrderQueueProcessorJob < ApplicationJob
|
||||
|
||||
def perform(order_id)
|
||||
# Do something later
|
||||
#Order ID
|
||||
#Order ID
|
||||
order = Order.find(order_id)
|
||||
|
||||
#Loop through the order stations and process the items
|
||||
#Execute orders and send to order stations
|
||||
if order
|
||||
|
||||
7
app/models/account.rb
Normal file
7
app/models/account.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Account < ApplicationRecord
|
||||
validates_presence_of :title, :account_type
|
||||
|
||||
has_many :menu_items
|
||||
# belongs_to :lookup , :class_name => "Lookup"
|
||||
|
||||
end
|
||||
@@ -1,5 +1,6 @@
|
||||
class Booking < ApplicationRecord
|
||||
|
||||
#primary key - need to be unique
|
||||
|
||||
belongs_to :dining_facility, :optional => true
|
||||
belongs_to :sale, :optional => true
|
||||
has_many :booking_orders
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class BookingOrder < ApplicationRecord
|
||||
#primary key - need to be unique
|
||||
|
||||
belongs_to :booking
|
||||
belongs_to :order
|
||||
end
|
||||
|
||||
5
app/models/crm.rb
Normal file
5
app/models/crm.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module Crm
|
||||
def self.table_name_prefix
|
||||
'crm_'
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,9 @@
|
||||
class DiningFacility < ApplicationRecord
|
||||
belongs_to :zone
|
||||
|
||||
TABLE_TYPE = "Table"
|
||||
ROOM_TYPE = "Room"
|
||||
|
||||
default_scope { order('order_by asc') }
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Lookup < ApplicationRecord
|
||||
|
||||
has_many :accounts
|
||||
|
||||
def available_types
|
||||
{'Employee Roles' => 'employee_roles',
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
class MenuItem < ApplicationRecord
|
||||
belongs_to :account
|
||||
belongs_to :menu_category, :optional => true
|
||||
has_many :menu_item_instances
|
||||
belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
|
||||
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
|
||||
validates_presence_of :item_code, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
|
||||
|
||||
validates_presence_of :item_code, :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
|
||||
|
||||
default_scope { order('item_code asc') }
|
||||
|
||||
scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') }
|
||||
scope :set_menu_item, -> { where(type: 'SetMenuItem') }
|
||||
|
||||
def self.collection
|
||||
MenuItem.select("id, name").map { |e| [e.name, e.id] }
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Order < ApplicationRecord
|
||||
#primary key - need to be unique
|
||||
|
||||
before_create :set_order_date
|
||||
|
||||
belongs_to :customer
|
||||
@@ -8,7 +10,6 @@ class Order < ApplicationRecord
|
||||
#internal references attributes for business logic control
|
||||
attr_accessor :items, :guest, :table_id, :new_booking, :booking_type, :employee_name, :booking_id
|
||||
|
||||
|
||||
#Main Controller method to create new order - validate all inputs and generate new order
|
||||
# order_item : {
|
||||
# order_item_code : "",
|
||||
@@ -17,13 +18,14 @@ class Order < ApplicationRecord
|
||||
# option_values : [],
|
||||
# sub_order_items : [],
|
||||
# }
|
||||
|
||||
def generate
|
||||
booking = nil
|
||||
|
||||
if self.new_booking
|
||||
booking = Booking.create({:dining_facility_id => self.table_id,:type => "TableBooking",
|
||||
:checkin_at => Time.now.utc, :checkin_by => self.employee_name,
|
||||
:booking_status => "new" })
|
||||
:booking_status => "assign" })
|
||||
else
|
||||
if (self.booking_id.to_i > 0 )
|
||||
booking = Booking.find(self.booking_id)
|
||||
@@ -43,6 +45,9 @@ class Order < ApplicationRecord
|
||||
#Send order to queue one it done!
|
||||
process_order_queue
|
||||
|
||||
#send order to broadcast job
|
||||
send_order_broadcast
|
||||
|
||||
return true, booking
|
||||
|
||||
end
|
||||
@@ -201,4 +206,50 @@ class Order < ApplicationRecord
|
||||
#Send to background job for processing
|
||||
OrderQueueProcessorJob.perform_later(self.id)
|
||||
end
|
||||
|
||||
|
||||
#send order items and send to order queue
|
||||
def send_order_broadcast
|
||||
#Send to background job for processing
|
||||
OrderBroadcastJob.perform_later(self.id)
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view order type Table
|
||||
def self.get_order_table
|
||||
order_table = Order.select("orders.id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
||||
order_items.id as order_items_id,dining_facilities.name as table_name")
|
||||
.joins("left join booking_orders on booking_orders.order_id = orders.id
|
||||
left join bookings on bookings.id = booking_orders.id
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.id")
|
||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
|
||||
|
||||
.group("orders.id")
|
||||
|
||||
end
|
||||
#Origami: Cashier : to view order type Room
|
||||
def self.get_order_rooms
|
||||
order_rooms = Order.select("orders.id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
||||
order_items.id as order_items_id,dining_facilities.name as room_name")
|
||||
.joins("left join booking_orders on booking_orders.order_id = orders.id
|
||||
left join bookings on bookings.id = booking_orders.id
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.id")
|
||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,"dine_in",true)
|
||||
.group("orders.id,order_items.id,dining_facilities.name")
|
||||
end
|
||||
#Origami: Cashier : to view orders
|
||||
def self.get_orders
|
||||
from = Time.now.beginning_of_day.utc
|
||||
to = Time.now.end_of_day.utc
|
||||
orders = Order.select("orders.id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
||||
order_items.id as order_items_id,dining_facilities.name as table_or_room_name")
|
||||
.joins("left join booking_orders on booking_orders.order_id = orders.id
|
||||
left join bookings on bookings.id = booking_orders.id
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.id")
|
||||
|
||||
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||
.group("orders.id")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class OrderItem < ApplicationRecord
|
||||
#primary key - need to be unique
|
||||
|
||||
#Associations
|
||||
belongs_to :order, autosave: true
|
||||
|
||||
@@ -32,5 +34,12 @@ class OrderItem < ApplicationRecord
|
||||
orderitem.save!
|
||||
|
||||
|
||||
end
|
||||
#Origami : Cashier : to show order items details
|
||||
def self.get_order_items_details(order_id)
|
||||
order_details = OrderItem.select("order_items.item_name,order_items.qty,order_items.price,(order_items.qty*order_items.price) as total_price")
|
||||
.joins("left join orders on orders.id = order_items.order_id")
|
||||
.where("order_items.order_id=?",order_id)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
class OrderQueueItem < ApplicationRecord
|
||||
end
|
||||
@@ -8,7 +8,7 @@ class OrderQueueStation < ApplicationRecord
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
def process_order (order)
|
||||
def process_order (order)
|
||||
oqs_stations = OrderQueueStation.active
|
||||
|
||||
order_items = order.order_items
|
||||
@@ -20,10 +20,10 @@ class OrderQueueStation < ApplicationRecord
|
||||
#Loop through the processing items
|
||||
pq_items.each do |pq_item|
|
||||
#Processing through the looping items
|
||||
order_items.each do |order_item|
|
||||
order_items.each do |order_item|
|
||||
if (pq_item == order_item.item_code)
|
||||
#Same Order_items can appear in two location.
|
||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
2
app/models/print_setting.rb
Normal file
2
app/models/print_setting.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class PrintSetting < ApplicationRecord
|
||||
end
|
||||
@@ -1,22 +1,46 @@
|
||||
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
|
||||
def print_order_item(order_queue_id)
|
||||
def print_order_item(printer_settings,order_id, item_code)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
pdf = OrderItemPdf.new
|
||||
pdf.render_file "tmp/order_item_queue_#{order_id}_#{order_item_id}" + ".pdf"
|
||||
order_item= print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
||||
pdf = OrderItemPdf.new(order_item[0],printer_settings)
|
||||
pdf.render_file "tmp/receipt.pdf"
|
||||
self.print("tmp/receipt.pdf")
|
||||
end
|
||||
|
||||
def print_order_summary(booking_id)
|
||||
def print_order_summary(printer_settings,booking_id)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
order=print_query('booking',booking_id)
|
||||
filename = "tmp/order_summary_#{booking_id}" + ".pdf"
|
||||
pdf = OrderSummaryPdf.new
|
||||
pdf = OrderSummaryPdf.new(order,printer_settings)
|
||||
pdf.render_file filename
|
||||
|
||||
self.print(filename)
|
||||
end
|
||||
|
||||
# Query for OQS with status
|
||||
def print_query(type, code)
|
||||
if type == 'order_item'
|
||||
OrderItem.select("order_items.item_code, order_items.item_name,order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining")
|
||||
.joins("left join orders ON orders.id = order_items.order_id
|
||||
left join booking_orders AS bo ON bo.order_id=order_items.order_id
|
||||
left join bookings AS b ON b.id = bo.booking_id
|
||||
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
||||
left join customers as cus ON cus.id = orders.customer_id")
|
||||
.where("order_items.item_code=" + code)
|
||||
.group("order_items.item_code")
|
||||
else
|
||||
OrderItem.select("order_items.item_code, order_items.item_name, df.name as dining")
|
||||
.joins("left join orders ON orders.id = order_items.order_id
|
||||
left join booking_orders AS bo ON bo.order_id=order_items.order_id
|
||||
left join bookings AS b ON b.id = bo.booking_id
|
||||
left join dining_facilities AS df ON df.id = b.dining_facility_id")
|
||||
.where("booking.id=" + code)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -63,4 +63,13 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
|
||||
self.print(filename)
|
||||
end
|
||||
#Bill Receipt Print
|
||||
def print_receipt_bill(printer_settings,sale_items,sale)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
pdf = ReceiptBillPdf.new(printer_settings,sale_items,sale)
|
||||
pdf.render_file "tmp/receipt_bill_#{sale.id}.pdf"
|
||||
self.print("tmp/receipt_bill_#{sale.id}.pdf")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
class Sale < ApplicationRecord
|
||||
#before_create :generate_receipt_no
|
||||
belongs_to :cashier, :optional => true
|
||||
@@ -188,7 +190,8 @@ class Sale < ApplicationRecord
|
||||
sale_tax.tax_name = tax.name
|
||||
sale_tax.tax_rate = tax.rate
|
||||
#include or execulive
|
||||
sale_tax.tax_payable_amount = total_taxable * tax.rate
|
||||
# sale_tax.tax_payable_amount = total_taxable * tax.rate
|
||||
sale_tax.tax_payable_amount = total_taxable * tax.rate / 100
|
||||
#new taxable amount
|
||||
total_taxable = total_taxable + sale_tax.tax_payable_amount
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class SaleAudit < ApplicationRecord
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
belongs_to :sale
|
||||
|
||||
def record_audit_void(sale_id, void_by, approved_by, reason)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
class SaleDiscount < ApplicationRecord
|
||||
belongs_to :sale
|
||||
end
|
||||
@@ -1,4 +1,6 @@
|
||||
class SaleItem < ApplicationRecord
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
belongs_to :sale
|
||||
|
||||
#compute items - discount, tax, price_change
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class SaleOrder < ApplicationRecord
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
belongs_to :sale
|
||||
belongs_to :order
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class SalePayment < ApplicationRecord
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
belongs_to :sale
|
||||
|
||||
:attr_accessor :received_amount, :card_payment_reference, :voucher_no, :giftcard_no, :customer_id, :external_payment_status
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
class SaleTax < ApplicationRecord
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
belongs_to :sale
|
||||
end
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
class SeedGenerator < ApplicationRecord
|
||||
def self.generate_id(model, prefix)
|
||||
seed = SeedGenerator.find_by_model(model)
|
||||
new_receipt_no = 0
|
||||
if (seed.nil?)
|
||||
seed = SeedGenerator.new()
|
||||
seed.model = model
|
||||
new_receipt_no = seed.next
|
||||
seed.save
|
||||
|
||||
else
|
||||
current_no = seed.next
|
||||
seed.next = seed.next + seed.increase_by
|
||||
seed.current = current_no
|
||||
seed.save
|
||||
end
|
||||
|
||||
return prefix + "-" + seed.current.to_s
|
||||
end
|
||||
|
||||
def self.new_receipt_no
|
||||
seed = SeedGenerator.find_by_model("sale")
|
||||
new_receipt_no = 0
|
||||
|
||||
2
app/models/shop.rb
Normal file
2
app/models/shop.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Shop < ApplicationRecord
|
||||
end
|
||||
2
app/models/test.rb
Normal file
2
app/models/test.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Test < ApplicationRecord
|
||||
end
|
||||
5
app/models/transactions.rb
Normal file
5
app/models/transactions.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module Transactions
|
||||
def self.table_name_prefix
|
||||
'transactions_'
|
||||
end
|
||||
end
|
||||
@@ -5,14 +5,27 @@ class OrderItemPdf < Prawn::Document
|
||||
|
||||
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
|
||||
# font "public/fonts/Zawgyi-One.ttf"
|
||||
# font "public/fonts/padauk.ttf"
|
||||
|
||||
|
||||
# font "public/fonts/padauk.ttf"
|
||||
font_size 9
|
||||
text "#{"table_name"}", :size => 15
|
||||
text "#{order_item.dining}", :size => 15
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
|
||||
cashier_info(order_item.order_by,order_item.order_at, order_item.customer)
|
||||
|
||||
end
|
||||
|
||||
def cashier_info(order_by, order_at, customer)
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width =>200, :height => 20) do
|
||||
text "OrderBy:#{order_by} Customer:#{customer} Date:#{order_at.strftime("%Y %m %d")}", :size => 7,:align => :left
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
move_down 5
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
110
app/pdf/receipt_bill_pdf.rb
Normal file
110
app/pdf/receipt_bill_pdf.rb
Normal file
@@ -0,0 +1,110 @@
|
||||
class ReceiptBillPdf < Prawn::Document
|
||||
attr_accessor :receipt_width,:price_column_width,:p_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_column_width,:item_description_width
|
||||
def initialize(printer_settings, sale_items,sale)
|
||||
self.p_width = 200
|
||||
self.page_height = 1450
|
||||
self.margin = 10
|
||||
# self.price_width = self.p_width / 2
|
||||
self.price_width=90
|
||||
self.item_width = self.p_width - self.price_width
|
||||
self.item_height = self.item_height
|
||||
self.qty_column_width = self.p_width / 2
|
||||
self.item_description_width=self.p_width - self.price_width
|
||||
self.receipt_width=130
|
||||
|
||||
@item_width = self.p_width.to_i / 2
|
||||
@qty_width = @item_width.to_i / 3
|
||||
@double = @qty_width * 2
|
||||
@half_qty = @qty_width / 2
|
||||
#setting page margin and width
|
||||
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.p_width, self.page_height])
|
||||
self.header_font_size = 10
|
||||
self.item_font_size = 6
|
||||
|
||||
header( printer_settings.printer_name, printer_settings.name)
|
||||
stroke_horizontal_rule
|
||||
cashier_info(sale.receipt_no,sale.customer.name, sale.receipt_date)
|
||||
line_items(sale_items)
|
||||
|
||||
|
||||
end
|
||||
|
||||
def header (printer_name, name)
|
||||
text "#{printer_name}", :size => self.header_font_size,:align => :center
|
||||
move_down 5
|
||||
text "#{name}", :size => self.header_font_size,:align => :center
|
||||
# move_down self.item_height
|
||||
move_down 5
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
end
|
||||
|
||||
def cashier_info(receipt_no, customer, receipt_date)
|
||||
move_down 5
|
||||
move_down 2
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.price_width, :height => self.item_height) do
|
||||
text "Receipt No:", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
bounding_box([self.price_width, y_position], :width =>self.receipt_width) do
|
||||
text "#{receipt_no}" , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
move_down 5
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.price_width, :height => self.item_height) do
|
||||
text "Customer:", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.price_width,y_position], :width =>self.price_width) do
|
||||
text "#{customer}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
move_down 5
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.price_width, :height => self.item_height) do
|
||||
text "Date:", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.price_width,y_position], :width =>self.price_width) do
|
||||
text "#{receipt_date}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
# stroke_horizontal_rule
|
||||
move_down 5
|
||||
end
|
||||
|
||||
def line_items(sale_items)
|
||||
y_position = cursor
|
||||
qty_column_width = self.p_width * 0.2
|
||||
item_description_width = self.p_width * 0.5
|
||||
price_column_width = self.p_width * 0.3
|
||||
|
||||
|
||||
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
pad_top(15) {
|
||||
# @item_width.to_i + @half_qty.to_i
|
||||
text_box "Items", :at =>[0,y_position], :width => @item_width.to_i - @half_qty.to_i , :height =>15, :overflow => :shrink_to_fix, :size => self.item_font_size
|
||||
text_box "Price", :at =>[@item_width.to_i - @half_qty.to_i,y_position], :width => @qty_width, :height =>15, :overflow => :shrink_to_fix, :size => self.item_font_size, :align => :right
|
||||
text_box "Qty", :at =>[@item_width.to_i-@qty_width,y_position], :width => @half_qty, :height =>15, :overflow => :shrink_to_fix, :size => self.item_font_size, :align => :right
|
||||
text_box "Discount", :at =>[@item_width.to_i + @half_qty.to_i,y_position], :width => @qty_width, :height =>15, :overflow => :shrink_to_fix, :size => self.item_font_size, :align => :right
|
||||
text_box "Total", :at =>[@item_width.to_i + @half_qty.to_i,y_position], :width => @double, :height =>15, :overflow => :shrink_to_fix, :size => self.item_font_size, :align => :right
|
||||
|
||||
}
|
||||
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
|
||||
add_line_item_row(sale_items)
|
||||
stroke_horizontal_rule
|
||||
|
||||
end
|
||||
|
||||
def add_line_item_row(sale_items)
|
||||
y_position = cursor
|
||||
move_down 5
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2,6 +2,8 @@ if (@booking)
|
||||
json.id @booking.id
|
||||
json.status @booking.booking_status
|
||||
json.checkin_at @booking.checkin_at
|
||||
json.checkin_by @booking.checkin_by
|
||||
json.table_name @booking.dining_facility.name
|
||||
|
||||
if @booking.type == "TableBooking"
|
||||
json.table_id @booking.dining_facility_id
|
||||
|
||||
115
app/views/crm/home/_booking.html.erb
Normal file
115
app/views/crm/home/_booking.html.erb
Normal file
@@ -0,0 +1,115 @@
|
||||
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
|
||||
<% @i = 0 %>
|
||||
<% @booking.each do |booking| %>
|
||||
<% if booking.booking_status == "new" %>
|
||||
<div class="card">
|
||||
<div class="card-block booking_click" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" style="width:100%;">
|
||||
<h4 class="card-title">
|
||||
<%= @i += 1 %> . <%= booking.dining_facility.name %>
|
||||
- <%= booking.id %>
|
||||
</h4>
|
||||
<!-- <p class="card-text">Medium, Fries, Salad</p> -->
|
||||
<p class="card-text">
|
||||
<small class="text-muted">
|
||||
Order at <%= booking.checkin_at.strftime("%H,%m") %>, <%= booking.checkin_by %>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
$(".booking_click").on("click", function(){
|
||||
$(".summary-items tbody tr").remove();
|
||||
$("#cancel").removeAttr("disabled");
|
||||
$("#assign").removeAttr("disabled");
|
||||
var url = $(this).attr('data-ref');
|
||||
show_details(url);
|
||||
});
|
||||
|
||||
$('.assign').click(function(e){
|
||||
var booking_id = $(this).val()
|
||||
var type = $(this).attr("data-type")
|
||||
|
||||
update_booking(booking_id,type)
|
||||
});
|
||||
|
||||
$('.cancel').click(function(e){
|
||||
var booking_id = $(this).val()
|
||||
var type = $(this).attr("data-type")
|
||||
|
||||
update_booking(booking_id,type)
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function show_details(url_item){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url_item,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
item_data = data.order_items;
|
||||
//console.log(item_data.length);
|
||||
|
||||
$("#table").text(data.table_name)
|
||||
$("#order_at").text(data.checkin_at)
|
||||
$("#order_by").text(data.checkin_by)
|
||||
$("#assign").val(data.id)
|
||||
$("#cancel").val(data.id)
|
||||
for(var field in item_data) {
|
||||
if (item_data[field].item_name){
|
||||
var price = parseFloat(item_data[field].price).toFixed(2);
|
||||
|
||||
row = "<tr>"
|
||||
+'<td style="width:33%; text-align:left">' + item_data[field].item_name +'</td>'
|
||||
+'<td style="width:33%; text-align:center">' + item_data[field].qty + '</td>'
|
||||
+'<td style="width:33%; text-align:right">' + price + '</td>'
|
||||
+'</tr>';
|
||||
}
|
||||
$(".summary-items tbody").append(row);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update_booking(booking_id,type) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "crm/update_booking/" ,
|
||||
data: {booking_id:booking_id,type:type},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.status == true && data.type == "cancel")
|
||||
{
|
||||
alert('Booking has canceled!');
|
||||
}else{
|
||||
alert('Booking has completed!');
|
||||
}
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
23
app/views/crm/home/_customer.html.erb
Normal file
23
app/views/crm/home/_customer.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<% @customer.each do |customer| %>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<!-- <h4 class="card-title">Customer Name : <%= customer.name %></h4> -->
|
||||
<p class="card-text">Name : <%= customer.name %></p>
|
||||
<p class="card-text">Contact No : <%= customer.contact_no %></p>
|
||||
<p class="card-text">Email : <%= customer.email %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="card card-inverse card-primary ">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
37
app/views/crm/home/_queue.html.erb
Normal file
37
app/views/crm/home/_queue.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
|
||||
<% @i = 0 %>
|
||||
<% @booking.each do |booking| %>
|
||||
<% if booking.booking_status == "assign" %>
|
||||
<div class="card booking_click" data-ref="<%= api_booking_path booking.id%>" id="booking_block">
|
||||
<div class="card-block" id="card-block" style="width:100%;">
|
||||
<h4 class="card-title">
|
||||
<%= @i += 1 %> . <%= booking.dining_facility.name %>
|
||||
- <%= booking.id %>
|
||||
</h4>
|
||||
<!-- <p class="card-text">Medium, Fries, Salad</p> -->
|
||||
<p class="card-text">
|
||||
<small class="text-muted">
|
||||
Order at <%= booking.checkin_at.strftime("%H,%m") %>, <%= booking.checkin_by %>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<!-- <div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<button id="assign" data-ref="<%= booking.id%>" data-type="complete" class="btn assign btn-primary btn-sm btn-block">ASSIGN</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button id="cancel" data-ref="<%= booking.id%>" data-type="cancel" class="btn btn-danger cancel btn-sm btn-block">CANCLE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -5,10 +5,10 @@
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Queue <span class="badge badge-pill badge-default">2000</span></a>
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Queue <span class="badge badge-pill badge-default"><%= @booking.where("booking_status=?","assign").count %></span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Bookings <span class="badge badge-pill badge-default">18</span></a>
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Bookings <span class="badge badge-pill badge-default"><%= @booking.where("booking_status=?","new").count %></span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Customers</a>
|
||||
@@ -19,288 +19,24 @@
|
||||
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<!--- Panel 0 - Completed -->
|
||||
<div class="tab-pane" id="completed" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block order-completed">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at 12:23, Kyaw Lwin</small> |
|
||||
<small class="text-muted">Printed at 12:23</small> |
|
||||
<small class="text-muted">Completed at 12:43</small>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block order-void">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial => 'queue' %>
|
||||
|
||||
</div>
|
||||
<!-- Panel 1 - Tables -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">1. Table 4 - Beef Steak [x1]</h4>
|
||||
<p class="card-text">Medium, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">2. Table 4 - Beef Steak [x1]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">3. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">4. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">5. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">6. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">7. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">8. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">10. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">11. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">12. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">13. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">14. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">15. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">16. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">17. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">18. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">19. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'booking' %>
|
||||
|
||||
</div>
|
||||
<!-- Panel 1 - Tables - End -->
|
||||
<!-- Panel 2 - Rooms -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card p-3">
|
||||
<blockquote class="card-block card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
<small class="text-muted">
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-primary p-3 text-center">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
|
||||
<footer>
|
||||
<small>
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%= render :partial => 'customer' %>
|
||||
</div>
|
||||
<!-- Panel 2 - Rooms - End -->
|
||||
<!-- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Panel 3 - Orders - End -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
@@ -308,51 +44,44 @@
|
||||
<div class="card-header">
|
||||
<div id="order-title"><strong>ORDER DETAILS</strong> - Table 4</div>
|
||||
</div>
|
||||
<div id="station"></div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
<table class="table">
|
||||
<table class="table" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:33%; text-align:left">Order By</th>
|
||||
<th style="width:33%; text-align:right">Order At</td>
|
||||
<th style="width:33%; text-align:center;">Order At</td>
|
||||
<th style="width:33%; text-align:right">Customer</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:33%; text-align:left">Kyaw Lwin</td>
|
||||
<td style="width:33%; text-align:right">20/04/17 9:30PM</td>
|
||||
<td style="width:33%; text-align:right">John Smith</td>
|
||||
<tr id="">
|
||||
<td style="width:33%; text-align:left" id="order_by"></td>
|
||||
<td style="width:33%; text-align:center" id="order_at"></td>
|
||||
<td style="width:33%; text-align:right" id="customer"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="">
|
||||
<td><strong>Table/Room</strong></td>
|
||||
<td colspan="2">Table 4</td>
|
||||
<td colspan="2" style="text-align:left" id="table"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:80%; text-align:left">Items</th>
|
||||
<th style="width:20%; text-align:right">QTY</td>
|
||||
<th style="width:33%; text-align:left">Items</th>
|
||||
<th style="width:33%; text-align:center">Qty</th>
|
||||
<th style="width:33%; text-align:right">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
|
||||
<table class="table">
|
||||
<table class="table summary-items">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left">
|
||||
Menu Items Name <br/>
|
||||
Less Sweet, No MSG
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -365,6 +94,8 @@
|
||||
<!-- OQS Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button>
|
||||
<button id="assign" value="" disabled="disabled" data-type="assign" class="btn assign btn-primary btn-lg btn-block">ASSIGN</button>
|
||||
<button id="cancel" value="" disabled="disabled" data-type="cancel" class="btn btn-danger cancel btn-lg btn-block">CANCLE</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,315 +1,142 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<!-- Column One -->
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Processed <span class="badge badge-pill badge-default">2000</span></a>
|
||||
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab">Processed <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li>
|
||||
|
||||
<%
|
||||
# For Tab Disable for Station is inactive
|
||||
status=""
|
||||
@queue_stations_items.each do |qsi|
|
||||
if qsi[:is_active] == false
|
||||
status="disabled"
|
||||
end
|
||||
%>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Queue 1 <span class="badge badge-pill badge-default">18</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Queue 2</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Queue 3</a>
|
||||
<a class="nav-link" data-toggle="tab" href=<%= '#' + qsi[:station_name].gsub(' ', '_') %> role="tab" <%= status %>>
|
||||
<%= qsi[:station_name] %>
|
||||
<span class="badge badge-pill badge-default" id=<%= qsi[:station_name].gsub(' ', '_') + '_count' %>>
|
||||
<%= qsi[:item_count] %>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<div class="tab-content" style="min-height:670px; max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed -->
|
||||
<div class="tab-pane" id="completed" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block order-completed">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at 12:23, Kyaw Lwin</small> |
|
||||
<small class="text-muted">Printed at 12:23</small> |
|
||||
<small class="text-muted">Completed at 12:43</small>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block order-void">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Panel 1 - Tables -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">1. Table 4 - Beef Steak [x1]</h4>
|
||||
<p class="card-text">Medium, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">2. Table 4 - Beef Steak [x1]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">3. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">4. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">5. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">6. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">7. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">8. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">10. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">11. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">12. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">13. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">14. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">15. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">16. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">17. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">18. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">19. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<!--- end of Items-->
|
||||
<div class="tab-pane 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">
|
||||
<h4 class="card-title">
|
||||
<span class="order-zone">
|
||||
<%= qid.zone %>
|
||||
</span> -
|
||||
<span class="order-item">
|
||||
<%= qid.item_name %>
|
||||
</span> [x
|
||||
<span class="order-qty">
|
||||
<%= qid.qty %>
|
||||
</span> ]
|
||||
</h4>
|
||||
<p class="card-text">Medium, Fries, Salad</p>
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at
|
||||
<span class="order-at">
|
||||
<%= qid.created_at.strftime("%Y %m %d") %>
|
||||
</span> -
|
||||
<span class="order-by">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</small>
|
||||
</p>
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.id %></p>
|
||||
</div>
|
||||
<!-- <div class="card-footer">
|
||||
<button id=<%= 'assigned_queue_' + qid.id.to_s %> class="btn btn-primary btn-lg btn-block order-complete">COMPLETE</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Panel 1 - Tables - End -->
|
||||
<!-- Panel 2 - Rooms -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
<!-- End Panel 0 - Completed -->
|
||||
|
||||
<!-- Order Item for Queue Station -->
|
||||
<%
|
||||
@queue_stations_items.each do |qsi|
|
||||
%>
|
||||
<!-- Generated Pane -->
|
||||
<div class="tab-pane" id=<%= qsi[:station_name].gsub(' ', '_') %> role="tabpanel">
|
||||
<!--- Order Items -->
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@queue_items_details.each do |qid|
|
||||
if qid.station_name == qsi[:station_name]
|
||||
%>
|
||||
<div class="card queue_station">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span class="order-zone">
|
||||
<%= qid.zone %>
|
||||
</span> -
|
||||
<span class="order-item">
|
||||
<%= qid.item_name %>
|
||||
</span> [x
|
||||
<span class="order-qty">
|
||||
<%= qid.qty %>
|
||||
</span> ]
|
||||
</h4>
|
||||
<p class="card-text">Medium, Fries, Salad</p>
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at
|
||||
<span class="order-at">
|
||||
<%= qid.created_at.strftime("%Y %m %d") %>
|
||||
</span> -
|
||||
<span class="order-by">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</small>
|
||||
</p>
|
||||
<!-- Hidden Fields for Items -->
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.id %></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id=<%= 'assigned_queue_' + qid.id.to_s %> class="btn btn-primary btn-lg btn-block order-complete">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card p-3">
|
||||
<blockquote class="card-block card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
<small class="text-muted">
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-primary p-3 text-center">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
|
||||
<footer>
|
||||
<small>
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Panel 2 - Rooms - End -->
|
||||
<!-- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Panel 3 - Orders - End -->
|
||||
<!-- end of Pane -->
|
||||
<% end %>
|
||||
<!-- End Order Item for Queue Station -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div id="order-title"><strong>ORDER DETAILS</strong> - Table 4</div>
|
||||
<div><strong id="order-title">ORDER DETAILS -</strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
@@ -323,35 +150,33 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:33%; text-align:left">Kyaw Lwin</td>
|
||||
<td style="width:33%; text-align:right">20/04/17 9:30PM</td>
|
||||
<td style="width:33%; text-align:right">John Smith</td>
|
||||
<td id="order-by" style="width:33%; text-align:left"></td>
|
||||
<td id="order-at" style="width:33%; text-align:right"></td>
|
||||
<td id="order-customer" style="width:33%; text-align:right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Table/Room</strong></td>
|
||||
<td colspan="2">Table 4</td>
|
||||
<td id="order-from" colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" style="min-height:400px; max-height:400px; overflow:auto">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:80%; text-align:left">Items</th>
|
||||
<th style="width:20%; text-align:right">QTY</td>
|
||||
<th style="width:20%; text-align:right">QTY</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left">
|
||||
Menu Items Name <br/>
|
||||
Less Sweet, No MSG
|
||||
<td id="order-items" style="width:80%; text-align:left">
|
||||
<!-- Menu Items Name <br/>
|
||||
Less Sweet, No MSG -->
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
<td id="order-qty" style="width:20%; text-align:right">
|
||||
<!-- 5 -->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -363,11 +188,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three--->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- OQS Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button>
|
||||
<button type="button" title="Print Order Item" id="print_order_item" class="btn btn-primary btn-lg btn-block">Print</a>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" id="print_order_item" disabled>Print <br/>Order<br/>Summary</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
2
app/views/oqs/print/print.html.erb
Normal file
2
app/views/oqs/print/print.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Oqs::Print#print</h1>
|
||||
<p>Find me in app/views/oqs/print/print.html.erb</p>
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-8">
|
||||
<!-- Column One -->
|
||||
|
||||
@@ -18,67 +18,20 @@
|
||||
|
||||
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<!-- Panel 1 - Tables -->
|
||||
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
<% if @order_table %>
|
||||
<% @order_table.each do |order_table| %>
|
||||
<div class="card" id="table-order-<%=order_table.order_id%>" onclick="callOrderDetails('<%=order_table.order_id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=order_table.order_id%>" class="table-name"><%=order_table.table_name%></span></h4>
|
||||
<p class="card-text"><%=order_table.total_price%></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card p-3">
|
||||
<blockquote class="card-block card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
<small class="text-muted">
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-primary p-3 text-center">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
|
||||
<footer>
|
||||
<small>
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card p-3 text-right">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
<small class="text-muted">
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -87,46 +40,16 @@
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<% @order_rooms.each do |order_room| %>
|
||||
<div class="card" id="table-order-<%=order_room.order_id%>" onclick="callOrderDetails('<%=order_room.order_id%>')">
|
||||
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card p-3">
|
||||
<blockquote class="card-block card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
<small class="text-muted">
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-inverse card-primary p-3 text-center">
|
||||
<blockquote class="card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
|
||||
<footer>
|
||||
<small>
|
||||
Someone famous in <cite title="Source Title">Source Title</cite>
|
||||
</small>
|
||||
</footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
<% tablename = order_room.room_name%>
|
||||
<h4 class="card-title"><span id="table-name-<%=order_room.order_id%>" class="table-name"><%=order_room.room_name%></span></h4>
|
||||
<p class="card-text"><%=order_room.total_price%></p>
|
||||
</div>
|
||||
</div>
|
||||
<%end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -137,27 +60,15 @@
|
||||
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card" id="table-order-<%=order.order_id%>" onclick="callOrderDetails('<%=order.order_id%>')">
|
||||
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
<h4 class="card-title"><span id="table-name-<%=order.order_id%>" class="table-name"><%=order.table_or_room_name%></span></h4>
|
||||
<p class="card-text"><%=order.total_price%></p>
|
||||
</div>
|
||||
</div>
|
||||
<%end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -172,7 +83,7 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div id="order-title"><strong>ORDER DETAILS</strong> - Table 4</div>
|
||||
<div id="order-title"><strong>ORDER DETAILS</strong> <span id="order-detail-header"></span></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
@@ -186,120 +97,21 @@
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
|
||||
<table class="table">
|
||||
<div id="table-details" class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
|
||||
<table class="table" id="append-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
<span id="item-name-price"></span>
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
<span id="item-qty"></span>
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
<span id="item-total-price"></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -307,24 +119,8 @@
|
||||
<table class="table" style="margin-bottom:0px">
|
||||
<tfooter>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Sub-Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong>750.00</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left">Discounts</td>
|
||||
<td style="width:20%; text-align:right">(-250.00)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left">Service Tax</td>
|
||||
<td style="width:20%; text-align:right">50.00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left">Commercial Tax</td>
|
||||
<td style="width:20%; text-align:right">39.50</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left"><strong>Grand Total</strong></td>
|
||||
<td style="width:20%; text-align:right"><strong>589.50</strong></td>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Sub Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span id="sub-total"></span></strong></td>
|
||||
</tr>
|
||||
</tfooter>
|
||||
</table>
|
||||
@@ -340,12 +136,74 @@
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Customer</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button> -->
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">
|
||||
Req.Bill
|
||||
</button>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Discount</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var old_order_id = 0
|
||||
var old_table_name = ""
|
||||
var table_or_order_id = 0
|
||||
|
||||
function callOrderDetails(order_id){
|
||||
table_or_order_id = order_id
|
||||
$("#test").html(order_id)
|
||||
var tbody = ""
|
||||
$("#append-table").html("")
|
||||
if (old_order_id != order_id){
|
||||
$("#table-order-"+old_order_id).removeClass("selected_color")
|
||||
$("#table-order-"+order_id).addClass("selected_color")
|
||||
old_order_id = order_id
|
||||
}
|
||||
$("#order-detail-header").html("")
|
||||
$("#order-detail-header").append(document.getElementById("table-name-"+order_id).innerHTML)
|
||||
$("#sub-total").html("")
|
||||
url = "origami/"+order_id
|
||||
$.ajax({type: "GET",
|
||||
url: url,
|
||||
data: { order_id: order_id},
|
||||
success:function(result){
|
||||
var sub_total = 0
|
||||
for (i = 0; i < result.length; i++) {
|
||||
var data = JSON.stringify(result[i]);
|
||||
var parse_data = JSON.parse(data)
|
||||
sub_total += (parse_data.qty*parse_data.price)
|
||||
row = '<tbody><tr><td style="width:60%; text-align:left"><span id="item-name-price">'+parse_data.item_name+"@"+(parse_data.price*1)+'</span></td>'
|
||||
+'<td style="width:20%; text-align:right"><span id="item-qty">'+(parse_data.qty*1)+'</span></td>s'
|
||||
+'<td style="width:20%; text-align:right"><span id="item-total-price">'+(parse_data.qty*parse_data.price)+'</span></td>'
|
||||
+'</tr></tbody>'
|
||||
tbody += row
|
||||
|
||||
}
|
||||
|
||||
$("#append-table").append(tbody)
|
||||
$("#sub-total").append((sub_total)+"<br/>")
|
||||
|
||||
|
||||
},
|
||||
error:function(result){
|
||||
// alert('error');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
$('#request_bills').click(function() {
|
||||
window.location.href = '/origami/request_bills/'+table_or_order_id;
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.selected_color{
|
||||
color:white;
|
||||
background-color: blue;
|
||||
}
|
||||
</style>
|
||||
69
app/views/origami/request_bills/show.html.erb
Normal file
69
app/views/origami/request_bills/show.html.erb
Normal file
@@ -0,0 +1,69 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div id="order-title">
|
||||
<span><strong>Receipt No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></span>
|
||||
<span><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:60%; text-align:left">Items</th>
|
||||
<th style="width:20%; text-align:right">QTY</td>
|
||||
<th style="width:20%; text-align:right">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div id="table-details" class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
|
||||
<table class="table" id="append-table">
|
||||
<tbody>
|
||||
<% sub_total = 0 %>
|
||||
<% if @sale_items %>
|
||||
<% @sale_items.each do |sale_item| %>
|
||||
<% sub_total += sale_item.qty*sale_item.unit_price%>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
<span id="item-name-price"><%=sale_item.product_name%>@<%=sale_item.unit_price%></span>
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
<span id="item-qty"><%=sale_item.qty%></span>
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
<span id="item-total-price"><%=(sale_item.qty*sale_item.unit_price)%></span>
|
||||
</td>
|
||||
</tr>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" style="margin-bottom:0px">
|
||||
<tfooter>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Sub Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span id="sub-total"><%=sub_total%></span></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>(Discount)</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span>(<%=@sale_data.total_discount%>)</span></strong></td>
|
||||
</tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Tax</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.total_tax%></span></strong></td>
|
||||
</tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Grand Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.grand_total%></span></strong></td>
|
||||
</tr>
|
||||
</tfooter>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
22
app/views/print_settings/_form.html.erb
Normal file
22
app/views/print_settings/_form.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<%= simple_form_for(@print_setting) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :unique_code %>
|
||||
<%= f.input :template %>
|
||||
<%= f.input :db_name %>
|
||||
<%= f.input :db_type %>
|
||||
<%= f.input :db_username %>
|
||||
<%= f.input :db_password %>
|
||||
<%= f.input :printer_name %>
|
||||
<%= f.input :api_settings %>
|
||||
<%= f.input :page_width %>
|
||||
<%= f.input :page_height %>
|
||||
<%= f.input :print_copies %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
2
app/views/print_settings/_print_setting.json.jbuilder
Normal file
2
app/views/print_settings/_print_setting.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! print_setting, :id, :name,, :unique_code,, :template,, :db_name,, :db_type,, :db_username,, :db_password,, :printer_name,, :api_settings,, :page_width, :page_height, :print_copies, :created_at, :updated_at
|
||||
json.url print_setting_url(print_setting, format: :json)
|
||||
6
app/views/print_settings/edit.html.erb
Normal file
6
app/views/print_settings/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Print Setting</h1>
|
||||
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
|
||||
<%= link_to 'Show', @print_setting %> |
|
||||
<%= link_to 'Back', print_settings_path %>
|
||||
49
app/views/print_settings/index.html.erb
Normal file
49
app/views/print_settings/index.html.erb
Normal file
@@ -0,0 +1,49 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Print Settings</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Unique code</th>
|
||||
<th>Template</th>
|
||||
<th>Db name</th>
|
||||
<th>Db type</th>
|
||||
<th>Db username</th>
|
||||
<th>Db password</th>
|
||||
<th>Printer name</th>
|
||||
<th>Api settings</th>
|
||||
<th>Page width</th>
|
||||
<th>Page height</th>
|
||||
<th>Print copies</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @print_settings.each do |print_setting| %>
|
||||
<tr>
|
||||
<td><%= print_setting.name %></td>
|
||||
<td><%= print_setting.unique_code %></td>
|
||||
<td><%= print_setting.template %></td>
|
||||
<td><%= print_setting.db_name %></td>
|
||||
<td><%= print_setting.db_type %></td>
|
||||
<td><%= print_setting.db_username %></td>
|
||||
<td><%= print_setting.db_password %></td>
|
||||
<td><%= print_setting.printer_name %></td>
|
||||
<td><%= print_setting.api_settings %></td>
|
||||
<td><%= print_setting.page_width %></td>
|
||||
<td><%= print_setting.page_height %></td>
|
||||
<td><%= print_setting.print_copies %></td>
|
||||
<td><%= link_to 'Show', print_setting %></td>
|
||||
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
|
||||
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Print Setting', new_print_setting_path %>
|
||||
1
app/views/print_settings/index.json.jbuilder
Normal file
1
app/views/print_settings/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @print_settings, partial: 'print_settings/print_setting', as: :print_setting
|
||||
5
app/views/print_settings/new.html.erb
Normal file
5
app/views/print_settings/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Print Setting</h1>
|
||||
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
|
||||
<%= link_to 'Back', print_settings_path %>
|
||||
64
app/views/print_settings/show.html.erb
Normal file
64
app/views/print_settings/show.html.erb
Normal file
@@ -0,0 +1,64 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @print_setting.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Unique code:</strong>
|
||||
<%= @print_setting.unique_code %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Template:</strong>
|
||||
<%= @print_setting.template %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Db name:</strong>
|
||||
<%= @print_setting.db_name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Db type:</strong>
|
||||
<%= @print_setting.db_type %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Db username:</strong>
|
||||
<%= @print_setting.db_username %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Db password:</strong>
|
||||
<%= @print_setting.db_password %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Printer name:</strong>
|
||||
<%= @print_setting.printer_name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Api settings:</strong>
|
||||
<%= @print_setting.api_settings %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Page width:</strong>
|
||||
<%= @print_setting.page_width %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Page height:</strong>
|
||||
<%= @print_setting.page_height %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Print copies:</strong>
|
||||
<%= @print_setting.print_copies %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_print_setting_path(@print_setting) %> |
|
||||
<%= link_to 'Back', print_settings_path %>
|
||||
1
app/views/print_settings/show.json.jbuilder
Normal file
1
app/views/print_settings/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "print_settings/print_setting", print_setting: @print_setting
|
||||
14
app/views/settings/accounts/_form.html.erb
Normal file
14
app/views/settings/accounts/_form.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<%= simple_form_for([:settings,@settings_account]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :title %>
|
||||
<%= f.input :account_type, :collection => Lookup.collection_of("account_type") %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_account, :id, :title, :account_type, :created_at, :updated_at
|
||||
json.url settings_account_url(settings_account, format: :json)
|
||||
10
app/views/settings/accounts/edit.html.erb
Normal file
10
app/views/settings/accounts/edit.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_accounts_path %>">Account</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_account: @settings_account %>
|
||||
</div>
|
||||
37
app/views/settings/accounts/index.html.erb
Normal file
37
app/views/settings/accounts/index.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Account</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_account_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:40%">Title</th>
|
||||
<th style="width:40%">Account Type</th>
|
||||
<th style="width:20%">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_accounts.each do |account| %>
|
||||
<tr>
|
||||
<td><%= account.title %></td>
|
||||
<td><%= account.account_type %></td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_settings_account_path(account) %> |
|
||||
<%= link_to 'Destroy', settings_account_path(account), method: :delete, data: { confirm: 'Are you sure?' } %>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
1
app/views/settings/accounts/index.json.jbuilder
Normal file
1
app/views/settings/accounts/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @settings_accounts, partial: 'settings_accounts/settings_account', as: :settings_account
|
||||
11
app/views/settings/accounts/new.html.erb
Normal file
11
app/views/settings/accounts/new.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_accounts_path %>">Account</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_account: @settings_account %>
|
||||
</div>
|
||||
|
||||
34
app/views/settings/accounts/show.html.erb
Normal file
34
app/views/settings/accounts/show.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Account</li>
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Account</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Account type</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @settings_account.title %></td>
|
||||
<td><%= @settings_account.account_type %></td>
|
||||
|
||||
<td><%= link_to 'Edit', edit_settings_account_path(@settings_account, @settings_account) %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
1
app/views/settings/accounts/show.json.jbuilder
Normal file
1
app/views/settings/accounts/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_accounts/settings_account", settings_account: @settings_account
|
||||
@@ -6,7 +6,7 @@
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Menu Category</h4>
|
||||
@@ -69,7 +69,9 @@
|
||||
<td><%= settings_menu_item.type %></td>
|
||||
<td><%= settings_menu_item.parent.name rescue "-" %></td>
|
||||
<td><%= settings_menu_item.created_by %></td>
|
||||
|
||||
<td><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
|
||||
<% if settings_menu_item.type == "SimpleMenuItem" %>
|
||||
<td><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@settings_menu_category, settings_menu_item ) %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_simple_menu_item_path(@settings_menu_category, settings_menu_item) %></td>
|
||||
@@ -85,4 +87,5 @@
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<%= simple_form_for([:settings, @item, @settings_menu_item_instances]) do |f| %>
|
||||
|
||||
<%= simple_form_for([:settings,:menu_item, @settings_menu_item_instance]) do |f| %>
|
||||
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :item_instance_code %>
|
||||
<%= f.input :item_instance_name %>
|
||||
<%= f.input :price %>
|
||||
|
||||
<%= f.input :item_attributes, collection: MenuItemAttribute.collection, input_html: { multiple: true } %>
|
||||
|
||||
|
||||
<%= f.input :is_on_promotion %>
|
||||
<%= f.input :promotion_price %>
|
||||
<%= f.input :is_available %>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
|
||||
<li><a href="<%= settings_menu_category_simple_menu_item_path(@category,@item) %>">Menu Category</a></li>
|
||||
<li>Menu Item</li>
|
||||
<li>Menu Item Instances</li>
|
||||
@@ -11,4 +12,5 @@
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_menu_item_menu_item_instances: @settings_menu_item_instances %>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
<!-- <h1>New Settings Menu Item</h1>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<%= render 'form', settings_menu_item: @settings_menu_item %>-->
|
||||
|
||||
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
|
||||
<li><a href="<%= settings_menu_category_simple_menu_item_path(@category,@item) %>">Menu Category</a></li>
|
||||
<li>Menu Item</li>
|
||||
<li>New Menu Item Instance</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_simple_menu_item_menu_item_instances: @settings_menu_item_instances %>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_menu_category_simple_menu_item_path(@category,@item) %>">Menu Category</a></li>
|
||||
<li>Menu Item</li>
|
||||
<li>Menu Item Instances</li>
|
||||
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
@@ -12,6 +14,7 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
|
||||
<h4 class="card-title">Menu Item Instance</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
@@ -23,11 +26,13 @@
|
||||
<th>Promotion Price</th>
|
||||
<th>Available</th>
|
||||
<th>Created At</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
|
||||
<td><%= @settings_menu_item_instances.item_instance_code %></td>
|
||||
<td><%= @settings_menu_item_instances.item_instance_name rescue "-" %></td>
|
||||
<td><%= @settings_menu_item_instances.price %></td>
|
||||
@@ -40,9 +45,57 @@
|
||||
<% else %>
|
||||
<td><%= link_to 'Edit', edit_settings_simple_menu_item_menu_item_instance_path(@item,@settings_menu_item_instances) %></td>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Sub Menu Items </h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Item code</th>
|
||||
<th>Name</th>
|
||||
<th>Alt name</th>
|
||||
<th>Type</th>
|
||||
<th>Parent Item</th>
|
||||
<th>Created by</th>
|
||||
<th>Created at</th>
|
||||
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @sub_menu.each do |settings_menu_item| %>
|
||||
<tr>
|
||||
<td><%= settings_menu_item.item_code %></td>
|
||||
<td><%= settings_menu_item.name %></td>
|
||||
<td><%= settings_menu_item.alt_name %></td>
|
||||
<td><%= settings_menu_item.type %></td>
|
||||
<td><%= settings_menu_item.parent.name rescue "-" %></td>
|
||||
<td><%= settings_menu_item.created_by %></td>
|
||||
<td><%=l settings_menu_item.created_at, :format => :short %></td>
|
||||
|
||||
<% if settings_menu_item.type == "SimpleMenuItem" %>
|
||||
<td><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ) %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_simple_menu_item_path(@category, settings_menu_item) %></td>
|
||||
<td><%= link_to 'Destroy', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<% else %>
|
||||
<td><%= link_to 'Show', settings_menu_category_set_menu_item_path(@category, settings_menu_item ) %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_set_menu_item_path(@category, settings_menu_item) %></td>
|
||||
<td><%= link_to 'Destroy', settings_menu_category_set_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<%= paginate @sub_menu, param_name: :page, :outer_window => 3 %>
|
||||
</div>
|
||||
|
||||
@@ -41,13 +41,16 @@
|
||||
<td><%= @settings_menu_item.min_selectable_item %></td>
|
||||
<td><%= @settings_menu_item.max_selectable_item %></td>
|
||||
<td><%= @settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_set_menu_item_path(@category, @settings_menu_item) %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @sub_menu.count > 0 %>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
@@ -76,6 +79,7 @@
|
||||
<td><%= settings_menu_item.type %></td>
|
||||
<td><%= settings_menu_item.parent.name rescue "-" %></td>
|
||||
<td><%= settings_menu_item.created_by %></td>
|
||||
|
||||
<td><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
|
||||
<% if settings_menu_item.type == "SimpleMenuItem" %>
|
||||
@@ -94,6 +98,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<%= paginate @sub_menu, param_name: :page, :outer_window => 3 %>
|
||||
|
||||
<% end %>
|
||||
<br>
|
||||
<div class="card">
|
||||
@@ -128,14 +133,15 @@
|
||||
<td><%= settings_menu_item.price %></td>
|
||||
<td><%= settings_menu_item.is_on_promotion %></td>
|
||||
<td><%= settings_menu_item.promotion_price %></td>
|
||||
<td><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Show', settings_set_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item ) %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_set_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item) %></td>
|
||||
<td><%= link_to 'Destroy', settings_set_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= link_to 'Destroy', settings_set_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li><a href="<%= settings_menu_category_simple_menu_items_path(@category) %>">Menu Category</a></li>
|
||||
|
||||
<li>Menu Item</li>
|
||||
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
@@ -40,14 +42,18 @@
|
||||
<td><%= @settings_menu_item.min_qty %></td>
|
||||
<td><%= @settings_menu_item.min_selectable_item %></td>
|
||||
<td><%= @settings_menu_item.max_selectable_item %></td>
|
||||
|
||||
<td><%= @settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_simple_menu_item_path(@category, @settings_menu_item) %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @sub_menu.count > 0 %>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
@@ -76,8 +82,10 @@
|
||||
<td><%= settings_menu_item.type %></td>
|
||||
<td><%= settings_menu_item.parent.name rescue "-" %></td>
|
||||
<td><%= settings_menu_item.created_by %></td>
|
||||
|
||||
<td><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
|
||||
|
||||
<% if settings_menu_item.type == "SimpleMenuItem" %>
|
||||
<td><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ) %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_menu_category_simple_menu_item_path(@category, settings_menu_item) %></td>
|
||||
@@ -94,12 +102,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<%= paginate @sub_menu, param_name: :page, :outer_window => 3 %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Menu Item Instances
|
||||
<span style="float: right">
|
||||
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_simple_menu_item_menu_item_instance_path(@settings_menu_item),:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
|
||||
@@ -115,6 +126,7 @@
|
||||
<th>promotion_price</th>
|
||||
<th>Created at</th>
|
||||
|
||||
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -122,17 +134,19 @@
|
||||
<tbody>
|
||||
<% @menu_item_instance.each do |settings_menu_item| %>
|
||||
<tr>
|
||||
<!-- <td><%= settings_menu_item.menu_item_id %></td> -->
|
||||
|
||||
<td><%= settings_menu_item.item_instance_code %></td>
|
||||
<td><%= settings_menu_item.item_attributes %></td>
|
||||
<td><%= settings_menu_item.price %></td>
|
||||
<td><%= settings_menu_item.is_on_promotion %></td>
|
||||
<td><%= settings_menu_item.promotion_price %></td>
|
||||
|
||||
<td><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
|
||||
<td><%= link_to 'Show', settings_simple_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item ) %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_simple_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item) %></td>
|
||||
<td><%= link_to 'Destroy', settings_simple_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= link_to 'Destroy', settings_simple_menu_item_menu_item_instance_path(@settings_menu_item, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
27
app/views/transactions/sales/_form.html.erb
Normal file
27
app/views/transactions/sales/_form.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<%= simple_form_for(@transactions_sale) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.association :cashier %>
|
||||
<%= f.input :cashier_name %>
|
||||
<%= f.input :requested_by %>
|
||||
<%= f.input :requested_at %>
|
||||
<%= f.input :receipt_no %>
|
||||
<%= f.input :receipt_date %>
|
||||
<%= f.association :customer %>
|
||||
<%= f.input :payment_status %>
|
||||
<%= f.input :sale_status %>
|
||||
<%= f.input :total_amount %>
|
||||
<%= f.input :total_discount %>
|
||||
<%= f.input :total_tax %>
|
||||
<%= f.input :tax_type %>
|
||||
<%= f.input :grand_total %>
|
||||
<%= f.input :rounding_adjustment %>
|
||||
<%= f.input :amount_received %>
|
||||
<%= f.input :amount_changed %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user