diff --git a/.idea/sxrestaurant.iml b/.idea/sxrestaurant.iml index 0413cc5e..7db49a58 100644 --- a/.idea/sxrestaurant.iml +++ b/.idea/sxrestaurant.iml @@ -38,6 +38,7 @@ + @@ -80,6 +81,7 @@ + @@ -112,6 +114,7 @@ + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index bda1b51d..e3687c57 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,32 +2,21 @@ + + - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + @@ -42,7 +31,7 @@ - + @@ -69,51 +58,58 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - + + @@ -122,28 +118,38 @@ - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + @@ -173,6 +179,8 @@ green reports_dailysale_index_path mom + gem "select2-rails" + custom_excel @@ -181,7 +189,6 @@ @@ -255,11 +263,11 @@ - + @@ -294,78 +302,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -373,70 +315,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -452,71 +336,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - + +
- - -
-
- - + + <% @commissioner.each do |c| %> + + <% end %>
@@ -44,76 +28,42 @@
\ No newline at end of file + diff --git a/app/views/reports/commission/index.html.erb b/app/views/reports/commission/index.html.erb index 9f75c8d5..4715b00c 100644 --- a/app/views/reports/commission/index.html.erb +++ b/app/views/reports/commission/index.html.erb @@ -6,112 +6,66 @@
- <%= render :partial=>'commission_report_filter', - :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_commission_index_path} %> -
+ <%= render :partial => 'commission_report_filter', + :locals => {:period_type => true, :shift_name => true, :report_path => reports_commission_index_path} %> +
-
- + - <% if @shift_from %> - - <% if @shift_data.employee %> - <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> - <% end %> - - - <% end %> - - - - - - - - - - - - + + + + + + - <% void = 0%> - <% cash = 0%> - <% credit = 0%> - <% accept_credit = 0%> - <% foc = 0%> - <% card = 0%> - <% total = 0%> - <% rounding_adj = 0%> - <% g_total = 0 %> + <% total_qty = 0 %> + <% total_price = 0 %> + <% total_amount = 0 %> - <% @sale_data.each do |result|%> + <% @transaction.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 %> - + <% total_qty += result.qty.to_f %> + <% total_price += result.price.to_f %> + <% total_amount += result.amount.to_f %> <% end %> - - - - - - - - - - + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> - - 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 %> )
Cashier StationCashier NameShift NameCash PaymentCredit PaymentOther PaymentGrand TotalCommissioner NameProduct NameQtyCommission PriceCommission AmountDate
- <%= result.cashier_terminal.name rescue '-'%> + <%= result.commissioner.name rescue '-' %> - <%= result.employee.name rescue '-'%> + <%= result.commission.menu_item.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", result.qty.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %><%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %>
<%= sprintf("%.2f",cash) rescue '-'%><%= sprintf("%.2f",credit) rescue '-'%><%= sprintf("%.2f",card) rescue '-'%><%= sprintf("%.2f",g_total) rescue '-'%><%= sprintf("%.2f", total_qty) rescue '-' %><%= sprintf("%.2f", total_price) rescue '-' %><%= sprintf("%.2f", total_amount) rescue '-' %>
@@ -119,91 +73,7 @@
diff --git a/app/views/reports/commission/index.xls.erb b/app/views/reports/commission/index.xls.erb index e3daaca2..4ea1f2f0 100644 --- a/app/views/reports/commission/index.xls.erb +++ b/app/views/reports/commission/index.xls.erb @@ -1,100 +1,52 @@
-
- + - <% if @shift_from %> - - <% if @shift_data.employee %> - <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> - <% end %> - - - <% end %> - - - - - - - - - - - - - + + + + + + - <% void = 0%> - <% cash = 0%> - <% credit = 0%> - <% accept_credit = 0%> - <% foc = 0%> - <% card = 0%> - <% total = 0%> - <% rounding_adj = 0%> - <% g_total = 0 %> + <% total_qty = 0 %> + <% total_price = 0 %> + <% total_amount = 0 %> - <% @sale_data.each do |result|%> + <% @transaction.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 %> - + <% total_qty += result.qty.to_f %> + <% total_price += result.price.to_f %> + <% total_amount += result.amount.to_f %> <% end %> - - - - - - - - - - + + + + +
From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> - - 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 %> )
Cashier StationCashier NameShift NameCash PaymentCredit PaymentOther PaymentGrand TotalCommissioner NameProduct NameQtyCommission PriceCommission AmountDate
- <%= result.cashier_terminal.name rescue '-'%> + <%= result.commissioner.name rescue '-' %> - <%= result.employee.name rescue '-'%> + <%= result.commission.menu_item.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", result.qty.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %><%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %>
<%= sprintf("%.2f",cash) rescue '-'%><%= sprintf("%.2f",credit) rescue '-'%><%= sprintf("%.2f",card) rescue '-'%><%= sprintf("%.2f",g_total) rescue '-'%><%= sprintf("%.2f", total_qty) rescue '-' %><%= sprintf("%.2f", total_price) rescue '-' %><%= sprintf("%.2f", total_amount) rescue '-' %>
-
\ No newline at end of file +
diff --git a/dump.rdb b/dump.rdb index 6e3e4bdb..3826c8c6 100644 Binary files a/dump.rdb and b/dump.rdb differ