diff --git a/README.md b/README.md index 0605a14a..dfebed49 100755 --- a/README.md +++ b/README.md @@ -188,6 +188,10 @@ Add Base URL for DOEMAL 1) settings/lookups => { type:order_reservation, name: BaseURL, value:'{doemal url}' } 2) settings/lookups => { type:order_reservation, name: Token, value:'{doemal token}' } +Add Feature for Dine-in Cashier + ** '0' means can not use dine-in cashier and '1' means can use dine-in cashier ** + => settings/lookups => { type:dinein_cashier, name: DineInCashier, value:'{0 or 1}' } + Add Feature for Quick Service ** '0' means can not use quick service and '1' means can use quick service ** => settings/lookups => { type:quick_service, name: QuickService, value:'{0 or 1}' } diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index c60accdf..07eab9e1 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -33,6 +33,7 @@ $(function() { $("#accepted").on("click", function(){ if($(this).text().trim() == "ACCEPT"){ + $("#status").text($(this).attr("data-value")); var requested_time = $("#requested_date_time").text(); $("#requested_order_time").text(requested_time); showTimePicker(requested_time); @@ -65,14 +66,17 @@ $(function() { var waiting_time = new Date(date_time+' '+$("#waiting_time").val()); // requested_time.setHours(requested_time.getHours() - 1); // console.log(requested_time); + // console.log(date_time); if(waiting_time.getTime() < requested_time.getTime()){ var time_diff = (requested_time.getTime() - waiting_time.getTime()); var expected_time = (Math.floor(time_diff) / 1000) / 60; - callback_url(callback,ref_no,order_id,status,expected_time,waiting_time); }else{ - $("#waiting_time").val(""); - $("#waiting_timeErr").text("Expected waiting time is greater than requested time!"); + var time_diff = (waiting_time.getTime() - requested_time.getTime()); + var expected_time = (Math.floor(time_diff) / 1000) / 60; + // $("#waiting_time").val(""); + // $("#waiting_timeErr").text("Expected waiting time is greater than requested time!"); } + callback_url(callback,ref_no,order_id,status,expected_time,waiting_time); }); }); @@ -278,9 +282,9 @@ function callback_url(callback,ref_no,order_id,status,time,exptime){ function timeFormat(date){ var isPM = date.getHours() >= 12; var isMidday = date.getHours() == 12; - var time = [date.getHours() - (isPM && !isMidday ? 12 : 0), - date.getMinutes() || '00'].join(':') + - (isPM ? ' PM' : 'AM'); + var time = [(date.getHours()>10? date.getHours() : '0'+date.getHours()) - (isPM && !isMidday ? 12 : 0), + (date.getMinutes()>10? date.getMinutes() : '0'+date.getMinutes()) || '00'].join(':') + + (isPM ? ' PM' : ' AM'); return time; } diff --git a/app/assets/stylesheets/addorder.scss b/app/assets/stylesheets/addorder.scss index d8adba16..ba1089d2 100755 --- a/app/assets/stylesheets/addorder.scss +++ b/app/assets/stylesheets/addorder.scss @@ -247,4 +247,27 @@ i.logout_icon{ } .list-menu > a:hover{ text-decoration: none; +} +.cashier_number{ + width: 33%; + height:58px; + line-height:58px; + text-align:center; + background:#54A5AF; + // float:left; + // margin:2px; + font-size:20px; + color:white; + // cursor:pointer; +} +.border-top{ + border-top:1px solid #fff; +} + +.border-right{ + border-right:1px solid #fff; +} + +.border-left{ + border-left:1px solid #fff; } \ No newline at end of file diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 212c5288..903846df 100755 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -10,6 +10,7 @@ @import "BSBMaterial/style"; @import "BSBMaterial/themes/all-themes"; @import "reset"; +@import "fileinput.min"; /* Reset */ diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index 3cb1eacc..61cbac84 100755 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -5,6 +5,7 @@ class BaseOrigamiController < ActionController::Base before_action :check_user #before_action :check_installation + protect_from_forgery with: :exception helper_method :shop_detail, :current_token @@ -14,18 +15,14 @@ class BaseOrigamiController < ActionController::Base redirect_to origami_dashboard_path end - def check_user + def check_user if check_mobile if current_user.nil? return render status: 401, json: { message: "User using other device!" }.to_json end - else - if ENV["SERVER_MODE"] != 'cloud' - protect_from_forgery with: :exception - end - + else if current_user.nil? redirect_to root_path end diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 1d0ad8e4..97f75135 100755 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -96,7 +96,7 @@ class Crm::CustomersController < BaseCrmController # POST /crm/customers # POST /crm/customers.json - def create + def create # Remove "" default first params[:customer][:tax_profiles].delete_at(0) @crm_customers = Customer.new(customer_params) diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb index 100635cd..a9820011 100755 --- a/app/controllers/origami/addorders_controller.rb +++ b/app/controllers/origami/addorders_controller.rb @@ -18,9 +18,6 @@ class Origami::AddordersController < BaseOrigamiController if check_mobile @webview = true end - - today = DateTime.now - day = Date.today.wday @menus = Menu.all @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc') @table_id = params[:id] diff --git a/app/controllers/origami/dashboard_controller.rb b/app/controllers/origami/dashboard_controller.rb index 8bdd5c27..027b89a5 100644 --- a/app/controllers/origami/dashboard_controller.rb +++ b/app/controllers/origami/dashboard_controller.rb @@ -56,6 +56,13 @@ class Origami::DashboardController < BaseOrigamiController # get printer info @print_settings = PrintSetting.get_precision_delimiter() @current_user = current_user + #dine-in cashier + dinein_cashier = Lookup.collection_of('dinein_cashier') + @dinein_cashier = 0 + if !dinein_cashier[0].nil? + @dinein_cashier = dinein_cashier[0][1] + end + #quick service quick_service = Lookup.collection_of('quick_service') @quick_service = 0 diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index ed857104..e2f15d19 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -132,7 +132,7 @@ class Origami::HomeController < BaseOrigamiController def check_emp_access_code pin_code = params[:code] employee = Employee.find_by_emp_id(pin_code) - if employee && employee.role == "manager" + if employee && (employee.role == "manager" || employee.role == "supervisor") result = {:status=> true, :message=>"Success" } else result = {:status=> false, :message=>"Invalid Access Code" } diff --git a/app/controllers/origami/order_reservation_controller.rb b/app/controllers/origami/order_reservation_controller.rb index 12a3ee2f..32f0e63d 100644 --- a/app/controllers/origami/order_reservation_controller.rb +++ b/app/controllers/origami/order_reservation_controller.rb @@ -1,7 +1,7 @@ class Origami::OrderReservationController < BaseOrigamiController def index - @order = OrderReservation.latest_order + @order = OrderReservation.latest_order #.active @count_on_order = OrderReservation.get_count_on_order end diff --git a/app/controllers/origami/other_charges_controller.rb b/app/controllers/origami/other_charges_controller.rb index 28ab2c06..4b94990b 100755 --- a/app/controllers/origami/other_charges_controller.rb +++ b/app/controllers/origami/other_charges_controller.rb @@ -15,12 +15,11 @@ class Origami::OtherChargesController < BaseOrigamiController @table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id) else @table = nil - end - + end end end - def create + def create sale_id = params[:sale_id] other_charges_items = JSON.parse(params[:other_charges_items]) sub_total = params[:sub_total] @@ -79,8 +78,6 @@ class Origami::OtherChargesController < BaseOrigamiController if !table.nil? dining = {:table_id => table_id, :table_type => table.type } render :json => dining.to_json - end - - end - + end + end end \ No newline at end of file diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 3c5219af..7df42118 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -279,6 +279,9 @@ class Origami::PaymentsController < BaseOrigamiController new_total = Sale.get_rounding_adjustment(saleObj.grand_total) @rounding_adj = new_total-saleObj.grand_total saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:@rounding_adj) + @sale_data.grand_total = new_total + @sale_data.old_grand_total = saleObj.grand_total + @sale_data.rounding_adjustment = @rounding_adj else @rounding_adj = @sale_data.rounding_adjustment end diff --git a/app/models/order_queue_station.rb b/app/models/order_queue_station.rb index 889491ed..1541828c 100755 --- a/app/models/order_queue_station.rb +++ b/app/models/order_queue_station.rb @@ -57,7 +57,11 @@ class OrderQueueStation < ApplicationRecord if oqs.auto_print && order_source != "quick_service" if oqs_order_items.length > 0 - print_slip(oqs, order, oqs_order_items) + if oqs.cut_per_item + print_slip_item(oqs, order, oqs_order_items) + else + print_slip(oqs, order, oqs_order_items) + end is_auto_printed = true end end @@ -91,8 +95,12 @@ class OrderQueueStation < ApplicationRecord end if oqs.auto_print && order_source != "quick_service" - if oqs_order_items.length > 0 - print_slip(oqs, order, oqs_order_items) + if oqs_order_items.length > 0 + if oqs.cut_per_item + print_slip_item(oqs, order, oqs_order_items) + else + print_slip(oqs, order, oqs_order_items) + end is_auto_printed = true end end @@ -137,8 +145,12 @@ class OrderQueueStation < ApplicationRecord end if oqs.auto_print - if oqs_order_items.length > 0 - print_slip(oqs, order, oqs_order_items) + if oqs_order_items.length > 0 + if oqs.cut_per_item + print_slip_item(oqs, order, oqs_order_items) + else + print_slip(oqs, order, oqs_order_items) + end is_auto_printed = true end end @@ -165,8 +177,12 @@ class OrderQueueStation < ApplicationRecord end if oqs.auto_print - if oqs_order_items.length > 0 - print_slip(oqs, order, oqs_order_items) + if oqs_order_items.length > 0 + if oqs.cut_per_item + print_slip_item(oqs, order, oqs_order_items) + else + print_slip(oqs, order, oqs_order_items) + end is_auto_printed = true end end @@ -211,7 +227,7 @@ class OrderQueueStation < ApplicationRecord end #Print order_item in 1 slip per item - def print_slip_item(oqs, assigned_item) + def print_slip_item(oqs, order, assigned_items) order_slim_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf unique_code="OrderItemPdf" if !order_slim_pdf.empty? @@ -232,14 +248,17 @@ class OrderQueueStation < ApplicationRecord end end - order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first() + # order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first() # print when complete click 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, oqs,item.order_id, order_item.order_items_id, print_status="" ) - + if !assigned_items.nil? + assigned_items.each do |order_item| + order_queue_printer.print_order_item(print_settings, oqs,order_item.order_id, order_item.order_items_id, print_status="" ) + end + end # update print status for completed same order items - assigned_order_item.each do |ai| + AssignedOrderItem.where("order_id = '#{ order.order_id }'").find_each do |ai| ai.print_status=true ai.save end diff --git a/app/models/order_reservation.rb b/app/models/order_reservation.rb index e5b95f8c..f4f610fc 100644 --- a/app/models/order_reservation.rb +++ b/app/models/order_reservation.rb @@ -7,6 +7,7 @@ class OrderReservation < ApplicationRecord has_many :order_reservation_items has_one :delivery + scope :active, -> { where("created_at BETWEEN '#{DateTime.now.utc.beginning_of_day}' AND '#{DateTime.now.utc.end_of_day}'") } scope :latest_order, -> { order("order_reservation_id desc, created_at desc") } SEND_TO_KITCHEN = "send_to_kitchen" @@ -218,7 +219,7 @@ class OrderReservation < ApplicationRecord def self.check_order_send_to_kitchen today = Time.now.utc - order_reservation = OrderReservation.where("status='accepted' and requested_time > '#{today}'") + order_reservation = OrderReservation.where("status='accepted' and requested_time > '#{today}' and expected_waiting_time < '#{today}'") if order_reservation.length > 0 if ENV["SERVER_MODE"] == 'cloud' ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation @@ -228,7 +229,7 @@ class OrderReservation < ApplicationRecord def self.check_order_ready_to_delivery today = Time.now.utc - order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time > '#{today}'") + order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time > '#{today}' and expected_waiting_time < '#{today}'") if order_reservation.length > 0 if ENV["SERVER_MODE"] == 'cloud' ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation diff --git a/app/pdf/order_set_item_pdf.rb b/app/pdf/order_set_item_pdf.rb index 1e7b9c7f..14a8ff62 100755 --- a/app/pdf/order_set_item_pdf.rb +++ b/app/pdf/order_set_item_pdf.rb @@ -4,8 +4,8 @@ class OrderSetItemPdf < Prawn::Document def initialize(print_settings,order_set_item, print_status, options, alt_name, before_updated_qty) self.page_width = print_settings.page_width self.page_height = print_settings.page_height - self.header_font_size = printer_settings.header_font_size.to_i - self.item_font_size = printer_settings.item_font_size.to_i + self.header_font_size = print_settings.header_font_size.to_i + self.item_font_size = print_settings.item_font_size.to_i self.margin = 0 self.price_width = 40 # No Need for item self.qty_width = 40 diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 95a6a277..59e6a320 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -206,7 +206,6 @@ class ReceiptBillPdf < Prawn::Document total_price = item.price #item.qty*item.unit_price - comment for room charges price = item.unit_price product_name = item.product_name - total_qty += item.qty y_position = cursor diff --git a/app/uploaders/commissioner_image_uploader.rb b/app/uploaders/commissioner_image_uploader.rb index 639ce7d7..266abc77 100644 --- a/app/uploaders/commissioner_image_uploader.rb +++ b/app/uploaders/commissioner_image_uploader.rb @@ -19,6 +19,10 @@ class CommissionerImageUploader < CarrierWave::Uploader::Base # "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end + def filename + "#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present? + end + # def cache_dir # '/tmp/images' # end diff --git a/app/uploaders/customer_image_uploader.rb b/app/uploaders/customer_image_uploader.rb index 1de0f3ad..f931ceaa 100644 --- a/app/uploaders/customer_image_uploader.rb +++ b/app/uploaders/customer_image_uploader.rb @@ -19,6 +19,10 @@ class CustomerImageUploader < CarrierWave::Uploader::Base # "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end + def filename + "#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present? + end + # def cache_dir # '/tmp/images' # end diff --git a/app/uploaders/employee_image_uploader.rb b/app/uploaders/employee_image_uploader.rb index fd64db42..b247ab2c 100644 --- a/app/uploaders/employee_image_uploader.rb +++ b/app/uploaders/employee_image_uploader.rb @@ -19,6 +19,10 @@ class EmployeeImageUploader < CarrierWave::Uploader::Base # "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end + def filename + "#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present? + end + # def cache_dir # '/tmp/images' # end diff --git a/app/uploaders/menu_item_image_uploader.rb b/app/uploaders/menu_item_image_uploader.rb index 90755159..4d1834fa 100755 --- a/app/uploaders/menu_item_image_uploader.rb +++ b/app/uploaders/menu_item_image_uploader.rb @@ -19,6 +19,10 @@ class MenuItemImageUploader < CarrierWave::Uploader::Base # "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end + def filename + "#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present? + end + # def cache_dir # '/tmp/images' # end diff --git a/app/uploaders/product_image_uploader.rb b/app/uploaders/product_image_uploader.rb index fd037f0a..c8aeca8c 100755 --- a/app/uploaders/product_image_uploader.rb +++ b/app/uploaders/product_image_uploader.rb @@ -19,6 +19,10 @@ class ProductImageUploader < CarrierWave::Uploader::Base # "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end + def filename + "#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present? + end + # def cache_dir # '/tmp/images' # end diff --git a/app/uploaders/shop_image_uploader.rb b/app/uploaders/shop_image_uploader.rb index 63a01c21..66d6d9c8 100644 --- a/app/uploaders/shop_image_uploader.rb +++ b/app/uploaders/shop_image_uploader.rb @@ -19,6 +19,10 @@ class ShopImageUploader < CarrierWave::Uploader::Base # "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end + def filename + "#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present? + end + # def cache_dir # '/tmp/images' # end diff --git a/app/views/crm/customers/edit.json.jbuilder b/app/views/crm/customers/edit.json.jbuilder index 60148085..555989a4 100755 --- a/app/views/crm/customers/edit.json.jbuilder +++ b/app/views/crm/customers/edit.json.jbuilder @@ -1,4 +1,4 @@ json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, - :salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :tax_profiles + :salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :image_path, :tax_profiles json.url crm_customer_url(@crm_customer, format: :json) \ No newline at end of file diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index 87f3cabd..96f1f985 100755 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -185,7 +185,7 @@ $(document).on('click',".customer_tr",function(){ url: url, data: {}, dataType: "json", - success: function(data) { + success: function(data) { // Selected for Taxes var taxes = JSON.stringify(data.tax_profiles); var parse_taxes = JSON.parse(taxes); @@ -193,7 +193,7 @@ $(document).on('click',".customer_tr",function(){ $("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'}); }); - $('#customer_id').val(data.id); + $('#customer_id').val(data.id); $('#customer_name').val(data.name); $('#customer_company').val(data.company); $('#customer_contact_no').val(data.contact_no); @@ -205,6 +205,9 @@ $(document).on('click',".customer_tr",function(){ $('#paypar_account_no').val(data.paypar_account_no); $('#customer_address').val(data.address); $('#customer_date_of_birth').val(data.date_of_birth); + if(data.image_path.url!=undefined && data.image_path.url!=null){ + $('.menu-item-img .img-thumbnail').attr('src',data.image_path.url); + } $('#customer_membership_type').val(data.membership_type); $('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected'); if (data.gender == 'Male') { diff --git a/app/views/crm/customers/show.json.jbuilder b/app/views/crm/customers/show.json.jbuilder index ffc312a2..3a6a8cb9 100755 --- a/app/views/crm/customers/show.json.jbuilder +++ b/app/views/crm/customers/show.json.jbuilder @@ -1,4 +1,4 @@ json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, - :salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :tax_profiles + :salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :image_path, :tax_profiles json.url crm_customer_url(@crm_customer, format: :json) diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index 7e8cbb2c..241fe79c 100644 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -43,46 +43,46 @@ Products <% @menu.each do |menu| %> - <% if !menu.valid_time.nil? %> - <% if menu.menu_category_id.nil? %> - - <% if type %> - <% if !menu.code.include? "SPL" %> - - <% end%> - - <% else %> - <% if @table.get_current_checkout_booking.nil? %> - <% if !menu.code.include? "SPL" %> - - <% end%> - <% else %> - - <% end%> - - <% end %> - <% end%> - <% end %> - <%end %> - + <% if !menu.valid_time.nil? %> + <% if menu.menu_category_id.nil? %> + + <% if type %> + <% if !menu.code.include? "SPL" %> + + <% end%> + + <% else %> + <% if @table.get_current_checkout_booking.nil? %> + <% if !menu.code.include? "SPL" %> + + <% end%> + <% else %> + + <% end%> + + <% end %> + <% end%> + <% end %> + <%end %> + @@ -313,7 +313,7 @@
9
0
00
-
Clr
+
Clr
+
+ +
+ + <%= f.file_field :image_path, :class => "img-thumbnail" %> +
+
+
+
+
1
+
2
+
3
+
4
+
+
+
5
+
6
+
7
+
8
+
+
+
9
+
0
+
Clr
+
OK
+ +
+
+ + + + + diff --git a/app/views/reports/waste_and_spoilage/index.xls.erb b/app/views/reports/waste_and_spoilage/index.xls.erb index 4b4fa0a3..48f26650 100755 --- a/app/views/reports/waste_and_spoilage/index.xls.erb +++ b/app/views/reports/waste_and_spoilage/index.xls.erb @@ -5,52 +5,77 @@
Report For <%= @sale_type? @sale_type : 'Waste' %>
- <% @sale_data.each do |sale| %> + <% receipt_arr = Array.new %> + <% menu_cat_arr = Array.new %> + <% footer_arr = Array.new %> + <% count = 0 %> <% waste_and_spoil_item_count = 0%> - - - - - - - - - - - - - - - + + <% @sale_data.each do |sale| %> + <% if !receipt_arr.include?(sale.receipt_no) %> + + + + + + + + + + + + + + + + + + <% receipt_arr.push(sale.receipt_no) %> + <% menu_cat_arr.clear %> + <% count = 0 %> + <% end %> - <% sale.sale_items.each do |item| %> - <% if !item.item_instance_code.nil?%> - <% waste_and_spoil_item_count += item.qty.to_i%> - - - - - - - - <% end %> - <% end %> - - - - - - - - <% end %> + + + <% if !sale.item_instance_code.nil?%> + <% waste_and_spoil_item_count += sale.qty.to_i %> + + <% if !menu_cat_arr.include?(sale.name) %> + + <% menu_cat_arr.push(sale.name) %> + <% else %> + + <% end %> + + + + + + + <% end %> + <% count = count + 1 %> + <% if sale.sale_items.count == count %> + + + + + + + + <% footer_arr.push(sale.sale_id) %> + <% end %> + + <% end %>
- Receipt No :<%= sale.receipt_no %> - Date : <%= sale.created_at.utc.getlocal.strftime("%e,%b %Y %I:%M %p") %>
Item NameItem CodeQtyPriceTotal Price
 
+ Receipt No :<%= sale.receipt_no %> + Date : <%= sale.created_at.utc.getlocal.strftime("%e,%b %Y %I:%M %p") %>
Menu CategoryItem NameItem CodeQtyPriceTotal Price
<%= item.product_name %><%= item.product_code %><%= item.qty %><%= item.price %><%= item.price %>
Total Qty: - <%= waste_and_spoil_item_count %> - Grand Total: - - <%= sale.grand_total %> - -
<%= sale.name %> <%= sale.product_name %><%= sale.product_code %><%= sale.qty.to_i %><%= sale.unit_price %><%= sale.price %>
Total Qty: + + <%= waste_and_spoil_item_count %> + <% waste_and_spoil_item_count = 0%> + Grand Total: + + <%= sale.grand_total %> + +
diff --git a/config/cable.yml b/config/cable.yml deleted file mode 100755 index a383c5af..00000000 --- a/config/cable.yml +++ /dev/null @@ -1,7 +0,0 @@ -redis: &redis - adapter: redis - url: redis://localhost:6379/1 - -production: *redis -development: *redis -test: *redis \ No newline at end of file diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index a3b19ebe..b84bca54 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -8,7 +8,7 @@ class ActionController::Base from = request.subdomain.downcase + "." + request.domain.downcase @license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase if (!@license.nil?) - logger.info "Location - " + @license.dbhost + logger.info "Location - " + @license.dbschema ActiveRecord::Base.establish_connection(website_connection(@license)) # authenticate_session_token # logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema @@ -97,7 +97,7 @@ class ActionController::API from = request.subdomain.downcase + "." + request.domain.downcase @license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase if (!@license.nil?) - # logger.info "Location - " + @license.dbhost + logger.info "Location - " + @license.dbschema ActiveRecord::Base.establish_connection(website_connection(@license)) # authenticate_session_token # logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema diff --git a/config/puma.rb b/config/puma.rb deleted file mode 100755 index c8e0145e..00000000 --- a/config/puma.rb +++ /dev/null @@ -1,48 +0,0 @@ -# Puma can serve each request in a thread from an internal thread pool. -# The `threads` method setting takes two numbers a minimum and maximum. -# Any libraries that use thread pools should be configured to match -# the maximum value specified for Puma. Default is set to 5 threads for minimum -# and maximum, this matches the default thread size of Active Record. -# -threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i -threads threads_count, threads_count - -# Specifies the `port` that Puma will listen on to receive requests, default is 3000. -# -port ENV.fetch("PORT") { 3000 } - -# Specifies the `environment` that Puma will run in. -# -environment ENV.fetch("RAILS_ENV") { "development" } - -# Specifies the number of `workers` to boot in clustered mode. -# Workers are forked webserver processes. If using threads and workers together -# the concurrency of the application would be max `threads` * `workers`. -# Workers do not work on JRuby or Windows (both of which do not support -# processes). -# -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } - -# Use the `preload_app!` method when specifying a `workers` number. -# This directive tells Puma to first boot the application and load code -# before forking the application. This takes advantage of Copy On Write -# process behavior so workers use less memory. If you use this option -# you need to make sure to reconnect any threads in the `on_worker_boot` -# block. -# -# preload_app! - -# The code in the `on_worker_boot` will be called if you are using -# clustered mode by specifying a number of `workers`. After each worker -# process is booted this block will be run, if you are using `preload_app!` -# option you will want to use this block to reconnect to any threads -# or connections that may have been created at application boot, Ruby -# cannot share connections between processes. -# -# on_worker_boot do -# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) -# end - -# Allow puma to be restarted by `rails restart` command. - -plugin :tmp_restart diff --git a/config/schedule.rb b/config/schedule.rb index 8f151e3d..fc38bc2a 100755 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -14,14 +14,14 @@ every 1.minutes do runner "DiningFacility.checkin_time" end -every 3.minutes do +every 10.minutes do runner "OrderReservation.check_new_order" end -every 5.minutes do +every 10.minutes do runner "OrderReservation.check_order_send_to_kitchen" end -every 5.minutes do +every 10.minutes do runner "OrderReservation.check_order_ready_to_delivery" end \ No newline at end of file