diff --git a/app/assets/javascripts/reports/dailysales.coffee b/app/assets/javascripts/reports/dailysale.coffee similarity index 100% rename from app/assets/javascripts/reports/dailysales.coffee rename to app/assets/javascripts/reports/dailysale.coffee diff --git a/app/assets/javascripts/reports/sale_items.coffee b/app/assets/javascripts/reports/saleitem.coffee similarity index 100% rename from app/assets/javascripts/reports/sale_items.coffee rename to app/assets/javascripts/reports/saleitem.coffee diff --git a/app/assets/stylesheets/CRM.scss b/app/assets/stylesheets/CRM.scss index 9ab3730c..6f8d90f0 100644 --- a/app/assets/stylesheets/CRM.scss +++ b/app/assets/stylesheets/CRM.scss @@ -13,12 +13,12 @@ .selected-item { color: #fff !important; - background-color: #ccc !important; + background-color: #54A5AF !important; } .assign { color: #fff !important; - background-color: red; + background-color: #009900; } .assign .text-muted{ color: #fff !important; @@ -29,11 +29,19 @@ } .green{ color: #fff !important; - background-color: green; + background-color: #009900; } .required abbr{ color: red !important; } .jconfirm-box-container{ margin-left:-40px !important +} +.card-columns { + @include media-breakpoint-only(lg) { + column-count: 6; + } + @include media-breakpoint-only(xl) { + column-count: 6; + } } \ No newline at end of file diff --git a/app/assets/stylesheets/reports/dailysales.scss b/app/assets/stylesheets/reports/dailysale.scss similarity index 60% rename from app/assets/stylesheets/reports/dailysales.scss rename to app/assets/stylesheets/reports/dailysale.scss index cfc48374..516e1b52 100644 --- a/app/assets/stylesheets/reports/dailysales.scss +++ b/app/assets/stylesheets/reports/dailysale.scss @@ -1,3 +1,3 @@ -// Place all the styles related to the reports/dailysales controller here. +// Place all the styles related to the reports/dailysale controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/reports/sale_items.scss b/app/assets/stylesheets/reports/saleitem.scss similarity index 60% rename from app/assets/stylesheets/reports/sale_items.scss rename to app/assets/stylesheets/reports/saleitem.scss index b9692327..3e3460a4 100644 --- a/app/assets/stylesheets/reports/sale_items.scss +++ b/app/assets/stylesheets/reports/saleitem.scss @@ -1,3 +1,3 @@ -// Place all the styles related to the reports/sale_items controller here. +// Place all the styles related to the reports/saleitem controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index 2af895da..be4b4055 100644 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -14,5 +14,4 @@ class BaseOrigamiController < ActionController::Base @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] end - end diff --git a/app/controllers/oqs/print_controller.rb b/app/controllers/oqs/print_controller.rb index f3fd5675..52960f52 100644 --- a/app/controllers/oqs/print_controller.rb +++ b/app/controllers/oqs/print_controller.rb @@ -16,7 +16,7 @@ class Oqs::PrintController < ApplicationController # 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(oqs, assigned_item.order_id, assigned_item.item_code, print_status, options ) + order_queue_printer.print_order_item(print_settings,oqs, assigned_item.order_id, assigned_item.item_code, print_status, options ) # update print status for completed same order items assigned_items.each do |ai| @@ -46,7 +46,7 @@ class Oqs::PrintController < ApplicationController # 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_booking_summary(oqs, booking.booking_id, print_status) + order_queue_printer.print_booking_summary(print_settings,oqs, booking.booking_id, print_status) # update print status for completed same order items assigned_items.each do |ai| diff --git a/app/controllers/print_settings_controller.rb b/app/controllers/print_settings_controller.rb index bdd3061a..8efb9dd5 100644 --- a/app/controllers/print_settings_controller.rb +++ b/app/controllers/print_settings_controller.rb @@ -70,6 +70,6 @@ class PrintSettingsController < ApplicationController # 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) + 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,:precision,:delimiter,:heading_space) end end diff --git a/app/controllers/reports/bksale_items_controller.rb b/app/controllers/reports/bksale_items_controller.rb deleted file mode 100644 index 1f349320..00000000 --- a/app/controllers/reports/bksale_items_controller.rb +++ /dev/null @@ -1,19 +0,0 @@ -class Reports::SaleItemsController < BaseReportController - authorize_resource :class => false - def index - - from, to, report_type = get_date_range_from_params - - @sale_data = Sale.get_by_range_by_saleitems(from,to,Sale::SALE_STATUS_COMPLETED,report_type) - - respond_to do |format| - format.html - format.xls - end - end - - def show - - end - -end \ No newline at end of file diff --git a/app/controllers/reports/daily_sales_controller.rb b/app/controllers/reports/daily_sales_controller.rb deleted file mode 100644 index 6d99551d..00000000 --- a/app/controllers/reports/daily_sales_controller.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Reports::DailySalesController < BaseReportController - # authorize_resource :class => false - def index - from, to ,report_type = get_date_range_from_params - @sale_data = Sale.daily_sales_list(from,to) - @tax = SaleTax.get_tax(from,to) - respond_to do |format| - format.html - format.xls - end - end - - def show - - end - -end \ No newline at end of file diff --git a/app/controllers/reports/daily_salesbk_controller.rb b/app/controllers/reports/dailysale_controller.rb similarity index 70% rename from app/controllers/reports/daily_salesbk_controller.rb rename to app/controllers/reports/dailysale_controller.rb index 1a878aaa..27e812ab 100644 --- a/app/controllers/reports/daily_salesbk_controller.rb +++ b/app/controllers/reports/dailysale_controller.rb @@ -1,5 +1,6 @@ -class Reports::DailySalesController < BaseReportController - authorize_resource :class => false +class Reports::DailysaleController < BaseReportController + authorize_resource :class => false + def index from, to ,report_type = get_date_range_from_params @sale_data = Sale.daily_sales_list(from,to) @@ -13,5 +14,4 @@ class Reports::DailySalesController < BaseReportController def show end - -end \ No newline at end of file +end diff --git a/app/controllers/reports/receipt_no_controller.rb b/app/controllers/reports/receipt_no_controller.rb index d85c7d57..e4157c4e 100644 --- a/app/controllers/reports/receipt_no_controller.rb +++ b/app/controllers/reports/receipt_no_controller.rb @@ -1,5 +1,5 @@ class Reports::ReceiptNoController < BaseReportController - +authorize_resource :class => false def index from, to = get_date_range_from_params puts "from..." diff --git a/app/controllers/reports/sale_items_controller.rb b/app/controllers/reports/saleitem_controller.rb similarity index 73% rename from app/controllers/reports/sale_items_controller.rb rename to app/controllers/reports/saleitem_controller.rb index 81f7af01..0f91681d 100644 --- a/app/controllers/reports/sale_items_controller.rb +++ b/app/controllers/reports/saleitem_controller.rb @@ -1,5 +1,5 @@ -class Reports::SaleItemsController < BaseReportController - # authorize_resource :class => false +class Reports::SaleitemController < BaseReportController + authorize_resource :class => false def index from, to, report_type = get_date_range_from_params @@ -16,4 +16,4 @@ class Reports::SaleItemsController < BaseReportController end -end \ No newline at end of file +end diff --git a/app/helpers/origami/request_bills_helper.rb b/app/helpers/origami/request_bills_helper.rb index a33f7c3e..2d1f8313 100644 --- a/app/helpers/origami/request_bills_helper.rb +++ b/app/helpers/origami/request_bills_helper.rb @@ -1,2 +1,3 @@ module Origami::RequestBillsHelper + end diff --git a/app/helpers/reports/dailysale_helper.rb b/app/helpers/reports/dailysale_helper.rb new file mode 100644 index 00000000..88ccfd83 --- /dev/null +++ b/app/helpers/reports/dailysale_helper.rb @@ -0,0 +1,2 @@ +module Reports::DailysaleHelper +end diff --git a/app/helpers/reports/dailysales_helper.rb b/app/helpers/reports/dailysales_helper.rb deleted file mode 100644 index 94e34c27..00000000 --- a/app/helpers/reports/dailysales_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module Reports::DailysalesHelper -end diff --git a/app/helpers/reports/sale_items_helper.rb b/app/helpers/reports/sale_items_helper.rb deleted file mode 100644 index 63e884d7..00000000 --- a/app/helpers/reports/sale_items_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module Reports::SaleItemsHelper -end diff --git a/app/helpers/reports/saleitem_helper.rb b/app/helpers/reports/saleitem_helper.rb new file mode 100644 index 00000000..47544cf9 --- /dev/null +++ b/app/helpers/reports/saleitem_helper.rb @@ -0,0 +1,2 @@ +module Reports::SaleitemHelper +end diff --git a/app/models/ability.rb b/app/models/ability.rb index 2c110e77..87371392 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -31,9 +31,11 @@ class Ability can :manage, Sale can :manage, Customer + can :manage, DiningQueue can :index, :dailysale can :index, :saleitem + can :index, :receipt_no can :add_customer, Customer can :update_sale_by_customer, Customer @@ -80,12 +82,17 @@ class Ability elsif user.role == "accountant" can :index, :dailysale - can :index, :saleitem - can :index, :receiptno - can :show, :dailysale - can :show, :saleitem - can :show, :receiptno + can :manage, :saleitem + can :index, :receiptno + + elsif user.role == "supervisour" + + can :index, :dailysale + can :manage, :saleitem + can :index, :receiptno end + end + end diff --git a/app/models/printer/order_queue_printer.rb b/app/models/printer/order_queue_printer.rb index f946e17b..6c8ba7e2 100644 --- a/app/models/printer/order_queue_printer.rb +++ b/app/models/printer/order_queue_printer.rb @@ -1,6 +1,6 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker - def print_order_item(oqs,order_id, item_code, print_status, options="") + def print_order_item(print_settings,oqs,order_id, item_code, print_status, options="") #Use CUPS service #Generate PDF #Print @@ -10,7 +10,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # check for item not to show if order_item[0].price != 0 - pdf = OrderItemPdf.new(order_item[0], print_status, options) + pdf = OrderItemPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name) pdf.render_file filename if oqs.print_copy @@ -26,11 +26,12 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker end # Query for per order - def print_order_summary(oqs, order_id, order_items, print_status) + def print_order_summary(print_settings,oqs, order_id, order_items, print_status) #Use CUPS service #Generate PDF #Print order=print_query('order_summary', order_id) + # For Print Per Item if oqs.cut_per_item order.each do|odi| @@ -40,7 +41,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # check for item not to show if odi.price != 0 - pdf = OrderItemPdf.new(odi, print_status, options) + pdf = OrderItemPdf.new(print_settings,odi, print_status, options, oqs.use_alternate_name) # pdf.render_file "tmp/order_item.pdf" pdf.render_file filename if oqs.print_copy @@ -54,7 +55,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # For Print Order Summary else filename = "tmp/order_summary_#{ order_id }" + ".pdf" - pdf = OrderSummaryPdf.new(order, print_status, order_items) + pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name) pdf.render_file filename if oqs.print_copy self.print(filename, oqs.printer_name) @@ -69,7 +70,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker end # Print for orders in booking - def print_booking_summary(oqs, booking_id, print_status) + def print_booking_summary(print_settings,oqs, booking_id, print_status) order=print_query('booking_summary', booking_id) # For Print Per Item if oqs.cut_per_item @@ -80,7 +81,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # check for item not to show if odi.price != 0 - pdf = OrderItemPdf.new(odi, print_status, options) + pdf = OrderItemPdf.new(print_settings,odi, print_status, options,oqs.use_alternate_name) pdf.render_file filename if oqs.print_copy @@ -97,7 +98,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # For Print Order Summary else filename = "tmp/booking_summary_#{ booking_id }" + ".pdf" - pdf = OrderSummaryPdf.new(order, print_status) + pdf = OrderSummaryPdf.new(print_settings,order, print_status,oqs.use_alternate_name) pdf.render_file filename if oqs.print_copy self.print(filename, oqs.printer_name) @@ -114,31 +115,34 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # Query for OQS with status def print_query(type, id) if type == "order_item" - OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining") + OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining,item.alt_name as alt_name") .joins("left join orders ON orders.order_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.booking_id = bo.booking_id left join dining_facilities AS df ON df.id = b.dining_facility_id - left join customers as cus ON cus.customer_id = orders.customer_id") + left join customers as cus ON cus.customer_id = orders.customer_id + left join menu_items as item ON item.item_code = order_items.item_code") .where("order_items.item_code = '#{ id }' AND order_items.price != 0") .group("order_items.item_code") elsif type == "order_summary" - OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining") + OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining,item.alt_name as alt_name") .joins("left join orders ON orders.order_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.booking_id = bo.booking_id left join dining_facilities AS df ON df.id = b.dining_facility_id - left join customers as cus ON cus.customer_id = orders.customer_id") + left join customers as cus ON cus.customer_id = orders.customer_id + left join menu_items as item ON item.item_code = order_items.item_code") .where("orders.order_id = '#{ id }' AND order_items.price != 0") .group("order_items.order_items_id") else # order summary for booking - OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining") + OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining,item.alt_name as alt_name") .joins("left join orders ON orders.order_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.booking_id = bo.booking_id left join dining_facilities AS df ON df.id = b.dining_facility_id - left join customers as cus ON cus.customer_id = orders.customer_id") + left join customers as cus ON cus.customer_id = orders.customer_id + left join menu_items as item ON item.item_code = order_items.item_code") .where("b.booking_id = '#{ id }' AND order_items.price != 0") end diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index b6c821fc..12d51c53 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -1,6 +1,6 @@ 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(order_item, print_status, options) + def initialize(print_settings,order_item, print_status, options, alt_name) self.page_width = 210 self.page_height = 1450 self.margin = 5 @@ -12,12 +12,13 @@ class OrderItemPdf < Prawn::Document self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width) self.label_width=100 - super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height]) + 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]) - # font "public/fonts/#{font_name}".to_s + ".ttf".to_s - # font "public/fonts/Zawgyi-One.ttf" - # font "public/fonts/padauk.ttf" + # font "public/fonts/#{font_name}".to_s + ".ttf".to_s + # font "public/fonts/Zawgyi-One.ttf" + # font "public/fonts/padauk.ttf" + #font "public/fonts/Chinese.ttf" self.header_font_size = 12 self.item_font_size = 10 @@ -29,7 +30,7 @@ class OrderItemPdf < Prawn::Document order_info(order_item.order_id, order_item.order_by,order_item.order_at) # order items - order_items(order_item, options) + order_items(order_item, options, alt_name) end # Write Order Information to PDF @@ -57,11 +58,11 @@ class OrderItemPdf < Prawn::Document end # Write Order items to PDF - def order_items(order_item, options) + def order_items(order_item, options, alt_name) y_position = cursor #Add Order Item - add_order_items(order_item, options) + add_order_items(order_item, options, alt_name) dash(1, :space => 1, :phase => 1) stroke_horizontal_line 0, (self.page_width - self.margin) @@ -69,19 +70,31 @@ class OrderItemPdf < Prawn::Document end # Add order items under order info - def add_order_items(order_item, options) + def add_order_items(order_item, options, alt_name) y_position = cursor move_down 5 - bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do + bounding_box([0,y_position], :width => self.item_width) do text "#{order_item.item_name}", :size => self.item_font_size,:align => :left end - bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do + bounding_box([self.item_width,y_position], :width => self.qty_width) do text "[#{order_item.qty.to_i}]", :size => self.item_font_size,:align => :left end + bounding_box([0,y_position], :width => self.item_width) do + text "#{order_item.item_name}", :size => self.item_font_size,:align => :left + + end + + if alt_name + move_down 4 + font("public/fonts/Chinese.ttf") do + text "(#{order_item.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true + end + end + move_down 5 # add option diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index 89eac43c..9e8ad10b 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -1,6 +1,6 @@ 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(order, print_status, order_items = nil) + def initialize(print_settings,order, print_status, order_items = nil,alt_name) self.page_width = 210 self.page_height = 1450 self.margin = 5 @@ -12,11 +12,11 @@ class OrderSummaryPdf < Prawn::Document self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width) self.label_width=100 - super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height]) + super(:margin => [print_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height]) # 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" self.header_font_size = 12 self.item_font_size = 10 @@ -29,9 +29,9 @@ class OrderSummaryPdf < Prawn::Document # order items if order_items == nil - order_items(order) + order_items(order, alt_name) else - order_items(order_items) + order_items(order_items, alt_name) end end @@ -60,7 +60,7 @@ class OrderSummaryPdf < Prawn::Document end # Write Order items to PDF - def order_items(order_item) + def order_items(order_item, alt_name) y_position = cursor bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do @@ -75,12 +75,12 @@ class OrderSummaryPdf < Prawn::Document move_down 5 #Add Order Item - add_order_items(order_item) + add_order_items(order_item, alt_name) end # Add order items under order info - def add_order_items(order_item) + def add_order_items(order_item, alt_name) y_position = cursor move_down 5 @@ -92,12 +92,26 @@ class OrderSummaryPdf < Prawn::Document bounding_box([0,y_position], :width => self.item_width) do text "#{odi.item_name}", :size => self.item_font_size,:align => :left + end bounding_box([self.item_width,y_position], :width => self.qty_width) do text "#{odi.qty}", :size => self.item_font_size,:align => :left end + bounding_box([0,y_position], :width => self.item_width) do + text "#{odi.item_name}", :size => self.item_font_size,:align => :left + + end + + if alt_name + move_down 4 + font("public/fonts/Chinese.ttf") do + text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true + end + + end + move_down 5 # add option diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index b9bb7e31..3817c509 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -1,4 +1,5 @@ class ReceiptBillPdf < Prawn::Document + include ActionView::Helpers::NumberHelper 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(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details) self.page_width = 210 @@ -16,7 +17,7 @@ class ReceiptBillPdf < Prawn::Document # @double = @qty_width * 1.3 # @half_qty = @qty_width / 2 #setting page margin and width - super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height]) + super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height]) # font "public/fonts/#{font_name}".to_s + ".ttf".to_s # font "public/fonts/Zawgyi-One.ttf" @@ -24,26 +25,33 @@ class ReceiptBillPdf < Prawn::Document self.header_font_size = 10 self.item_font_size = 8 + if printer_settings.delimiter + delimiter = "," + else + delimiter = "" + end + header( shop_details) stroke_horizontal_rule cashier_info(sale_data, customer_name) - line_items(sale_items) - all_total(sale_data) + line_items(sale_items,printer_settings.precision,delimiter) + all_total(sale_data,printer_settings.precision,delimiter) if member_info != nil - member_info(member_info,customer_name,rebate_amount,sale_data) + member_info(member_info,customer_name,rebate_amount,sale_data,printer_settings.precision,delimiter) end customer(customer_name) if discount_price_by_accounts.length > 0 - discount_account(discount_price_by_accounts) + discount_account(discount_price_by_accounts,printer_settings.precision,delimiter) end - items_account(item_price_by_accounts) + items_account(item_price_by_accounts,printer_settings.precision,delimiter) + footer end @@ -87,7 +95,7 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do - text "Receipt Date : #{ sale_data.receipt_date.strftime('%d-%m-%Y') } ( #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } )",:size => self.item_font_size,:align => :left + text "Receipt Date : #{ sale_data.receipt_date.strftime('%d-%m-%Y') } ( #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } - #{ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p') } )",:size => self.item_font_size,:align => :left end @@ -101,7 +109,7 @@ class ReceiptBillPdf < Prawn::Document stroke_horizontal_rule end - def line_items(sale_items) + def line_items(sale_items,precision,delimiter) move_down 5 y_position = cursor move_down 5 @@ -114,10 +122,10 @@ class ReceiptBillPdf < Prawn::Document } move_down -5 stroke_horizontal_rule - add_line_item_row(sale_items) + add_line_item_row(sale_items,precision,delimiter) end - def add_line_item_row(sale_items) + def add_line_item_row(sale_items,precision,delimiter) item_name_width = (self.item_width+self.price_width) y_position = cursor move_down 5 @@ -136,9 +144,9 @@ class ReceiptBillPdf < Prawn::Document pad_top(15) { text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :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 "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :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}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix - text_box "#{total_price}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix + text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix } move_down 1 end @@ -152,12 +160,12 @@ class ReceiptBillPdf < Prawn::Document text "Sub Total", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ sub_total }" , :size => self.item_font_size,:align => :right - end + text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}" ,:delimiter => ',', :size => self.item_font_size,:align => :right + end move_down 5 end - def all_total(sale_data) + def all_total(sale_data,precision,delimiter) item_name_width = self.item_width y_position = cursor @@ -165,7 +173,7 @@ class ReceiptBillPdf < Prawn::Document text "Overall Discount", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "( " +"#{sale_data.total_discount}" +" )" , :size => self.item_font_size,:align => :right + text "( #{number_with_precision(sale_data.total_discount, :precision => precision.to_i, :delimiter => delimiter)} )" , :size => self.item_font_size,:align => :right end if sale_data.sale_taxes.length > 0 @@ -177,7 +185,7 @@ class ReceiptBillPdf < Prawn::Document text "#{ st.tax_name }", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ st.tax_payable_amount }" , :size => self.item_font_size,:align => :right + text "#{number_with_precision(st.tax_payable_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end end else @@ -198,18 +206,18 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor move_down 5 bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Grand Total", :size => self.header_font_size,:align => :left + text "Grand Total",:style => :bold, :size => self.header_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{sale_data.grand_total}" , :size => self.header_font_size,:align => :right + text "#{number_with_precision(sale_data.grand_total, :precision => precision.to_i, :delimiter => delimiter)}" , :style => :bold, :size => self.header_font_size,:align => :right end move_down 5 - sale_payment(sale_data) + sale_payment(sale_data,precision,delimiter) end - def sale_payment(sale_data) + def sale_payment(sale_data,precision,delimiter) stroke_horizontal_rule move_down 5 @@ -220,7 +228,7 @@ class ReceiptBillPdf < Prawn::Document text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ payment.payment_amount }" , :size => self.item_font_size,:align => :right + text "#{number_with_precision(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end move_down 5 end @@ -231,7 +239,7 @@ class ReceiptBillPdf < Prawn::Document text "Change Amount", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{sale_data.amount_changed}" , :size => self.item_font_size,:align => :right + text "#{number_with_precision(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end move_down 5 end @@ -239,7 +247,7 @@ class ReceiptBillPdf < Prawn::Document end # show member information - def member_info(member_info,customer_name,rebate_amount,sale_data) + def member_info(member_info,customer_name,rebate_amount,sale_data,precision,delimiter) if rebate_amount != nil @@ -255,7 +263,7 @@ class ReceiptBillPdf < Prawn::Document text "Current Rebate Amount", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ res["rebate"] }" , :size => self.item_font_size,:align => :right + text "#{number_with_precision(res["rebate"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end end if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Redeem" @@ -266,15 +274,15 @@ class ReceiptBillPdf < Prawn::Document text "Current Redeem Amount", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "(#{ res["redeem"] })" , :size => self.item_font_size,:align => :right + text "#{number_with_precision(res["redeem"], :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right end end end end end - if member_info["status"] == true - balance = 0.0 + if member_info["status"] == true && member_info["data"].present? + balance = 0 member_info["data"].each do |res| if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount" @@ -289,7 +297,7 @@ class ReceiptBillPdf < Prawn::Document text "Current Balance", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ balance }" , :size => self.item_font_size,:align => :right + text "#{number_with_precision(balance, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end end @@ -305,8 +313,7 @@ class ReceiptBillPdf < Prawn::Document text "#{ customer_name }" , :size => self.item_font_size,:align => :right end end - - def discount_account(discount_price_by_accounts) + def discount_account(discount_price_by_accounts,precision,delimiter) move_down 5 stroke_horizontal_rule move_down 5 @@ -317,12 +324,12 @@ class ReceiptBillPdf < Prawn::Document text "#{ 'Total ' + ipa[:name] + ' Discounts' }", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "(" + "#{ ipa[:price] }" + ")" , :size => self.item_font_size,:align => :right + text "(" + "#{ number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter) }" + ")" , :size => self.item_font_size,:align => :right end end end - def items_account(item_price_by_accounts) + def items_account(item_price_by_accounts,precision,delimiter) move_down 5 stroke_horizontal_rule move_down 5 @@ -333,7 +340,7 @@ class ReceiptBillPdf < Prawn::Document text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ ipa[:price] }" , :size => self.item_font_size,:align => :right + text "#{number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end end end diff --git a/app/views/crm/dining_queues/index.html.erb b/app/views/crm/dining_queues/index.html.erb index 813be2cf..4adbead9 100644 --- a/app/views/crm/dining_queues/index.html.erb +++ b/app/views/crm/dining_queues/index.html.erb @@ -20,7 +20,7 @@
<% @i =0 %> <% @dining_queues.each do |queue| %> -
" data-id="<%= queue.id %>"> +
" data-id="<%= queue.id %>" style="width: 17.5rem;">
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 05b74b7a..345ca63f 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -33,14 +33,14 @@ diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb index 8e660261..d768240c 100644 --- a/app/views/origami/sales/show.html.erb +++ b/app/views/origami/sales/show.html.erb @@ -117,7 +117,7 @@

-

Date: <%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

+

Date: <%= @sale.created_at.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

diff --git a/app/views/print_settings/_form.html.erb b/app/views/print_settings/_form.html.erb index c5166103..ba703aae 100644 --- a/app/views/print_settings/_form.html.erb +++ b/app/views/print_settings/_form.html.erb @@ -14,6 +14,9 @@ <%= f.input :page_width %> <%= f.input :page_height %> <%= f.input :print_copies %> + <%= f.input :precision %> + <%= f.input :delimiter %> + <%= f.input :heading_space %>
diff --git a/app/views/print_settings/index.html.erb b/app/views/print_settings/index.html.erb index 0db16892..d872f7ae 100644 --- a/app/views/print_settings/index.html.erb +++ b/app/views/print_settings/index.html.erb @@ -26,6 +26,9 @@ Page width Page height Print copies + Precision + Delimiter + Heading_space @@ -45,6 +48,9 @@ <%= print_setting.page_width %> <%= print_setting.page_height %> <%= print_setting.print_copies %> + <%= print_setting.precision %> + <%= print_setting.delimiter %> + <%= print_setting.heading_space %> <%= link_to 'Show', print_setting %> <%= link_to 'Edit', edit_print_setting_path(print_setting) %> <%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/reports/daily_sales/_shift_sale_report_filter.html.erb b/app/views/reports/daily_sales/_shift_sale_report_filter.html.erb deleted file mode 100644 index 3a5d788c..00000000 --- a/app/views/reports/daily_sales/_shift_sale_report_filter.html.erb +++ /dev/null @@ -1,151 +0,0 @@ -
-
- <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> - <% if period_type != false %> -
-
- - -
- - -
- - - -
-
- - -
-
- -
-
- <% end %> - - - -
-
- <% if defined? promotions %> - <%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %> - <% end %> - - <% if defined? menu_types %> - <%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %> - <% end %> - - <% if defined? payments %> - <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %> - <% end %> - - <% if defined? shift_name %> - - <% end %> - - <% if defined? cashiers %> - <%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %> - <% end %> - - <% if defined? singer %> - <%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %> - <% end %> - - <% if defined? bsm %> - <%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %> - <% end %> - - <% if defined? guest_role %> - <%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %> - <% end %> - - <% if defined? list_by_payment_type %> - <%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %> - <% end %> - - <% if defined? products %> - <%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %> - <% end %> - - <% if defined? items %> - <%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %> - <% end %> -
-
- - - - <% end %> -
-
- - - - \ No newline at end of file diff --git a/app/views/reports/daily_sales/index.xls.erb b/app/views/reports/daily_sales/index.xls.erb deleted file mode 100644 index 67e76e3c..00000000 --- a/app/views/reports/daily_sales/index.xls.erb +++ /dev/null @@ -1,116 +0,0 @@ -
-
- - - <% if params[:from]%> - - - - <% end %> - - - - - - - - - - - - - - - - - - - <% unless @sale_data.empty? %> - - - <% void = 0 %> - <% mpu = 0 %> - <% master = 0 %> - <% visa = 0 %> - <% jcb = 0 %> - <% paypar = 0 %> - <% cash = 0 %> - <% credit = 0 %> - <% foc = 0 %> - <% discount = 0 %> - <% total = 0 %> - <% grand_total = 0 %> - <% count = 1 %> <% rounding_adj = 0 %> - <% @sale_data.each do |sale| %> - <% void += sale[:void_amount] %> - <% mpu += sale[:mpu_amount] %> - <% master += sale[:master_amount] %> - <% visa += sale[:visa_amount] %> - <% jcb += sale[:jcb_amount] %> - <% paypar += sale[:paypar_amount] %> - <% cash += sale[:cash_amount] %> - <% credit += sale[:credit_amount] %> - <% foc += sale[:foc_amount] %> - <% discount += sale[:total_discount] %> - <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> - <% grand_total += sale[:grand_total].to_f %> - <% rounding_adj += sale[:rounding_adj].to_f %> - - - - - - - - - - - - - - - - - - <% count = count + 1 %> - <% end %> - - - - - - - - - - - - - - - - - - <% total_tax = 0 %> - <% unless @tax.empty? %> - <% @tax.each do |tax| %> - <% total_tax += tax.tax_amount.to_f %> - - - - - - - <% end %> - <% net = total - total_tax %> - - - - - - <% end %> - - <% end %> -
Sale (<%= params[:from] rescue '-' %> - <%= params[:to] rescue '-'%>)
Sr.noDateVoid AmountMpu SalesMaster SalesVisa SalesJcb SalesPaypar SalesCash SalesCredit SalesFOC Sales(Discount)Grand Total +
Rounding Adj.
Rounding Adj.Grand Total
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",sale[:grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%>
Total<%= number_with_delimiter(sprintf("%.2f",mpu_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%>
<%= tax.tax_name rescue '-'%><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%> 
Net Amount<%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%> 
-
-
\ No newline at end of file diff --git a/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb b/app/views/reports/dailysale/_shift_sale_report_filter.html.erb similarity index 77% rename from app/views/reports/daily_sale/_shift_sale_report_filter.html.erb rename to app/views/reports/dailysale/_shift_sale_report_filter.html.erb index 3a5d788c..9b89858a 100644 --- a/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb +++ b/app/views/reports/dailysale/_shift_sale_report_filter.html.erb @@ -117,23 +117,6 @@
- - \ No newline at end of file diff --git a/app/views/reports/daily_sales/index.html.erb b/app/views/reports/dailysale/index.html.erb similarity index 97% rename from app/views/reports/daily_sales/index.html.erb rename to app/views/reports/dailysale/index.html.erb index 7b790148..5c42d6dc 100644 --- a/app/views/reports/daily_sales/index.html.erb +++ b/app/views/reports/dailysale/index.html.erb @@ -7,14 +7,14 @@
<%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_daily_sales_path} %> + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
diff --git a/app/views/reports/daily_sale/index.xls.erb b/app/views/reports/dailysale/index.xls.erb similarity index 100% rename from app/views/reports/daily_sale/index.xls.erb rename to app/views/reports/dailysale/index.xls.erb diff --git a/app/views/reports/receipt_no/index.xls.erb b/app/views/reports/receipt_no/index.xls.erb index 8bdee23c..5befb18a 100644 --- a/app/views/reports/receipt_no/index.xls.erb +++ b/app/views/reports/receipt_no/index.xls.erb @@ -1,135 +1,43 @@
-<% unless @sale_data.empty? %> -

<%=current_active_location.name%>

-

Sales Summary Report (BreadTalk)

-<% if params[:from]%> -

From Date : <%= params[:from] %> , To Date : <%= params[:to] %>

-<% end %> - - - - - - - - - - - - - - - - - - - - - <% void = 0 %> - <% card = 0 %> - <% credit_payment = 0 %> - <% cash = 0 %> - <% credit = 0 %> - <% foc = 0 %> - <% discount = 0 %> - <% total = 0 %> - <% count = 1 %> - <% discount_rev = 0 %> - <% total_rev = 0 %> - <% grand_rev = 0 %> - <% total_other_charges=0 %> - <% total_tax=0 %> - <% cash_received = 0 %> - <% total_cash_received = 0 %> - <% today_credit_payment_amount = 0 %> - <% old_location_id = 0%> - <% sub_total = 0 %> - <% count_of_void = 0 %> - <% flag = false %> - <% @sale_data.each do |sale| %> - <% credit_payment += sale[:credit_payment].to_f %> - <% card += sale[:card_amount].to_f %> - <% cash += sale[:cash_amount].to_f %> - <% credit += sale[:credit_amount].to_f %> - <% foc += sale[:foc_amount].to_f %> - <% discount += sale[:total_discount].to_f %> - <% total += sale[:grand_total].to_f %> - <% total_other_charges +=sale[:other_charges].to_f %> - <% total_tax +=sale[:total_tax].to_f %> +
Location NameDateCash SalesCredit SalesCredit ReceivedCard PaymentTotal DiscountTotal TaxesTotal Other ChargesFOC SalesVoid SalesGrand Total
+ + + + + + + + + <% TaxProfile.all.each do |r|%> + + <% end %> + + + - <% cash_received = sale[:cash_amount].to_f + sale[:credit_payment].to_f%> - <% total_cash_received = cash.to_f + credit_payment.to_f%> - <% today_credit_payment_amount += sale[:today_credit_payment].to_f %> - - - - - - - - - - - - - - - <% total_void_amount = 0 %> - <% if !@daily_void.nil? %> - <% @daily_void.each do |d_v|%> - - <% if d_v[:daily_void_amt].to_i > 0 %> - <% if d_v[:location_id] == sale[:location_id] %> - <% if d_v[:date].utc.getlocal.strftime("%Y-%m-%d").to_s == sale[:sale_date].to_s%> - <%count_of_void+=1%> - - <%total_void_amount += d_v[:daily_void_amt].to_f%> - <% flag = true %> - - - - <%end %> - <% end%> - <% end%> - <% end%> - <% end%> - <% if flag == true%> - <% void += total_void_amount.to_f %> - - <% flag = false %> - <% end%> - <%if count_of_void == 0%> - - <%end %> - - - - -<%count_of_void= 0%> - <% count = count + 1 %> - <% end %> - - - - - - - - - - - - - - - - - -<% end %> -
DateReceipt NoCashier NameGross SalesDiscountTotal Sales<%=r.name%>Nett Sales
<%= sale[:location].to_s rescue '-' %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:credit_payment].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:card_amount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:total_discount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:total_tax].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:other_charges].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount].to_f), :delimiter => ',') %> <%= number_with_delimiter(sprintf("%.2f",total_void_amount.to_f), :delimiter => ',') %> <%= number_with_delimiter(sprintf("%.2f",0.to_f), :delimiter => ',') %> - <%= number_with_delimiter(sprintf("%.2f",((sale[:cash_amount].to_f + sale[:credit_amount].to_f + sale[:card_amount].to_f + sale[:credit_payment].to_f) - sale[:today_credit_payment].to_f) ).to_f, :delimiter => ',') %> -
Grand Total<%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",credit ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",credit_payment ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",card ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",discount ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",total_tax ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",total_other_charges ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",foc ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",void ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f", (cash.to_f + credit.to_f + card.to_f + credit_payment.to_f) - today_credit_payment_amount.to_f ).to_f, :delimiter => ',') %>
+ + <% total_sales = 0 %> + <% net_sales = 0 %> + <% @sale_data.each do |sale| %> + <% total_sales = sale.total_amount.to_f - sale.total_discount.to_f%> + <% net_sales = total_sales.to_f + sale.total_tax.to_f%> + + <%= sale.receipt_date.strftime("#{sale.receipt_date.day.ordinalize} %b") rescue '-' %> + <%=sale.receipt_no.to_s rescue ''%> + <%=Employee.find(sale.cashier_id).name rescue ''%> + <%= number_with_delimiter(sprintf("%.2f",sale.total_amount.to_f), :delimiter => ',') %> + <%= number_with_delimiter(sprintf("%.2f",sale.total_discount.to_f), :delimiter => ',') %> + <%= number_with_delimiter(sprintf("%.2f",total_sales.to_f), :delimiter => ',') %> + <% sale.sale_taxes.each do |sale|%> + <%= number_with_delimiter(sprintf("%.2f",sale.tax_payable_amount.to_f), :delimiter => ',') %> + <% end %> + + <%= number_with_delimiter(sprintf("%.2f",net_sales.to_f), :delimiter => ',') %> + + <% end %> + +
diff --git a/app/views/reports/sale_item/index.xls.erb b/app/views/reports/sale_item/index.xls.erb deleted file mode 100644 index 2807ec3f..00000000 --- a/app/views/reports/sale_item/index.xls.erb +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - -
-<% unless @sale_data.blank? %> - - - - - <% if !params[:from].blank?%> - - - - <% end %> - <% if @shift_from %> - - <% if @shift_data.employee %> - <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> - <% end %> - - - <% end %> - - - - - - - - - - - - - <% acc_arr = Array.new %> - <% cate_arr = Array.new %> - - <% sub_total = 0.0 %> - <% count = 0%> - <% total_price = 0.0 %> - <% cate_count = 0 %> - <% acc_count = 0%> - <% grand_total = 0%> - <% total_discount = 0.0 %> - - <% @sale_data.order("total_item desc").each do |sale| %> - - <% if !acc_arr.include?(sale.account_id) %> - - - - - - - <% acc_arr.push(sale.account_id) %> - - <% end %> - - - <% if !cate_arr.include?(sale.menu_category_id) %> - - <% cate_arr.push(sale.menu_category_id) %> - <% else %> - - <% end %> - - <% if @item_table == 'sale' %> - <% if sale.item_remark == 'FOC' %> - - <% elsif sale.item_remark == 'FOC ITEM' %> - - <% elsif sale.item_remark == 'DISCOUNT' %> - - <% else %> - - <% end %> - <% if sale.item_remark == 'DISCOUNT' %> - - - - <% total_price += sale.total_price %> - <% else %> - - - - <% end %> - <% else %> - - - - - <% end %> - - - - <% @menu_cate_count.each do |key,value| %> - <% if sale.menu_category_id == key %> - <% count = count + 1 %> - <% sub_total += sale.grand_total %> - <% if count == value %> - - - - - - <% sub_total = 0.0%> - <% total_discount = total_discount + total_price %> - <% total_price = 0.0%> - <% count = 0%> - <% end %> - <% end %> - <% end %> - - <% grand_total += sale.grand_total%> - <% end %> - - - - - - -
From Date : <%= params[:from] %> , To Date : <%= params[:to] %>
Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
 Menu CategoryCodeProductTotal ItemUnit PriceRevenue
<%= sale.account_name %> Total Price By <%= sale.account_name %> - <% @totalByAccount.each do |account, total| %> - <% if sale.account_id == account %> - <%= total %> - <% end %> - <% end %> -
 <%= sale.menu_category_name %> <%= sale.code rescue '-' %><%= '[PROMO] '.to_s + sale.product_name.to_s rescue '-' %><%= '[DIS:QTY] '.to_s + sale.product_name.to_s rescue '-' %><%= '[DIS:TP] '.to_s + sale.product_name.to_s rescue '-' %><%= sale.product_name.to_s rescue '-' %> - - <%= sale.total_price.abs rescue '-' %><%= sale.total_item.abs rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total.abs rescue '-' %><%= sale.product_name.to_s rescue '-' %><%= sale.total_item.abs rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total.abs rescue '-' %>
 Sub Total<%= sub_total + total_price %>
 Grand Total<%= grand_total + total_discount %>
-<% end %> -
- - \ No newline at end of file diff --git a/app/views/reports/sale_items/_shift_sale_report_filter.html.erb b/app/views/reports/sale_items/_shift_sale_report_filter.html.erb deleted file mode 100644 index 7f95b6b9..00000000 --- a/app/views/reports/sale_items/_shift_sale_report_filter.html.erb +++ /dev/null @@ -1,156 +0,0 @@ -
-
- <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> - <% if period_type != false %> -
-
- - -
- - -
- - - -
-
- - -
-
- -
-
- <% end %> - - - -
-
- <% if defined? promotions %> - <%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %> - <% end %> - - <% if defined? menu_types %> - <%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %> - <% end %> - - <% if defined? payments %> - <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %> - <% end %> - - <% if defined? shift_name %> - - <% end %> - - <% if defined? cashiers %> - <%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %> - <% end %> - - <% if defined? singer %> - <%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %> - <% end %> - - <% if defined? bsm %> - <%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %> - <% end %> - - <% if defined? guest_role %> - <%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %> - <% end %> - - <% if defined? list_by_payment_type %> - <%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %> - <% end %> - - <% if defined? products %> - <%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %> - <% end %> - - <% if defined? items %> - <%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %> - <% end %> -
-
- - - - <% end %> -
-
- - - - \ No newline at end of file diff --git a/app/views/reports/sale_items/index.html.erb b/app/views/reports/sale_items/index.html.erb deleted file mode 100644 index 26ad560e..00000000 --- a/app/views/reports/sale_items/index.html.erb +++ /dev/null @@ -1,141 +0,0 @@ - - -
- <%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_sale_items_path} %> -
-
- - - -
-
-
- - - - - - - - - - - - - - - - - - -
Date
Menu CategoryCodeProductTotal ItemUnit PriceRevenue
-
-
-
- - \ No newline at end of file diff --git a/app/views/reports/sale_item/_shift_sale_report_filter.html.erb b/app/views/reports/saleitem/_shift_sale_report_filter.html.erb similarity index 100% rename from app/views/reports/sale_item/_shift_sale_report_filter.html.erb rename to app/views/reports/saleitem/_shift_sale_report_filter.html.erb diff --git a/app/views/reports/sale_item/index.html.erb b/app/views/reports/saleitem/index.html.erb similarity index 95% rename from app/views/reports/sale_item/index.html.erb rename to app/views/reports/saleitem/index.html.erb index 7b0d6f38..b6482271 100644 --- a/app/views/reports/sale_item/index.html.erb +++ b/app/views/reports/saleitem/index.html.erb @@ -7,14 +7,14 @@
<%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_sale_items_path} %> + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_saleitem_index_path} %>
diff --git a/app/views/reports/sale_items/index.xls.erb b/app/views/reports/saleitem/index.xls.erb similarity index 75% rename from app/views/reports/sale_items/index.xls.erb rename to app/views/reports/saleitem/index.xls.erb index 2807ec3f..3773619b 100644 --- a/app/views/reports/sale_items/index.xls.erb +++ b/app/views/reports/saleitem/index.xls.erb @@ -49,22 +49,6 @@ <% @sale_data.order("total_item desc").each do |sale| %> - <% if !acc_arr.include?(sale.account_id) %> - - <%= sale.account_name %> -   - Total Price By <%= sale.account_name %> - - <% @totalByAccount.each do |account, total| %> - <% if sale.account_id == account %> - <%= total %> - <% end %> - <% end %> - - - <% acc_arr.push(sale.account_id) %> - - <% end %>   <% if !cate_arr.include?(sale.menu_category_id) %> @@ -103,23 +87,7 @@ - <% @menu_cate_count.each do |key,value| %> - <% if sale.menu_category_id == key %> - <% count = count + 1 %> - <% sub_total += sale.grand_total %> - <% if count == value %> - -   - Sub Total - <%= sub_total + total_price %> - - <% sub_total = 0.0%> - <% total_discount = total_discount + total_price %> - <% total_price = 0.0%> - <% count = 0%> - <% end %> - <% end %> - <% end %> + <% grand_total += sale.grand_total%> <% end %> diff --git a/config/application.rb b/config/application.rb index 0e323d22..7e16975c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,7 +13,6 @@ module SXRestaurants # -- all .rb files in that directory are automatically loaded. config.active_record.time_zone_aware_types = [:datetime, :time] config.active_job.queue_adapter = :sidekiq - config.time_zone = 'Asia/Rangoon' - + config.time_zone = 'Asia/Rangoon' end end diff --git a/config/routes.rb b/config/routes.rb index 3a8e1723..40b6aab1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -98,19 +98,6 @@ Rails.application.routes.draw do get "/:id/request_bills" => "request_bills#print",:as => "request_bill" get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' } - - #---------Shift ---------------# - resources :shifts, only: [:index, :show, :new, :create, :edit, :update] - #shift - index (open/close shift landing page) - #shift - show (sales summary display) - #shift - new (open shift) - #shift - edit (close shift) - - resources :cash_mgmt, only: [:new, :create] - #payment - accepting or expending money from cashier - [Cash Journal] - #payment - Incoming payments - [accept all payment types (cash, other payments (except rebate)) - #payment - Outing payments - Cash only [ *Misc expeness tracking] - #--------- Payment ------------# get 'sale/:sale_id/first_bill' => 'payments#first_bill', :defaults => { :format => 'json' } get 'sale/:sale_id/payment' => 'payments#show' @@ -257,8 +244,8 @@ Rails.application.routes.draw do #--------- Reports Controller Sections ------------# namespace :reports do resources :receipt_no, :only => [:index, :show] - resources :daily_sales, :only => [:index, :show] - resources :sale_items, :only => [:index, :show] + resources :dailysale, :only => [:index, :show] + resources :saleitem, :only => [:index, :show] # resources :sales, :only => [:index, :show] # resources :orders, :only => [:index, :show] # resources :customers, :only => [:index, :show] diff --git a/db/migrate/20170623101708_create_dining_queues.rb b/db/migrate/20170627085117_dining_queues.rb similarity index 69% rename from db/migrate/20170623101708_create_dining_queues.rb rename to db/migrate/20170627085117_dining_queues.rb index dd2ea134..a4977f8c 100644 --- a/db/migrate/20170623101708_create_dining_queues.rb +++ b/db/migrate/20170627085117_dining_queues.rb @@ -1,6 +1,6 @@ -class CreateDiningQueues < ActiveRecord::Migration[5.1] +class DiningQueues < ActiveRecord::Migration[5.1] def change - create_table :dining_queues do |t| + create_table :dining_queues do |t| t.string :name t.string :contact_no t.string :queue_no @@ -9,6 +9,6 @@ class CreateDiningQueues < ActiveRecord::Migration[5.1] t.integer :seater t.string :remark t.timestamps - end + end end end diff --git a/db/migrate/20170602093159_create_print_settings.rb b/db/migrate/20170628103624_create_print_settings.rb similarity index 88% rename from db/migrate/20170602093159_create_print_settings.rb rename to db/migrate/20170628103624_create_print_settings.rb index e9ea5e83..aca49a0d 100644 --- a/db/migrate/20170602093159_create_print_settings.rb +++ b/db/migrate/20170628103624_create_print_settings.rb @@ -13,6 +13,9 @@ class CreatePrintSettings < ActiveRecord::Migration[5.1] t.decimal :page_width, :null => false, :default => 200 t.decimal :page_height, :null => false, :default => 800 t.integer :print_copies, :null => false, :default => 1 + t.string :precision + t.boolean :delimiter + t.integer :heading_space t.timestamps end diff --git a/db/seeds.rb b/db/seeds.rb index 841495d4..d56bad57 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -63,6 +63,7 @@ employee_roles = Lookup.create([{lookup_type:'employee_roles', name: 'Cashier', {lookup_type:'employee_roles', name: 'Waiter', value: 'waiter'}, {lookup_type:'employee_roles', name: 'Supervisour', value: 'supervisour'}, {lookup_type:'employee_roles', name: 'Manager', value: 'manager'}, + {lookup_type:'employee_roles', name: 'Accountant', value: 'account'}, {lookup_type:'employee_roles', name: 'Administrator', value: 'administrator'}]) #booking_status @@ -149,11 +150,11 @@ admin_employee = Employee.create({name: "Waiter", role: "waiter", password: "111 admin_employee = Employee.create({name: "Waiter 2", role: "waiter", password: "22222", emp_id:"222", created_by: "SYSTEM DEFAULT"}) admin_employee = Employee.create({name: "Cashier", role: "cashier", password: "33333", emp_id:"333", created_by: "SYSTEM DEFAULT"}) -order_station1=PrintSetting.create({name: "OrderItemPdf", unique_code: "OrderItemPdf", printer_name: "EPSON-TM-T82-S-A"}) -order_station2=PrintSetting.create({name: "Order Summary", unique_code: "OrderSummaryPdf", printer_name: "EPSON-TM-T82-S-A"}) -request_bill_printer=PrintSetting.create({name: "Receipt Bill", unique_code: "ReceiptBillPdf", printer_name: "EPSON-TM-T82-S-A"}) -crm_order_printer=PrintSetting.create({name: "CRM Order", unique_code: "CrmOrderPdf", printer_name: "EPSON-TM-T82-S-A"}) -queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf", printer_name: "EPSON-TM-T82-S-A"}) +order_station1=PrintSetting.create({name: "OrderItemPdf", unique_code: "OrderItemPdf", printer_name: "EPSON-TM-T82-S-A", precision: "0", delimiter: "0", heading_space: "5"}) +order_station2=PrintSetting.create({name: "Order Summary", unique_code: "OrderSummaryPdf", printer_name: "EPSON-TM-T82-S-A", precision: "0", delimiter: "0", heading_space: "5"}) +request_bill_printer=PrintSetting.create({name: "Receipt Bill", unique_code: "ReceiptBillPdf", printer_name: "EPSON-TM-T82-S-A", precision: "0", delimiter: "0", heading_space: "5"}) +crm_order_printer=PrintSetting.create({name: "CRM Order", unique_code: "CrmOrderPdf", printer_name: "EPSON-TM-T82-S-A", precision: "0", delimiter: "0", heading_space: "5"}) +queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf", printer_name: "EPSON-TM-T82-S-A", precision: "0", delimiter: "0", heading_space: "5"}) member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) diff --git a/public/fonts/Chinese.ttf b/public/fonts/Chinese.ttf new file mode 100755 index 00000000..6d26dd75 Binary files /dev/null and b/public/fonts/Chinese.ttf differ diff --git a/public/fonts/Zawgyi-One.ttf b/public/fonts/Zawgyi-One.ttf new file mode 100755 index 00000000..a1cd1739 Binary files /dev/null and b/public/fonts/Zawgyi-One.ttf differ diff --git a/public/fonts/padauk.ttf b/public/fonts/padauk.ttf new file mode 100755 index 00000000..68958e98 Binary files /dev/null and b/public/fonts/padauk.ttf differ diff --git a/spec/controllers/reports/dailysale_controller_spec.rb b/spec/controllers/reports/dailysale_controller_spec.rb new file mode 100644 index 00000000..b80d898e --- /dev/null +++ b/spec/controllers/reports/dailysale_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Reports::DailysaleController, type: :controller do + +end diff --git a/spec/controllers/reports/dailysales_controller_spec.rb b/spec/controllers/reports/dailysales_controller_spec.rb deleted file mode 100644 index 83fcb321..00000000 --- a/spec/controllers/reports/dailysales_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Reports::DailysalesController, type: :controller do - -end diff --git a/spec/controllers/reports/sale_items_controller_spec.rb b/spec/controllers/reports/sale_items_controller_spec.rb deleted file mode 100644 index 546fc874..00000000 --- a/spec/controllers/reports/sale_items_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Reports::SaleItemsController, type: :controller do - -end diff --git a/spec/controllers/reports/saleitem_controller_spec.rb b/spec/controllers/reports/saleitem_controller_spec.rb new file mode 100644 index 00000000..3e431a45 --- /dev/null +++ b/spec/controllers/reports/saleitem_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Reports::SaleitemController, type: :controller do + +end diff --git a/spec/helpers/reports/sale_items_helper_spec.rb b/spec/helpers/reports/dailysale_helper_spec.rb similarity index 69% rename from spec/helpers/reports/sale_items_helper_spec.rb rename to spec/helpers/reports/dailysale_helper_spec.rb index ea2807c4..2b1e1ddc 100644 --- a/spec/helpers/reports/sale_items_helper_spec.rb +++ b/spec/helpers/reports/dailysale_helper_spec.rb @@ -1,15 +1,15 @@ require 'rails_helper' # Specs in this file have access to a helper object that includes -# the Reports::SaleItemsHelper. For example: +# the Reports::DailysaleHelper. For example: # -# describe Reports::SaleItemsHelper do +# describe Reports::DailysaleHelper do # describe "string concat" do # it "concats two strings with spaces" do # expect(helper.concat_strings("this","that")).to eq("this that") # end # end # end -RSpec.describe Reports::SaleItemsHelper, type: :helper do +RSpec.describe Reports::DailysaleHelper, type: :helper do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/helpers/reports/dailysales_helper_spec.rb b/spec/helpers/reports/saleitem_helper_spec.rb similarity index 69% rename from spec/helpers/reports/dailysales_helper_spec.rb rename to spec/helpers/reports/saleitem_helper_spec.rb index 96853812..2c579f0e 100644 --- a/spec/helpers/reports/dailysales_helper_spec.rb +++ b/spec/helpers/reports/saleitem_helper_spec.rb @@ -1,15 +1,15 @@ require 'rails_helper' # Specs in this file have access to a helper object that includes -# the Reports::DailysalesHelper. For example: +# the Reports::SaleitemHelper. For example: # -# describe Reports::DailysalesHelper do +# describe Reports::SaleitemHelper do # describe "string concat" do # it "concats two strings with spaces" do # expect(helper.concat_strings("this","that")).to eq("this that") # end # end # end -RSpec.describe Reports::DailysalesHelper, type: :helper do +RSpec.describe Reports::SaleitemHelper, type: :helper do pending "add some examples to (or delete) #{__FILE__}" end