From 358ff50934f6079390334d144a649348843d0802 Mon Sep 17 00:00:00 2001 From: NyanLinHtut Date: Mon, 23 Dec 2019 14:51:37 +0630 Subject: [PATCH] daily & hourly report --- app/assets/javascripts/addorder.js | 6 +- app/controllers/base_report_controller.rb | 3 +- app/models/printer/printer_worker.rb | 2 +- app/models/sale.rb | 15 +- app/views/reports/dailysale/index.html.erb | 12 +- app/views/reports/dailysale/index.xls.erb | 454 ++++++++++-------- .../_hourly_saleitem_report_filter.html.erb | 90 ++-- 7 files changed, 323 insertions(+), 259 deletions(-) diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index ca5a6932..fe902e68 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -1110,15 +1110,17 @@ $(function() { }); if (inclusive_tax >0){ inclusive_total = total_price / inclusive_tax; + total_price = total_price; } if (exclusive_tax >0){ exclusive_total = total_price * exclusive_tax; + total_price = total_price + exclusive_total; } - total_price = total_price + exclusive_total + inclusive_total; + var fixed_total_price = parseFloat(total_price).toFixed(2); var fixed_taxable_amount = parseFloat(taxable_amount).toFixed(2); $('#total_tax').empty(); - $('#total_tax').append(exclusive_total + inclusive_total); + $('#total_tax').append(parseInt(exclusive_total) + parseInt(inclusive_total)); $('#sub_total').empty(); $('#sub_total').append(fixed_total_price); diff --git a/app/controllers/base_report_controller.rb b/app/controllers/base_report_controller.rb index eb7be119..a5a8801d 100755 --- a/app/controllers/base_report_controller.rb +++ b/app/controllers/base_report_controller.rb @@ -33,8 +33,7 @@ class BaseReportController < ActionController::Base if params[:from].present? && params[:to].present? from = Time.parse(params[:from]) to = Time.parse(params[:to]) - puts "from - to<<<<<<<<<<<<<<<<<<<<" - puts "#{from},#{to}" + else case period.to_i when PERIOD["today"] diff --git a/app/models/printer/printer_worker.rb b/app/models/printer/printer_worker.rb index 4795be34..d30af42d 100755 --- a/app/models/printer/printer_worker.rb +++ b/app/models/printer/printer_worker.rb @@ -45,7 +45,7 @@ class Printer::PrinterWorker if printer_destination.nil? printer_destination = self.printer_destination end - + copy = self.print_copies #Print only when printer information is not null if !self.printer_destination.nil? diff --git a/app/models/sale.rb b/app/models/sale.rb index 7ce2f5ad..9f8ef723 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -788,7 +788,7 @@ def self.daily_sales_list(from,to) daily_total = connection.select_all("SELECT IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) as grand_total, - IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) - (IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0)) as total_sale, + IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) as total_sale, IFNULL(SUM(case when (sale_status='completed') then old_grand_total else 0 end),0) as old_grand_total, IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0) as total_discount, IFNULL(SUM(case when (sale_status='completed') then amount_changed else 0 end),0) as total_change_amount, @@ -796,7 +796,7 @@ def self.daily_sales_list(from,to) IFNULL(SUM(case when (sale_status='completed') then rounding_adjustment else 0 end),0) as rounding_adj, IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) / 21 as tax, (IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0))-(IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) / 21) as net_sale, - SUM(grand_total + total_discount) as gross_sale, + (IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0)) + (IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0)) as gross_sale, CAST((CONVERT_TZ(receipt_date,'+00:00','+06:30')) AS DATE) as sale_date, SUM(kbzpay_amount) as kbzpay_amount, SUM(mpu_amount) as mpu_amount, @@ -2068,9 +2068,14 @@ def self.get_by_hourly_items(shift_sale_range, shift, from, to, status,type,acco query = self.get_hourly_item_query(type,filter,false) end - puts "start time - end time >>>>>>>>>" - puts "#{start_time},#{end_time}" - + unless start_time.blank? && end_time.blank? + from_date = from.to_date + to_date = to.to_date + from_date_time = DateTime.new(from_date.year, from_date.month, from_date.day, start_time.hour, start_time.min, start_time.sec, start_time.zone) + to_date_time = DateTime.new(to_date.year, to_date.month, to_date.day, end_time.hour, end_time.min, end_time.sec, end_time.zone) + receipt_date = "sales.receipt_date between '#{from_date_time}' and '#{to_date_time}'" + query = self.get_hourly_item_query(type,filter,false) + end # query = self.get_hourly_item_query(type,filter) diff --git a/app/views/reports/dailysale/index.html.erb b/app/views/reports/dailysale/index.html.erb index 082f135b..2540401b 100755 --- a/app/views/reports/dailysale/index.html.erb +++ b/app/views/reports/dailysale/index.html.erb @@ -24,11 +24,11 @@ - + <% @count = 1 %> <% @payment_methods.each_slice(10) do |slice| %> - + - - + + + + + + <% if @tax.blank? %> + + <% end %> + - <% unless @sale_data.blank? %> - - - <% void = 0 %> - <% mpu = 0 %> - <% master = 0 %> - <% visa = 0 %> - <% jcb = 0 %> - <% unionpay = 0 %> - <% alipay = 0 %> - <% paymal = 0 %> - <% dinga = 0 %> - <% junctionpay = 0 %> - <% giftvoucher = 0 %> - <% paypar = 0 %> - <% cash = 0 %> - <% credit = 0 %> - <% foc = 0 %> - <% discount = 0 %> - <% kbzpay = 0 %> - <% total = 0 %> - <% grand_total = 0 %> - <% old_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] %> - <% unionpay += sale[:unionpay_amount] %> - <% alipay += sale[:alipay_amount] %> - <% paymal += sale[:paymal_amount] %> - <% dinga += sale[:dinga_amount] %> - <% junctionpay += sale[:junctionpay_amount] %> - <% giftvoucher += sale[:giftvoucher_amount] %> - <% paypar += sale[:paypar_amount] %> - <% cash += sale[:cash_amount]-sale[:total_change_amount] %> - <% credit += sale[:credit_amount] %> - <% foc += sale[:foc_amount] %> - <% discount += sale[:total_discount] %> - <% kbzpay += sale[:kbzpay_amount] %> - <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> - <% grand_total += sale[:grand_total].to_f %> - <% old_grand_total += sale[:old_grand_total].to_f %> - <% rounding_adj += sale[:rounding_adj].to_f %> - - - - <% if @payment_methods.include? ("MPU") %> - - <% end %> - <% if @payment_methods.include? ("Master") %> - - <% end %> - <% if @payment_methods.include? ("VISA") %> - - <% end %> - <% if @payment_methods.include? ("JCB") %> - - <% end %> - <% if @payment_methods.include? ("UNIONPAY") %> - - <% end %> - <% if @payment_methods.include? ("Alipay") %> - - <% end %> - <% if @payment_methods.include? ("KBZPay") %> + <% unless @sale_data.blank? %> + + <% void = 0 %> + <% mpu = 0 %> + <% master = 0 %> + <% visa = 0 %> + <% jcb = 0 %> + <% unionpay = 0 %> + <% alipay = 0 %> + <% paymal = 0 %> + <% dinga = 0 %> + <% junctionpay = 0 %> + <% giftvoucher = 0 %> + <% paypar = 0 %> + <% cash = 0 %> + <% credit = 0 %> + <% foc = 0 %> + <% discount = 0 %> + <% kbzpay = 0 %> + <% total = 0 %> + <% grand_total = 0 %> + <% old_grand_total = 0 %> + <% gross_sale = 0 %> + <% total_sale = 0 %> + <% tax = 0 %> + <% net_sale = 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] %> + <% unionpay += sale[:unionpay_amount] %> + <% alipay += sale[:alipay_amount] %> + <% paymal += sale[:paymal_amount] %> + <% dinga += sale[:dinga_amount] %> + <% junctionpay += sale[:junctionpay_amount] %> + <% giftvoucher += sale[:giftvoucher_amount] %> + <% paypar += sale[:paypar_amount] %> + <% cash += sale[:cash_amount]-sale[:total_change_amount] %> + <% credit += sale[:credit_amount] %> + <% foc += sale[:foc_amount] %> + <% discount += sale[:total_discount] %> + <% kbzpay += sale[:kbzpay_amount] %> + <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> + <% grand_total += sale[:grand_total].to_f %> + <% old_grand_total += sale[:old_grand_total].to_f %> + <% rounding_adj += sale[:rounding_adj].to_f %> + <% gross_sale += sale[:gross_sale].to_f %> + <% total_sale += sale[:total_sale].to_f %> + <% tax += sale[:tax].to_f %> + <% net_sale += sale[:net_sale].to_f %> + + + + <% if @payment_methods.include? ("MPU") %> + + <% end %> + <% if @payment_methods.include? ("Master") %> + + <% end %> + <% if @payment_methods.include? ("VISA") %> + + <% end %> + <% if @payment_methods.include? ("JCB") %> + + <% end %> + <% if @payment_methods.include? ("UNIONPAY") %> + + <% end %> + <% if @payment_methods.include? ("Alipay") %> + + <% end %> + <% if @payment_methods.include? ("KBZPay") %> <% end %> - <% if @payment_methods.include? ("PAYMAL") %> - - <% end %> - <% if @payment_methods.include? ("DINGA") %> - - <% end %> - <% if @payment_methods.include? ("JunctionPay") %> - - <% end %> - <% if @payment_methods.include? ("Redeem") %> - - <% end %> - - - - - <% if @payment_methods.include? ("GiftVoucher") %> - - <% end %> - - - - + <% if @payment_methods.include? ("PAYMAL") %> + + <% end %> + <% if @payment_methods.include? ("DINGA") %> + + <% end %> + <% if @payment_methods.include? ("JunctionPay") %> + + <% end %> + <% if @payment_methods.include? ("Redeem") %> + + <% end %> + <% if @payment_methods.include? ("GiftVoucher") %> + + <% end %> + + + + - - <% count = count + 1 %> - <% end %> - <% colspan = 7 %> - - - <% if @payment_methods.include? ("MPU") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("Master") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("VISA") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("JCB") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("UNIONPAY") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("Alipay") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("KBZPay") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("PAYMAL") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("DINGA") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("JunctionPay") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("Redeem") %> - <% colspan += 1 %> - - <% end %> - - - - - <% if @payment_methods.include? ("GiftVoucher") %> - <% colspan += 1 %> - - <% end %> - - - + + + + + + <% if @tax.blank? %> + + <% end %> + - - - + + <% count = count + 1 %> + <% end %> + <% colspan = 7 %> + + + <% if @payment_methods.include? ("MPU") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("Master") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("VISA") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("JCB") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("UNIONPAY") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("Alipay") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("KBZPay") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("PAYMAL") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("DINGA") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("JunctionPay") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("Redeem") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("GiftVoucher") %> + <% colspan += 1 %> + + <% end %> + + + + + + + + + + + + + + + + + <% total_tax = 0 %> + <% net = 0 %> + <% unless @tax.blank? %> + <% @tax.each do |tax| + total_tax += tax.tax_amount.to_f %> + + + + + <% end %> + <% net = grand_total %> + <% net = net - rounding_adj%> + <% net = net - total_tax %> + + + - <% total_tax = 0 %> - <% net = 0 %> - <% unless @tax.blank? %> - <% @tax.each do |tax| - total_tax += tax.tax_amount.to_f %> - - - - - <% end %> - <% end %> - - <% net = grand_total %> - <% net = net - rounding_adj%> - <% net = net - total_tax %> - - - - - - <% end %> -
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
<%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %>(<%= t("views.right_panel.detail.discount") %>)<%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.gross_sales") %><%= t("views.right_panel.detail.total_sales") %><%= t("views.right_panel.detail.tax") %><%= t("views.right_panel.detail.net_sales") %>
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") 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[:unionpay_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:alipay_amount]),delimiter => ',') rescue '-'%>
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_format(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:kbzpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:paymal_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:dinga_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:junctionpay_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), delimiter: delimiter) rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:giftvoucher_amount]),delimiter => ',') rescue '-'%>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]),delimiter => ',') rescue '-'%><%= number_format(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%><%= number_format(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%>
Total<%= number_with_delimiter(sprintf("%.2f",mpu),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa), delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",unionpay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",alipay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",kbzpay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paymal),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",dinga),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",junctionpay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",cash),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",credit),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",void),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",foc), delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",giftvoucher), delimiter => ',') rescue '-'%>(<%= number_with_delimiter(discount,delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",rounding_adj),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",grand_total),delimiter => ',') rescue '-'%>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)<%= number_format(sale[:rounding_adj].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:gross_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:total_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:tax], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%>
 
Total<%= number_format(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(kbzpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(void, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%>(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)<%= number_format(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(gross_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(total_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(tax, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
 
<%= tax.tax_name rescue '-'%><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
<%= t("views.right_panel.detail.net_amount") %><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
<%= tax.tax_name rescue '-'%><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount),delimiter => ',') rescue '-'%>
<%= t("views.right_panel.detail.net_amount") %><%= number_with_delimiter(sprintf("%.2f",net),delimiter => ',') rescue '-'%>
- + <% else %> + + <%= t("views.right_panel.detail.net_amount") %> + <%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%> + + <% end %> + + <% end %> + + diff --git a/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb b/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb index 7658748e..9dc60e4c 100644 --- a/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb +++ b/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb @@ -10,23 +10,49 @@ -
- - -
-
- - -
- + <% end %> +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ + +
- -
- - -
- -
- - -
-
- - -