Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into crm

This commit is contained in:
Aung Myo
2017-07-04 10:38:38 +06:30
7 changed files with 31 additions and 17 deletions

View File

@@ -17,7 +17,7 @@ class Oqs::HomeController < BaseOqsController
@queue_items_details.each do |qid|
dining = DiningFacility.find_by_name(qid.zone)
que.order_queue_process_by_zones.each do |qz|
if qid.station_id == qz.order_queue_station_id && qid.zone_id == dining.zone_id
if qid.station_id == qz.order_queue_station_id && qid.zone_id == qz.zone_id
zone_id = qid.zone_id
i=i+1
end

View File

@@ -13,7 +13,7 @@ class OrderQueueStation < ApplicationRecord
def process_order (order, table_id)
oqs_stations = OrderQueueStation.active
dining=DiningFacility.find(table_id)
oqpbz = OrderQueueProcessByZone.find_by_zone_id(dining.zone_id)
# oqpbz = OrderQueueProcessByZone.find_by_zone_id(dining.zone_id)
order_items = order.order_items
@@ -47,12 +47,16 @@ class OrderQueueStation < ApplicationRecord
end
# Auto Printing
# ToDo per item per printer
if oqs.auto_print && is_auto_printed == false
if oqs_order_items.length > 0
print_slip(oqs, order, oqs_order_items)
is_auto_printed = true
end
end
OrderQueueProcessByZone.where("zone_id=#{dining.zone_id}").find_each do |oqpbz|
if oqs.id == oqpbz.order_queue_station_id
if oqs.auto_print
if oqs_order_items.length > 0
print_slip(oqs, order, oqs_order_items)
is_auto_printed = true
end
end
end
end
end
end

View File

@@ -1,7 +1,7 @@
class OrderItemPdf < Prawn::Document
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
def initialize(print_settings,order_item, print_status, options, alt_name)
self.page_width = 210
self.page_width = 180
self.page_height = 1450
self.margin = 5
self.price_width = 40 # No Need for item
@@ -10,7 +10,7 @@ class OrderItemPdf < Prawn::Document
self.item_width = self.page_width - self.qty_width
self.item_height = 15
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
self.label_width=100
self.label_width=90
super(:margin => [print_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
# super(:margin => [10, 5, 30, 5], :page_size => [200,400])
@@ -90,7 +90,7 @@ class OrderItemPdf < Prawn::Document
if alt_name
move_down 4
font("public/fonts/Chinese.ttf") do
font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end
end

View File

@@ -1,7 +1,7 @@
class OrderSummaryPdf < Prawn::Document
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
def initialize(print_settings,order, print_status, order_items = nil,alt_name)
self.page_width = 210
self.page_width = 180
self.page_height = 1450
self.margin = 5
self.price_width = 40 # No Need for item
@@ -10,7 +10,7 @@ class OrderSummaryPdf < Prawn::Document
self.item_width = self.page_width - (self.qty_width - self.margin)
self.item_height = 15
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
self.label_width=100
self.label_width=90
super(:margin => [print_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
@@ -106,7 +106,7 @@ class OrderSummaryPdf < Prawn::Document
if alt_name
move_down 4
font("public/fonts/Chinese.ttf") do
font("public/fonts/NotoSansCJKtc-Regular.ttf") do
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
end

View File

@@ -25,7 +25,7 @@
<td><%= link_to employee.name,settings_employee_path(employee) %></td>
<td><%= employee.role %></td>
<td>
<%= link_to 'Edit', edit_settings_employee_path(employee) %> | <%= link_to 'Destroy', settings_employee_path(employee), method: :delete, data: { confirm: 'Are you sure?' } %></td>
<%= link_to 'Edit', edit_settings_employee_path(employee) %> | <%= link_to 'Destroy', settings_employee_path(employee) , method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>

View File

@@ -1,7 +1,17 @@
# :concurrency: 25
# :pidfile: /home/superuser/Application/production/sxrestaurant/tmp/pids/sidekiq.pid
# :logfile: /home/superuser/Application/production/sxrestaurant/log/sidekiq.log
# :queues:
# - default
# - [high_priority, 2]
# :demon: true
---
:concurrency: 25
:pidfile: /home/superuser/Application/production/sxrestaurant/tmp/pids/sidekiq.pid
:logfile: /home/superuser/Application/production/sxrestaurant/log/sidekiq.log
:pidfile: ./tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log
:queues:
- default
- [high_priority, 2]
:demon: true

Binary file not shown.