diff --git a/app/models/ability.rb b/app/models/ability.rb index 50f37fbc..4470fb4b 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -41,6 +41,13 @@ class Ability can :index, :credit_payment can :index, :void_sale + can :show, :dailysale + can :show, :saleitem + can :show, :receipt_no + can :show, :shiftsale + can :show, :credit_payment + can :show, :void_sale + can :get_customer, Customer can :add_customer, Customer can :update_sale_by_customer, Customer @@ -128,6 +135,12 @@ class Ability can :index, :shiftsale can :index, :credit_payment can :index, :void_sale + can :show, :dailysale + can :show, :saleitem + can :show, :receipt_no + can :show, :shiftsale + can :show, :credit_payment + can :show, :void_sale elsif user.role == "supervisor" diff --git a/app/views/reports/credit_payment/index.xls.erb b/app/views/reports/credit_payment/index.xls.erb index 9597e3d9..af3d773e 100755 --- a/app/views/reports/credit_payment/index.xls.erb +++ b/app/views/reports/credit_payment/index.xls.erb @@ -1,20 +1,43 @@ -
-
+ + + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %> +
+ + + + + + + + +
+
<% unless @sale_data.blank? %> <% if !params[:from].blank?%> - + <% end %> - - - - - + + + + + @@ -36,4 +59,4 @@
From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%><%= t("views.right_panel.detail.from_date") %> : <%= params[:from] rescue '-'%> , <%= t("views.right_panel.detail.to_date") %> : <%= params[:to] rescue '-'%>
Shift Name Receive No Cashier Name Customer Name Credit Amount <%= t("views.right_panel.detail.shift_name") %> <%= t("views.right_panel.detail.receipt_no") %> <%= t :cashier %> <%= t("views.right_panel.detail.name") %> <%= t :customer %> <%= t("views.right_panel.detail.name") %> <%= t("views.right_panel.detail.credit_amount") %>
<% end %>
-
\ No newline at end of file +
diff --git a/app/views/reports/dailysale/index.xls.erb b/app/views/reports/dailysale/index.xls.erb index c1eda6ef..82ed099a 100755 --- a/app/views/reports/dailysale/index.xls.erb +++ b/app/views/reports/dailysale/index.xls.erb @@ -1,118 +1,142 @@ -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - <% 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 %> - <% 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] %> - <% paypar += sale[:paypar_amount] %> - <% cash += sale[:cash_amount]-sale[:total_change_amount] %> - <% credit += sale[:credit_amount] %> - <% foc += sale[:foc_amount] %> - <% discount += sale[:total_discount] %> - <% total += sale[:old_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 %> - - - - - - - - - - - - - - - - - - <% 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 %> -
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
Sr.noDateVoid AmountMpu SalesMaster SalesVisa SalesJcb SalesRedeem 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]-sale[:total_change_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[:old_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[:old_grand_total]), :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",paypar), :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",old_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 '-'%> 
-
-
+ +
+
+ <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %> +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + <% 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 %> + <% 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] %> + <% paypar += sale[:paypar_amount] %> + <% cash += sale[:cash_amount]-sale[:total_change_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 %> + <% old_grand_total += sale[:old_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 %> +
<%= 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.sr") %><%= t("views.right_panel.detail.date") %><%= t("views.right_panel.detail.void_amount") %><%= t("views.right_panel.detail.mpu_sales") %><%= t("views.right_panel.detail.master_sales") %><%= t("views.right_panel.detail.visa_sales") %><%= t("views.right_panel.detail.jcb_sales") %><%= t("views.right_panel.detail.redeem_sales") %><%= t("views.right_panel.detail.cash_sales") %><%= t("views.right_panel.detail.credit_sales") %><%= t("views.right_panel.detail.foc_sales") %>(<%= t("views.right_panel.detail.discount") %>)<%= t("views.right_panel.detail.grand_total") %> +
<%= t("views.right_panel.detail.rnd_adj_sh") %>
<%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.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]-sale[:total_change_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), :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",paypar), :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 '-'%> 
<%= t("views.right_panel.detail.net_amount") %><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%> 
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/app/views/reports/receipt_no/index.xls.erb b/app/views/reports/receipt_no/index.xls.erb index cddb34f9..8bdd64fb 100755 --- a/app/views/reports/receipt_no/index.xls.erb +++ b/app/views/reports/receipt_no/index.xls.erb @@ -1,98 +1,130 @@ -
-
- - - - - - <% if @shift_from %> - - <% if @shift_data.employee %> - <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> - <% end %> - - - <% end %> - - - - - - - <% @sale_taxes.each do |tax| %> - - - <% end %> - - - - - - - - <% grand_total = 0 %> - <% old_grand_total = 0 %> - <% total_tax = 0 %> - <% guest_count = 0 %> - <% total_sum = 0 %> - <% discount_amt = 0 %> - <% other_amt = 0 %> - <% total_nett = 0 %> - <% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %> - <%if @sale_data %> - <% @sale_data.each do |result| %> - - <% grand_total = grand_total.to_f + result.grand_total.to_f %> - <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> - <% total_tax += result.total_tax.to_f %> - <% total_sum += result.total_amount.to_f %> - <% discount_amt += result.total_discount.to_f %> - <% rounding_adj += result.rounding_adjustment.to_f %> - - - - - - - - <% result.sale_taxes.each do |tax| %> - - <%end%> - - - - - - - <% end %> - - - - - <% @sale_taxes.each do |tax| %> - - <% end %> - - - - - - - - - <% @sale_taxes.each do |tax| %> - - <% end %> - - - - - <%end%> - -
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
Recipt NoCashier NameTotal AmountDiscount Amount <%= tax.tax_name %>Grand TotalRounding Adj.Grand Total +
- Rounding Adj. -
<%= result.receipt_no rescue '-' %> <%= result.cashier_name rescue '-' %><%= result.total_amount rescue '-' %><%= result.total_discount rescue '-' %><%= tax.tax_payable_amount rescue '-' %><%= result.old_grand_total %><%= result.rounding_adjustment.to_f rescue '-' %><%= result.grand_total_after_rounding() rescue '-'%>
 <%= total_sum rescue '-'%><%= discount_amt rescue '-'%><%= tax.st_amount.round(2) %><%= old_grand_total.to_f.round(2) rescue '-'%><%= rounding_adj rescue '-'%><%= old_grand_total.to_f.round + rounding_adj %>
 Total AmountDiscount Amount<%= tax.tax_name %>Grand TotalRounding Adj.Grand Total +
- Rounding Adj. -
+ +
+
+ + + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %> +
+ + + + + + + + +
+
+ + + + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> + + + + + + + <% @tax_profiles.each do |tax| %> + + <% end %> + + + + + + + + <% grand_total = 0 %> + <% old_grand_total = 0 %> + <% total_tax = 0 %> + <% guest_count = 0 %> + <% total_sum = 0 %> + <% discount_amt = 0 %> + <% other_amt = 0 %> + <% total_nett = 0 %> + <% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %> + <%if @sale_data %> + <% @sale_data.each do |result| %> + + <% grand_total = grand_total.to_f + result.grand_total.to_f %> + <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> + <% total_tax += result.total_tax.to_f %> + <% total_sum += result.total_amount.to_f %> + <% discount_amt += result.total_discount.to_f %> + <% rounding_adj += result.rounding_adjustment.to_f %> + + + + + + + + <%if result.customer.customer_type == "Takeaway"%> + + <%end%> + <% result.sale_taxes.each do |tax| %> + + <%end%> + + + + + + + <% end %> + + + + + <% @sale_taxes.each do |tax| %> + + <% end %> + + + + + + + + + + <% @tax_profiles.each do |tax| %> + + <% end %> + + + + + <%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.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
<%= t("views.right_panel.detail.receipt_no") %><%= t :cashier %> <%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> <%= tax.name %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
+ <%= t("views.right_panel.detail.rnd_adj_sh") %> +
<%= result.receipt_no rescue '-' %> <%= result.cashier_name rescue '-' %><%= result.total_amount rescue '-' %><%= result.total_discount rescue '-' %>0.0<%= tax.tax_payable_amount rescue '-' %><%= result.grand_total %><%= result.rounding_adjustment.to_f rescue '-' %><%= result.grand_total_after_rounding() rescue '-'%>
 <%= total_sum rescue '-'%><%= discount_amt rescue '-'%><%= tax.st_amount.round(2) %><%= grand_total.to_f.round(2) rescue '-'%><%= rounding_adj rescue '-'%><%= grand_total.to_f.round + rounding_adj %>
 <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %><%= tax.name %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
+ <%= t("views.right_panel.detail.rnd_adj_sh") %> +
+
+
+
\ No newline at end of file diff --git a/app/views/reports/saleitem/index.xls.erb b/app/views/reports/saleitem/index.xls.erb index 74886913..284b78fc 100755 --- a/app/views/reports/saleitem/index.xls.erb +++ b/app/views/reports/saleitem/index.xls.erb @@ -1,148 +1,193 @@ -
-
-
- + +
+
+ <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %> - - +
- - - - <% if @shift_from %> - - <% if @shift_data.employee %> - <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> - <% end %> - - - <% end %> - - - - - - - - - - - - <% unless @sale_data.blank? %> - <% 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_qty = 0%> - <% total_amount = 0 %> - <% discount = 0%> - - <% @sale_data.each do |sale| %> - <% total_qty += sale.total_item %> - - <% if !acc_arr.include?(sale.account_id) %> - - - - - + + + + + + + + + + + + + + + + + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
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 %> - <% grand_total += total %> +
+
+
+ + + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + <% end %> + + + + + + + + + + + + <% unless @sale_data.blank? %> + <% acc_arr = Array.new %> + <% cate_arr = Array.new %> + + <% sub_total = 0 %> + <% other_sub_total = 0 %> + <% count = 0 %> + <% total_price = 0 %> + <% cate_count = 0 %> + <% acc_count = 0 %> + <% grand_total = 0 %> + <% total_qty = 0 %> + <% total_amount = 0 %> + <% discount = 0 %> + <% total_item_foc = 0 %> + <% total_item_dis = 0 %> + + <% @sale_data.each do |sale| %> + + <% if sale.total_item > 0 + total_qty += sale.total_item + end %> + + <% 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 %> + + + + + + + + <% @menu_cate_count.each do |key,value| %> + <% if sale.menu_category_id == key %> + + <% count = count + 1 %> + <% sub_total += sale.grand_total %> + <% if count == value %> + + + + + + <% if sale.status_type === "foc" + total_item_foc += sale.grand_total + end %> + + <% if sale.status_type === "Discount" + total_item_dis += sale.grand_total + end %> + <% sub_total = 0.0%> + <% count = 0%> + <% end %> + <% end %> + <% end %> + + <% end %> + + + + + + + <% @other_charges.each do |other| %> + <% if other.total_item > 0 + total_qty += other.total_item + end %> + <% grand_total +=other.grand_total%> + + + + + + + + + + + + <% other_sub_total += other.grand_total %> + + <% end %> + + + + + + + + + + + + + <% end %> - - - <% acc_arr.push(sale.account_id) %> - <% end %> - - - <% if !cate_arr.include?(sale.menu_category_id) %> - - <% cate_arr.push(sale.menu_category_id) %> - <% 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%> - <% count = 0%> - <% end %> - <% end %> - <% end %> - - - - <% end %> - - - - - - - - - <% 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.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
 <%= t("views.right_panel.header.menu_category") %><%= t("views.right_panel.detail.code") %><%= t("views.right_panel.detail.product") %><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %><%= t("views.right_panel.detail.unit_price") %><%= t("views.right_panel.detail.revenue") %>
<%= sale.account_name %> <%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %> + <% @totalByAccount.each do |account, total| %> + <% if sale.account_id == account %> + <%= total %> + <% grand_total += total %> + <% end %> + <% end %> +
 <%= sale.menu_category_name %> <%= sale.item_code rescue '-' %><%= sale.product_name rescue '-' %><%= sale.total_item rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total rescue '-' %>
 <%= t("views.right_panel.detail.sub_total") %><%= sub_total %>
Other Charges 
 Other Charges<%= other.item_code rescue '-' %><%= other.product_name rescue '-' %><%= other.total_item rescue '-' %><%= other.unit_price rescue '-' %><%= other.grand_total rescue '-' %>
 <%= t("views.right_panel.detail.sub_total") %><%= other_sub_total %>
 <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %><%= total_qty%><%= t("views.right_panel.detail.net_amount") %><%= grand_total%>
 <%= sale.menu_category_name %> <%= sale.item_code rescue '-' %><%= sale.product_name rescue '-' %><%= sale.total_item rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total rescue '-' %>
 Sub Total<%= sub_total %>
 Total Item<%= total_qty%>Total Amount<%= grand_total%>
 Cash Received<%= @cash_data - @change_amount %>
 Card Sales<%= @card_data %>
 Credit Sales<%= @credit_data %>
 FOC Sales<%= @foc_data %>
 Discount Amount<%= @discount_data %>
 Grand Total<%= @grand_total - @change_amount%>
-
-
-
+
 <%= t("views.right_panel.detail.foc_item") %> <%= t("views.right_panel.detail.amount") %><%= total_item_foc %>
 <%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %><%= total_item_dis %>
 <%= t("views.right_panel.detail.foc_sales") %><%= @foc_data %>
 <%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %><%= @discount_data %>
+
+
+
+
+
\ No newline at end of file diff --git a/app/views/reports/shiftsale/index.xls.erb b/app/views/reports/shiftsale/index.xls.erb index 951268e9..7a7b1836 100755 --- a/app/views/reports/shiftsale/index.xls.erb +++ b/app/views/reports/shiftsale/index.xls.erb @@ -1,99 +1,124 @@ -
+ +
+
+ + + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_shiftsale_index_path} %> +
+ + + + + + + + +
-
-
+
+
- - - - - <% if @shift_from %> + + + + + <% if @shift_from %> <% if @shift_data.employee %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% end %> - + - <% end %> - - - - - - - - - - - + <% end %> + + + + + + + + + + +
Rounding Adj --> - - - - - <% void = 0%> - <% cash = 0%> - <% credit = 0%> - <% accept_credit = 0%> - <% foc = 0%> - <% card = 0%> - <% total = 0%> - <% rounding_adj = 0%> - <% g_total = 0 %> + + + + + <% void = 0%> + <% cash = 0%> + <% credit = 0%> + <% accept_credit = 0%> + <% foc = 0%> + <% card = 0%> + <% total = 0%> + <% rounding_adj = 0%> + <% g_total = 0 %> - <% @sale_data.each do |result|%> - - - - - - - - + <% @sale_data.each do |result|%> + + + + + + + + - + <% grand_total = result.grand_total.to_f %> - - - <% cash += result.cash_sales.to_f %> - <% credit += result.credit_sales.to_f %> - <% card += result.other_sales.to_f %> - - <% total += result.grand_total.to_f %> - <% g_total += grand_total.to_f %> + + + <% cash += result.cash_sales.to_f %> + <% credit += result.credit_sales.to_f %> + <% card += result.other_sales.to_f %> - <% end %> + <% total += result.grand_total.to_f %> + <% g_total += grand_total.to_f %> - - - - - - - - - - - - - + <% end %> + + + + + + + + + + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - - 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 '-'%> + +
Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
Cashier StationCashier NameShift NameCash PaymentCredit PaymentOther Payment
<%= t("views.right_panel.detail.cashier_station") %><%= t :cashier %> <%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.shift_name") %><%= t("views.right_panel.detail.cash_payment") %><%= t("views.right_panel.detail.credit_payment") %><%= t("views.btn.other_payment") %> Grand Total
<%= t("views.right_panel.detail.grand_total") %>
- <%= result.cashier_terminal.name rescue '-'%> - - <%= result.employee.name rescue '-'%> - <%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> - - <%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %> - <%= sprintf "%.2f",result.cash_sales.to_f.to_d rescue '-'%><%= sprintf "%.2f",result.credit_sales.to_f.to_d rescue '-'%>
+ <%= result.cashier_terminal.name rescue '-'%> + + <%= result.employee.name rescue '-'%> + <%= result.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> - + <%= result.shift_closed_at.strftime("%e %b %I:%M%p") rescue '-' %> + <%= sprintf "%.2f",result.cash_sales.to_f.to_d rescue '-'%><%= sprintf "%.2f",result.credit_sales.to_f.to_d rescue '-'%> <%= sprintf "%.2f",result.other_sales.to_f.to_d rescue '-'%> <%= sprintf "%.2f",result.grand_total.to_f.to_d rescue '-'%>
<%= sprintf("%.2f",cash) rescue '-'%><%= sprintf("%.2f",credit) rescue '-'%><%= sprintf("%.2f",card) rescue '-'%><%= sprintf("%.2f",g_total) rescue '-'%>
<%= sprintf("%.2f",cash) rescue '-'%><%= sprintf("%.2f",credit) rescue '-'%><%= sprintf("%.2f",card) rescue '-'%><%= sprintf("%.2f",g_total) rescue '-'%>
diff --git a/app/views/reports/void_sale/index.html.erb b/app/views/reports/void_sale/index.html.erb index 2302e373..e7269970 100755 --- a/app/views/reports/void_sale/index.html.erb +++ b/app/views/reports/void_sale/index.html.erb @@ -1,11 +1,11 @@
diff --git a/app/views/reports/void_sale/index.xls.erb b/app/views/reports/void_sale/index.xls.erb index c73a4bde..04126706 100755 --- a/app/views/reports/void_sale/index.xls.erb +++ b/app/views/reports/void_sale/index.xls.erb @@ -1,63 +1,88 @@ -
-
- <% if @sale_data.count > 0 %> - - - <% if !params[:from].blank?%> - - - - <% end %> - <% if @shift_from %> - - <% if @shift %> - <% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %> - <% end %> - - - <% end %> - - - - - - - - - - - - <% total_amount = 0.0 %> - <% grand_total = 0.0 %> - <% rounding_adjustment = 0.0 %> - <% grand_rounding_adjustment = 0.0 %> - <% @sale_data.each do |result| %> - <% result[:items].each do |item| %> - - - - - - - - - - - <% total_amount = total_amount.to_f + item.total_amount.to_f %> - <% grand_total = grand_total.to_f + item.grand_total.to_f %> - <% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.to_f %> - <% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %> - <% end %> - <% end %> - - - - - - - - -
From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%>
Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )
Receipt NoSale DateTotal AmountGrand TotalRounding Adj.Grand Total +
Rounding Adj.
<%= item.receipt_no rescue '-' %> <%= item.receipt_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-' %><%= item.total_amount.to_f rescue '-'%> <%= item.grand_total.to_f rescue '-'%> <%= item.rounding_adjustment.to_f rescue '-' %><%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%>
Total Void Amount :<%= total_amount rescue '-' %><%= grand_total rescue '-' %><%= rounding_adjustment rescue '-'%><%= grand_rounding_adjustment rescue '-'%>
-<% end %> -
-
\ No newline at end of file + +
+
+ + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_void_sale_index_path} %> +
+ + + + + + + + +
+
+ <% if @sale_data.count > 0 %> + + + <% if !params[:from].blank?%> + + + + <% end %> + <% if @shift_from %> + + <% if @shift %> + <% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %> + <% end %> + + + <% end %> + + + + + + + + + + + + <% total_amount = 0.0 %> + <% grand_total = 0.0 %> + <% rounding_adjustment = 0.0 %> + <% grand_rounding_adjustment = 0.0 %> + <% @sale_data.each do |result| %> + <% result[:items].each do |item| %> + + + + + + + + + + + <% total_amount = total_amount.to_f + item.total_amount.to_f %> + <% grand_total = grand_total.to_f + item.grand_total.to_f %> + <% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.to_f %> + <% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %> + <% end %> + <% end %> + + + + + + + + +
<%= t("views.right_panel.detail.from_date") %> : <%= params[:from] rescue '-'%> , <%= t("views.right_panel.detail.to_date") %> : <%= params[:to] rescue '-'%>
<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )
<%= t("views.right_panel.detail.receipt_no") %><%= t("views.right_panel.detail.sale_date") %><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
<%= t("views.right_panel.detail.rnd_adj_sh") %>
<%= item.receipt_no rescue '-' %> <%= item.receipt_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-' %><%= item.total_amount.to_f rescue '-'%> <%= item.grand_total.to_f rescue '-'%> <%= item.rounding_adjustment.to_f rescue '-' %><%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%>
Total Void Amount :<%= total_amount rescue '-' %><%= grand_total rescue '-' %><%= rounding_adjustment rescue '-'%><%= grand_rounding_adjustment rescue '-'%>
+ <% end %> +
+
\ No newline at end of file