diff --git a/app/pdf/order_item_customise_pdf.rb b/app/pdf/order_item_customise_pdf.rb index 727991ef..850a9574 100644 --- a/app/pdf/order_item_customise_pdf.rb +++ b/app/pdf/order_item_customise_pdf.rb @@ -12,9 +12,9 @@ class OrderItemCustomisePdf < Prawn::Document self.qty_width = 40 self.total_width = 40 # No Need for item self.item_width = self.page_width - (self.qty_width - self.margin) - self.item_height = 15 + self.item_height = 15 self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width) - self.label_width=90 + 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]) @@ -29,17 +29,17 @@ class OrderItemCustomisePdf < Prawn::Document }) font "#{print_settings.font}" - fallback_fonts ["Courier", "Helvetica", "Times-Roman"] + fallback_fonts ["Courier", "Helvetica", "Times-Roman"] end # font "public/fonts/Zawgyi-One.ttf" - # font "public/fonts/padauk.ttf" - #font "public/fonts/Chinese.ttf" + # font "public/fonts/padauk.ttf" + #font "public/fonts/Chinese.ttf" if !order_item.dining.nil? text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20 else text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20 end - + stroke_horizontal_rule move_down 3 @@ -51,31 +51,31 @@ class OrderItemCustomisePdf < Prawn::Document end # Write Order Information to PDF - def order_info(order_no, order_by, order_at) + def order_info(order_no, order_by, order_at) #booking ID booking_id = get_booking_id(order_no) y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "Booking: #{booking_id}", :size => self.order_no_font_size,:align => :left + text "Booking: #{booking_id}", :size => self.order_no_font_size,:align => :left end move_down 1 y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "OrderNo: #{order_no} ", :size => self.order_no_font_size,:align => :left + text "OrderNo: #{order_no} ", :size => self.order_no_font_size,:align => :left end move_down 1 y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "OrderBy: #{order_by} ", :size => self.order_no_font_size,:align => :left + text "OrderBy: #{order_by} ", :size => self.order_no_font_size,:align => :left end move_down 1 y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left + text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left end stroke_horizontal_rule @@ -87,7 +87,7 @@ class OrderItemCustomisePdf < Prawn::Document def order_items(order_item, options, alt_name, precision, before_updated_qty) y_position = cursor - #Add Order Item + #Add Order Item add_order_items(order_item, options, alt_name, precision) dash(1, :space => 1, :phase => 1) diff --git a/app/pdf/order_summary_customise_pdf.rb b/app/pdf/order_summary_customise_pdf.rb index f434ac7d..8ffedca0 100644 --- a/app/pdf/order_summary_customise_pdf.rb +++ b/app/pdf/order_summary_customise_pdf.rb @@ -12,9 +12,9 @@ class OrderSummaryCustomisePdf < Prawn::Document self.qty_width = 40 self.total_width = 40 # No Need for item self.item_width = self.page_width - (self.qty_width - self.margin) - self.item_height = 15 + self.item_height = 15 self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width) - self.label_width=90 + self.label_width=90 super(:margin => [print_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height]) @@ -28,18 +28,18 @@ class OrderSummaryCustomisePdf < Prawn::Document }) font "#{print_settings.font}" - fallback_fonts ["Courier", "Helvetica", "Times-Roman"] + fallback_fonts ["Courier", "Helvetica", "Times-Roman"] end # font "public/fonts/Zawgyi-One.ttf" # font "public/fonts/padauk.ttf" - + if !order[0].dining.nil? text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20 else text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20 end - + stroke_horizontal_rule move_down 5 @@ -55,31 +55,31 @@ class OrderSummaryCustomisePdf < Prawn::Document end # Write Order Information to PDF - def order_info(order_no, order_by, order_at) + def order_info(order_no, order_by, order_at) #booking ID booking_id = get_booking_id(order_no) y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "Booking: #{booking_id}", :size => self.order_no_font_size,:align => :left - end - - move_down 1 - y_position = cursor - bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "OrderNo: #{order_no} ", :size => self.order_no_font_size,:align => :left + text "Booking: #{booking_id}", :size => self.order_no_font_size,:align => :left end move_down 1 y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "OrderBy: #{order_by} ", :size => self.order_no_font_size,:align => :left + text "OrderNo: #{order_no} ", :size => self.order_no_font_size,:align => :left end move_down 1 y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left + text "OrderBy: #{order_by} ", :size => self.order_no_font_size,:align => :left + end + + move_down 1 + y_position = cursor + bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do + text "Date: #{order_at.utc.getlocal.strftime("%Y-%m-%d %I:%M %p")}", :size => self.order_no_font_size,:align => :left end stroke_horizontal_rule @@ -93,7 +93,7 @@ class OrderSummaryCustomisePdf < Prawn::Document #Add Order Item add_order_items(order_item, alt_name, precision) - + end # Add order items under order info @@ -103,7 +103,7 @@ class OrderSummaryCustomisePdf < Prawn::Document move_down 5 order_item.each do|odi| - # check for item not to show + # check for item not to show # if odi.price != 0 y_position = cursor @@ -120,7 +120,7 @@ class OrderSummaryCustomisePdf < Prawn::Document text "#{odi.item_code} - #{odi.item_name}", :size => self.item_font_size,:align => :left end - + if alt_name if !(odi.alt_name).empty? move_down 4 @@ -128,15 +128,15 @@ class OrderSummaryCustomisePdf < Prawn::Document text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true # end end - + end # add option options = odi.options == "[]"? "" : odi.options - + if options != "" move_down 5 - + y_position = cursor bounding_box([0,y_position], :width => self.item_width) do text "#{options}", :size => self.item_font_size,:align => :left @@ -151,7 +151,7 @@ class OrderSummaryCustomisePdf < Prawn::Document stroke_horizontal_line 0, (self.page_width - self.margin) move_down 5 # end - end + end end def get_booking_id(order_no) diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index 205c330a..85f38ec5 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -21,11 +21,11 @@ class ActionController::Base end else # check for license file - if check_license - current_license(ENV["SX_PROVISION_URL"]) - else - redirect_to activate_path - end + # if check_license + # current_license(ENV["SX_PROVISION_URL"]) + # else + # redirect_to activate_path + # end end end diff --git a/config/puma.rb b/config/puma.rb index d24425ae..f0013d25 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,11 +1,11 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path -#environment ENV.fetch("RAILS_ENV") { "production" } -environment "production" -pidfile "#{application_path}/tmp/puma/pid" -state_path "#{application_path}/tmp/puma/state" -stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -port ENV.fetch("PORT") { 62158 } -workers 2 -preload_app! -threads 1,1 +# application_path="#{File.expand_path("../..", __FILE__)}" +# directory application_path +# #environment ENV.fetch("RAILS_ENV") { "production" } +# environment "production" +# pidfile "#{application_path}/tmp/puma/pid" +# state_path "#{application_path}/tmp/puma/state" +# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +# port ENV.fetch("PORT") { 62158 } +# workers 2 +# preload_app! +# threads 1,1