update ability and report xls

This commit is contained in:
Aung Myo
2017-12-01 13:54:58 +06:30
parent 1dd920088b
commit a687e77efa
8 changed files with 696 additions and 509 deletions

View File

@@ -41,6 +41,13 @@ class Ability
can :index, :credit_payment can :index, :credit_payment
can :index, :void_sale 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 :get_customer, Customer
can :add_customer, Customer can :add_customer, Customer
can :update_sale_by_customer, Customer can :update_sale_by_customer, Customer
@@ -128,6 +135,12 @@ class Ability
can :index, :shiftsale can :index, :shiftsale
can :index, :credit_payment can :index, :credit_payment
can :index, :void_sale 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" elsif user.role == "supervisor"

View File

@@ -1,20 +1,43 @@
<div class="container margin-top-20"> <div class="page-header">
<div class="card row"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.credit_payment_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %>
<hr />
<!-- </div> -->
<!-- <div class="container"> -->
<!-- <div class="row"> -->
<div class="text-right">
<a href="javascript:export_to('<%=reports_credit_payment_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<div class="card ">
<% unless @sale_data.blank? %> <% unless @sale_data.blank? %>
<table class="table table-striped" border="0"> <table class="table table-striped" border="0">
<thead> <thead>
<% if !params[:from].blank?%> <% if !params[:from].blank?%>
<tr> <tr>
<th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th> <th colspan="7"><%= t("views.right_panel.detail.from_date") %> : <%= params[:from] rescue '-'%> , <%= t("views.right_panel.detail.to_date") %> : <%= params[:to] rescue '-'%></th>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<th> Shift Name </th> <th> <%= t("views.right_panel.detail.shift_name") %> </th>
<th> Receive No</th> <th> <%= t("views.right_panel.detail.receipt_no") %></th>
<th> Cashier Name</th> <th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th> Customer Name</th> <th> <%= t :customer %> <%= t("views.right_panel.detail.name") %></th>
<th> Credit Amount </th> <th> <%= t("views.right_panel.detail.credit_amount") %> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -1,27 +1,47 @@
<div class="container margin-top-20">
<div class="card row"> <div class="page-header">
<div class="table-responsive"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-md-12 col-lg-12 col-sm-12 ">
<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
<hr />
<div class=" text-right">
<a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
<div class="row">
<div class="col-md-12 col-lg-12">
<div class="card" >
<div class="body table-responsive">
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th colspan="15"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th> <th colspan="15"> <%= 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 '-'%></th>
</tr> </tr>
<tr> <tr>
<th style='text-align:center;'>Sr.no</th> <th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
<th style='text-align:center;'>Date</th> <th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
<th style='text-align:center;'>Void Amount</th> <th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
<th style='text-align:center;'>Mpu Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.mpu_sales") %></th>
<th style='text-align:center;'>Master Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
<th style='text-align:center;'>Visa Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.visa_sales") %></th>
<th style='text-align:center;'>Jcb Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.jcb_sales") %></th>
<th style='text-align:center;'>Redeem Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.redeem_sales") %></th>
<th style='text-align:center;'>Cash Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
<th style='text-align:center;'>Credit Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
<th style='text-align:center;'>FOC Sales</th> <th style='text-align:center;'><%= t("views.right_panel.detail.foc_sales") %></th>
<th style='text-align:center;'>(Discount)</th> <th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
<th style='text-align:center;'>Grand Total + <br/> Rounding Adj.</th> <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<th style='text-align:center;'>Rounding Adj.</th> <th style='text-align:center;'><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<th style='text-align:center;'>Grand Total</th> <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
</tr> </tr>
</thead> </thead>
<% unless @sale_data.empty? %> <% unless @sale_data.empty? %>
@@ -52,7 +72,7 @@
<% credit += sale[:credit_amount] %> <% credit += sale[:credit_amount] %>
<% foc += sale[:foc_amount] %> <% foc += sale[:foc_amount] %>
<% discount += sale[:total_discount] %> <% discount += sale[:total_discount] %>
<% total += sale[:old_grand_total].to_f + sale[:rounding_adj].to_f %> <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %>
<% grand_total += sale[:grand_total].to_f %> <% grand_total += sale[:grand_total].to_f %>
<% old_grand_total += sale[:old_grand_total].to_f %> <% old_grand_total += sale[:old_grand_total].to_f %>
<% rounding_adj += sale[:rounding_adj].to_f %> <% rounding_adj += sale[:rounding_adj].to_f %>
@@ -69,9 +89,9 @@
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td> <td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)</td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%></td>
</tr> </tr>
<% count = count + 1 %> <% count = count + 1 %>
<% end %> <% end %>
@@ -89,7 +109,7 @@
<td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td> <td style='text-align:right;'>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)</td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%></td>
</tr> </tr>
<% total_tax = 0 %> <% total_tax = 0 %>
@@ -105,7 +125,7 @@
<% end %> <% end %>
<% net = total - total_tax %> <% net = total - total_tax %>
<tr style="font-weight:600;"> <tr style="font-weight:600;">
<td colspan="12" style='text-align:right;'>Net Amount</td> <td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td>
<td colspan="2">&nbsp;</td> <td colspan="2">&nbsp;</td>
</tr> </tr>
@@ -116,3 +136,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>

View File

@@ -1,33 +1,59 @@
<div class="container margin-top-20"> <div class="page-header">
<div class="card row"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.receipt_no_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-md-12">
<!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %>
<hr />
<!-- </div> -->
<!-- <div class="container"> -->
<!-- <div class="row"> -->
<div class="text-right">
<a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<div class="card">
<table class="table table-striped" border="0"> <table class="table table-striped" border="0">
<thead> <thead>
<tr> <tr>
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th> <th colspan="9"> <%= 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 '-'%></th>
</tr> </tr>
<% if @shift_from %> <% if @shift_from %>
<tr> <tr>
<% if @shift_data.employee %> <% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %> <% end %>
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th> <th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<th>Recipt No</th> <th><%= t("views.right_panel.detail.receipt_no") %></th>
<th>Cashier Name</th> <th><%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th>Total Amount</th> <th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></th>
<th>Discount Amount </th> <th><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> </th>
<% @sale_taxes.each do |tax| %> <% @tax_profiles.each do |tax| %>
<th><%= tax.tax_name %></th> <th><%= tax.name %></th>
<% end %> <% end %>
<!-- <th>Other Amount</th> --> <!-- <th>Other Amount</th> -->
<th>Grand Total</th> <th><%= t("views.right_panel.detail.grand_total") %></th>
<th>Rounding Adj.</th> <th><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<th>Grand Total +<br/> <th><%= t("views.right_panel.detail.grand_total") %> +<br/>
Rounding Adj. <%= t("views.right_panel.detail.rnd_adj_sh") %>
</th> </th>
</tr> </tr>
</thead> </thead>
@@ -57,11 +83,14 @@
<td><%= result.cashier_name rescue '-' %></td> <td><%= result.cashier_name rescue '-' %></td>
<td><%= result.total_amount rescue '-' %></td> <td><%= result.total_amount rescue '-' %></td>
<td><%= result.total_discount rescue '-' %></td> <td><%= result.total_discount rescue '-' %></td>
<%if result.customer.customer_type == "Takeaway"%>
<td>0.0</td>
<%end%>
<% result.sale_taxes.each do |tax| %> <% result.sale_taxes.each do |tax| %>
<td><%= tax.tax_payable_amount rescue '-' %></td> <td><%= tax.tax_payable_amount rescue '-' %></td>
<%end%> <%end%>
<td><%= result.old_grand_total %></td> <td><%= result.grand_total %></td>
<td><%= result.rounding_adjustment.to_f rescue '-' %></td> <td><%= result.rounding_adjustment.to_f rescue '-' %></td>
<td><%= result.grand_total_after_rounding() rescue '-'%></td> <td><%= result.grand_total_after_rounding() rescue '-'%></td>
</tr> </tr>
@@ -74,21 +103,22 @@
<% @sale_taxes.each do |tax| %> <% @sale_taxes.each do |tax| %>
<td><b><%= tax.st_amount.round(2) %></b></td> <td><b><%= tax.st_amount.round(2) %></b></td>
<% end %> <% end %>
<td><b><%= old_grand_total.to_f.round(2) rescue '-'%></b></td> <td><b><%= grand_total.to_f.round(2) rescue '-'%></b></td>
<td><b><%= rounding_adj rescue '-'%></b></td> <td><b><%= rounding_adj rescue '-'%></b></td>
<td><b><%= old_grand_total.to_f.round + rounding_adj %></b></td> <td><b><%= grand_total.to_f.round + rounding_adj %></b></td>
</tr> </tr>
<tr> <tr>
<td colspan="2">&nbsp;</td> <td colspan="2">&nbsp;</td>
<td>Total Amount</td> <td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td>Discount Amount</td> <td><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %></td>
<% @sale_taxes.each do |tax| %>
<td><%= tax.tax_name %></td> <% @tax_profiles.each do |tax| %>
<td><%= tax.name %></td>
<% end %> <% end %>
<td>Grand Total</td> <td><%= t("views.right_panel.detail.grand_total") %></td>
<td>Rounding Adj.</td> <td><%= t("views.right_panel.detail.rnd_adj_sh") %></td>
<td>Grand Total +<br/> <td><%= t("views.right_panel.detail.grand_total") %> +<br/>
Rounding Adj. <%= t("views.right_panel.detail.rnd_adj_sh") %>
</td> </td>
</tr> </tr>
<%end%> <%end%>
@@ -96,3 +126,5 @@
</table> </table>
</div> </div>
</div> </div>
</div>
</div>

View File

@@ -1,30 +1,47 @@
<div class="container margin-top-20"> <div class="page-header">
<div class="card row"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.sale_item_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-md-12">
<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %>
<hr />
<div class="text-right">
<a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-info wave-effects "><%= t("views.btn.exp_to_excel") %></a>
</div>
<div class="margin-top-20">
<div class="card">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped" id="items_table" border="0"> <table class="table table-striped" id="items_table" border="0">
<thead> <thead>
<tr> <tr>
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th> <th colspan="7"> <%= 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 '-'%></th>
</tr> </tr>
<% if @shift_from %> <% if @shift_from %>
<tr> <tr>
<% if @shift_data.employee %> <% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %> <% end %>
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th> <th colspan="7"> <%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>Menu Category</th> <th><%= t("views.right_panel.header.menu_category") %></th>
<th>Code</th> <th><%= t("views.right_panel.detail.code") %></th>
<th>Product</th> <th><%= t("views.right_panel.detail.product") %></th>
<th>Total Item</th> <th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></th>
<th>Unit Price</th> <th><%= t("views.right_panel.detail.unit_price") %></th>
<th>Revenue</th> <th><%= t("views.right_panel.detail.revenue") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -32,24 +49,30 @@
<% acc_arr = Array.new %> <% acc_arr = Array.new %>
<% cate_arr = Array.new %> <% cate_arr = Array.new %>
<% sub_total = 0.0 %> <% sub_total = 0 %>
<% other_sub_total = 0 %>
<% count = 0 %> <% count = 0 %>
<% total_price = 0.0 %> <% total_price = 0 %>
<% cate_count = 0 %> <% cate_count = 0 %>
<% acc_count = 0 %> <% acc_count = 0 %>
<% grand_total = 0 %> <% grand_total = 0 %>
<% total_qty = 0 %> <% total_qty = 0 %>
<% total_amount = 0 %> <% total_amount = 0 %>
<% discount = 0 %> <% discount = 0 %>
<% total_item_foc = 0 %>
<% total_item_dis = 0 %>
<% @sale_data.each do |sale| %> <% @sale_data.each do |sale| %>
<% total_qty += sale.total_item %>
<% if sale.total_item > 0
total_qty += sale.total_item
end %>
<% if !acc_arr.include?(sale.account_id) %> <% if !acc_arr.include?(sale.account_id) %>
<tr> <tr>
<td><b><%= sale.account_name %></b></td> <td><b><%= sale.account_name %></b></td>
<td colspan="4">&nbsp;</td> <td colspan="4">&nbsp;</td>
<td>Total Price By <%= sale.account_name %></td> <td><%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %></td>
<td> <td>
<% @totalByAccount.each do |account, total| %> <% @totalByAccount.each do |account, total| %>
<% if sale.account_id == account %> <% if sale.account_id == account %>
@@ -60,7 +83,6 @@
</td> </td>
</tr> </tr>
<% acc_arr.push(sale.account_id) %> <% acc_arr.push(sale.account_id) %>
<% end %> <% end %>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
@@ -75,9 +97,7 @@
<td><%= sale.total_item rescue '-' %></td> <td><%= sale.total_item rescue '-' %></td>
<td><%= sale.unit_price rescue '-' %></td> <td><%= sale.unit_price rescue '-' %></td>
<td><%= sale.grand_total rescue '-' %></td> <td><%= sale.grand_total rescue '-' %></td>
</tr> </tr>
<!-- sub total --> <!-- sub total -->
<% @menu_cate_count.each do |key,value| %> <% @menu_cate_count.each do |key,value| %>
<% if sale.menu_category_id == key %> <% if sale.menu_category_id == key %>
@@ -87,62 +107,87 @@
<% if count == value %> <% if count == value %>
<tr> <tr>
<td colspan="5">&nbsp;</td> <td colspan="5">&nbsp;</td>
<td>Sub Total</td> <td><%= t("views.right_panel.detail.sub_total") %></td>
<td ><span class="underline"><%= sub_total %></span></td> <td ><span class="underline"><%= sub_total %></span></td>
</tr> </tr>
<% 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%> <% sub_total = 0.0%>
<% count = 0%> <% count = 0%>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<!-- end sub total --> <!-- end sub total -->
<% end %> <% end %>
<!--Other Charges -->
<tr>
<td><b>Other Charges</b></td>
<td colspan="4">&nbsp;</td>
<td></td>
</tr>
<% @other_charges.each do |other| %>
<% if other.total_item > 0
total_qty += other.total_item
end %>
<% grand_total +=other.grand_total%>
<tr>
<td>&nbsp;</td>
<td>Other Charges</td>
<td><%= other.item_code rescue '-' %></td>
<td><%= other.product_name rescue '-' %></td>
<td><%= other.total_item rescue '-' %></td>
<td><%= other.unit_price rescue '-' %></td>
<td><%= other.grand_total rescue '-' %></td>
</tr>
<!-- sub total -->
<% other_sub_total += other.grand_total %>
<!-- end sub total -->
<% end %>
<tr>
<td colspan="5">&nbsp;</td>
<td><%= t("views.right_panel.detail.sub_total") %></td>
<td ><span class="underline"><%= other_sub_total %></span></td>
</tr>
<!-- End Other Charges -->
<tr style="border-top:2px solid grey;"> <tr style="border-top:2px solid grey;">
<td colspan="3">&nbsp;</td> <td colspan="3">&nbsp;</td>
<td>Total Item</td> <td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></td>
<td><span><%= total_qty%></span></td> <td><span><%= total_qty%></span></td>
<td>Total Amount</td> <td><%= t("views.right_panel.detail.net_amount") %></td>
<td><span><%= grand_total%></span></td> <td><span><%= grand_total%></span></td>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<td colspan="5">&nbsp;</td> <td colspan="5">&nbsp;</td>
<td>Cash Received</td> <td><%= t("views.right_panel.detail.foc_item") %> <%= t("views.right_panel.detail.amount") %></td>
<td><span><%= @cash_data - @change_amount %></span></td> <td><span><%= total_item_foc %></span></td>
</tr> </tr>
<tr> <tr>
<td colspan="5">&nbsp;</td> <td colspan="5">&nbsp;</td>
<td>Card Sales</td> <td><%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %></td>
<td><span><%= @card_data %></span></td> <td><span><%= total_item_dis %></span></td>
</tr> </tr>
<tr> <tr>
<td colspan="5">&nbsp;</td> <td colspan="5">&nbsp;</td>
<td>Credit Sales</td> <td><%= t("views.right_panel.detail.foc_sales") %></td>
<td><span><%= @credit_data %></span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>FOC Sales</td>
<td><span><%= @foc_data %></span></td> <td><span><%= @foc_data %></span></td>
</tr> </tr>
<tr> <tr>
<td colspan="5">&nbsp;</td> <td colspan="5">&nbsp;</td>
<td>Discount Amount</td> <td><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %></td>
<td><span><%= @discount_data %></span></td> <td><span><%= @discount_data %></span></td>
</tr> </tr>
<tr>
<td colspan="5">&nbsp;</td>
<td>Grand Total</td>
<!-- <td><span class="double_underline"><%= grand_total.to_f - @discount_data.to_f%></span></td> -->
<td><span class="double_underline"><%= @grand_total - @change_amount%></span></td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>

View File

@@ -1,14 +1,40 @@
<div class="container margin-top-20"> <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.shift_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-md-12">
<!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_shiftsale_index_path} %>
<hr />
<!-- </div> -->
<!-- <div class="container"> -->
<!-- <div class="row"> -->
<div class="text-right">
<a href="javascript:export_to('<%=reports_shiftsale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<!-- <div class="span11"> <!-- <div class="span11">
<div id="report_container" style="min-width: 400px; height: 400px; margin: 0 auto"></div> <div id="report_container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
</div> --> </div> -->
<div class="card row"> <div class="card">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> <th colspan="7"> <%= t("views.right_panel.detail.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.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
</th> </th>
</tr> </tr>
@@ -17,24 +43,23 @@
<% if @shift_data.employee %> <% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %> <% end %>
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th> <th colspan="7"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<th>Cashier Station</th> <th><%= t("views.right_panel.detail.cashier_station") %></th>
<th>Cashier Name</th> <th><%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th>Shift Name</th> <th><%= t("views.right_panel.detail.shift_name") %></th>
<!-- <th>Void Amount</th> --> <!-- <th>Void Amount</th> -->
<th>Cash Payment</th> <th><%= t("views.right_panel.detail.cash_payment") %></th>
<!-- <th>Credit Charges</th> --> <!-- <th>Credit Charges</th> -->
<th>Credit Payment</th> <th><%= t("views.right_panel.detail.credit_payment") %></th>
<!-- <th>FOC Payment</th> --> <!-- <th>FOC Payment</th> -->
<th>Other Payment</th> <th><%= t("views.btn.other_payment") %></th>
<!-- <th>Grand Total <!-- <th>Grand Total
<br/>Rounding Adj</th> --> <br/>Rounding Adj</th> -->
<!-- <th>Rounding Adj</th> --> <!-- <th>Rounding Adj</th> -->
<th>Grand Total</th> <th><%= t("views.right_panel.detail.grand_total") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -1,11 +1,36 @@
<div class="container margin-top-20"> <div class="page-header">
<div class="card row"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.void_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-md-12">
<!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_void_sale_index_path} %>
<hr />
<!-- </div> -->
<!-- <div class="container"> -->
<!-- <div class="row"> -->
<div class="col-md-12 text-right">
<a href="javascript:export_to('<%=reports_void_sale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<div class="card">
<% if @sale_data.count > 0 %> <% if @sale_data.count > 0 %>
<table class="table table-striped" border="0"> <table class="table table-striped" border="0">
<thead> <thead>
<% if !params[:from].blank?%> <% if !params[:from].blank?%>
<tr> <tr>
<th colspan="7">From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%></th> <th colspan="7"><%= t("views.right_panel.detail.from_date") %> : <%= params[:from] rescue '-'%> , <%= t("views.right_panel.detail.to_date") %> : <%= params[:to] rescue '-'%></th>
</tr> </tr>
<% end %> <% end %>
<% if @shift_from %> <% if @shift_from %>
@@ -13,16 +38,16 @@
<% if @shift %> <% if @shift %>
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %> <% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
<% end %> <% end %>
<th colspan="3">Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th> <th colspan="3"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<th>Receipt No</th> <th><%= t("views.right_panel.detail.receipt_no") %></th>
<th>Sale Date</th> <th><%= t("views.right_panel.detail.sale_date") %></th>
<th>Total Amount</th> <th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></th>
<th>Grand Total</th> <th><%= t("views.right_panel.detail.grand_total") %></th>
<th>Rounding Adj.</th> <th><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<th>Grand Total + <br/>Rounding Adj.</th> <th><%= t("views.right_panel.detail.grand_total") %> + <br/><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
<!-- <th>Sale Status</th> --> <!-- <th>Sale Status</th> -->
</tr> </tr>
</thead> </thead>
@@ -54,7 +79,7 @@
<td><%= total_amount rescue '-' %></td> <td><%= total_amount rescue '-' %></td>
<td><%= grand_total rescue '-' %></td> <td><%= grand_total rescue '-' %></td>
<td><%= rounding_adjustment rescue '-'%></td> <td><%= rounding_adjustment rescue '-'%></td>
<td colspan=""><%= grand_rounding_adjustment rescue '-'%></td> <td colspan="3"><%= grand_rounding_adjustment rescue '-'%></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>