From 109d1b643523811d5655ea1baa8de45f9af1f86f Mon Sep 17 00:00:00 2001 From: Nweni Date: Wed, 14 Jun 2017 18:56:11 +0630 Subject: [PATCH] update --- app/forms/shop_form.rb | 8 ++++---- app/pdf/receipt_bill_pdf.rb | 14 ++++++-------- app/reports/menu_report.rb | 10 +++++----- app/views/kaminari/_paginator.html.erb | 12 ++++++------ 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/app/forms/shop_form.rb b/app/forms/shop_form.rb index 19af84a5..179e73fd 100644 --- a/app/forms/shop_form.rb +++ b/app/forms/shop_form.rb @@ -1,7 +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 +# class ShopForm < ActiveModel +# # attr_accessor :logo, :name, :address, :township, :city, :state, :country, :license, :base_currency, :password, :password_confirmation +# +# end diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index dbaea572..c03e7791 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -8,9 +8,9 @@ class ReceiptBillPdf < Prawn::Document self.qty_width = 20 self.total_width = 40 self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width)+(self.margin*4)) - 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=80 + self.label_width=80 # @item_width = self.page_width.to_i / 2 # @qty_width = @item_width.to_i / 3 @@ -31,7 +31,7 @@ class ReceiptBillPdf < Prawn::Document cashier_info(sale_data, customer_name) line_items(sale_items, food_total, beverage_total) - all_total(sale_data) + all_total(sale_data) footer end @@ -96,7 +96,7 @@ class ReceiptBillPdf < Prawn::Document stroke_horizontal_rule add_line_item_row(sale_items, food_total, beverage_total) - + end def add_line_item_row(sale_items, food_total, beverage_total) @@ -110,17 +110,15 @@ class ReceiptBillPdf < Prawn::Document total_price = item.qty*item.unit_price price = item.unit_price product_name = item.product_name - + y_position = cursor pad_top(15) { - # @item_width.to_i + @half_qty.to_i text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :overflow => :shrink_to_fix, :size => self.item_font_size, :overflow => :shrink_to_fix text_box "#{price}", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix text_box "#{qty.to_i}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix text_box "#{total_price}", :at =>[(item_name_width+2),y_position], :width =>self.total_width+2, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix - } move_down 3 end @@ -151,7 +149,7 @@ class ReceiptBillPdf < Prawn::Document end def all_total(sale_data) - item_name_width = self.item_width + item_name_width = self.item_width move_down 5 y_position = cursor diff --git a/app/reports/menu_report.rb b/app/reports/menu_report.rb index ca430f0a..2a17e851 100644 --- a/app/reports/menu_report.rb +++ b/app/reports/menu_report.rb @@ -1,5 +1,5 @@ -class MenuReport < Compendium::Report - query :list, collect: :active_record do |params| - Menu.all - end -end +# class MenuReport < Compendium::Report +# query :list, collect: :active_record do |params| +# Menu.all +# end +# end diff --git a/app/views/kaminari/_paginator.html.erb b/app/views/kaminari/_paginator.html.erb index 4fb445fd..c52381e2 100644 --- a/app/views/kaminari/_paginator.html.erb +++ b/app/views/kaminari/_paginator.html.erb @@ -10,14 +10,14 @@ -<% end -%> +<% end %>