update sale item report
This commit is contained in:
@@ -17,8 +17,7 @@ class Reports::SaleitemController < BaseReportController
|
|||||||
end
|
end
|
||||||
@type = params[:sale_type]
|
@type = params[:sale_type]
|
||||||
@sale_data, @other_charges,@discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED,@type)
|
@sale_data, @other_charges,@discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED,@type)
|
||||||
puts @other_charges.to_json
|
|
||||||
puts "oooooooooooooooooooooooo"
|
|
||||||
@sale_taxes = Sale.get_separate_tax(shift_sale_range,shift,from,to,nil)
|
@sale_taxes = Sale.get_separate_tax(shift_sale_range,shift,from,to,nil)
|
||||||
|
|
||||||
@account_cate_count = Hash.new {|hash, key| hash[key] = 0}
|
@account_cate_count = Hash.new {|hash, key| hash[key] = 0}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<label class="font-14">Select Type</label>
|
<label class="font-14">Select Type</label>
|
||||||
<select name="sale_type" id="sel_sale_type" class="form-control">
|
<select name="sale_type" id="sel_sale_type" class="form-control">
|
||||||
<option value="">Select Typess</option>
|
<option value="">Select Type</option>
|
||||||
<option value="revenue" selected>Revenue Only</option>
|
<option value="revenue" selected>Revenue Only</option>
|
||||||
<option value="all">All Type</option>
|
<option value="all">All Type</option>
|
||||||
<option value="discount">Discount Only</option>
|
<option value="discount">Discount Only</option>
|
||||||
|
|||||||
@@ -77,16 +77,18 @@
|
|||||||
<% unless @sale_data.blank? %>
|
<% unless @sale_data.blank? %>
|
||||||
<% @sale_data.each do |sale| %>
|
<% @sale_data.each do |sale| %>
|
||||||
<!-- all total qty sum -->
|
<!-- all total qty sum -->
|
||||||
<!--
|
|
||||||
<% if sale.status_type != "Discount" && sale.status_type != "foc"
|
<% if sale.status_type != "Discount" && sale.status_type != "foc"
|
||||||
total_qty += sale.total_item
|
total_qty += sale.total_item
|
||||||
end %>
|
end %>
|
||||||
<% if sale.status_type == "foc" && sale.price > 0
|
<% if sale.status_type == "foc" && sale.price > 0
|
||||||
total_qty += sale.total_item
|
total_qty += sale.total_item
|
||||||
end %>
|
end %>
|
||||||
-->
|
<% if sale.status_type == "Discount"
|
||||||
|
total_qty += sale.total_item*(-1)
|
||||||
|
end %>
|
||||||
<!-- end all total qty -->
|
<!-- end all total qty -->
|
||||||
<!--
|
|
||||||
<% if sale.status_type == "foc" && sale.grand_total < 0
|
<% if sale.status_type == "foc" && sale.grand_total < 0
|
||||||
total_item_foc += sale.grand_total*(-1)
|
total_item_foc += sale.grand_total*(-1)
|
||||||
end %>
|
end %>
|
||||||
@@ -94,7 +96,7 @@
|
|||||||
<% if sale.status_type == "Discount" && sale.grand_total < 0
|
<% if sale.status_type == "Discount" && sale.grand_total < 0
|
||||||
total_item_dis += sale.grand_total*(-1)
|
total_item_dis += sale.grand_total*(-1)
|
||||||
end %>
|
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>
|
||||||
@@ -121,7 +123,12 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<td><%= sale.item_code rescue '-' %></td>
|
<td><%= sale.item_code rescue '-' %></td>
|
||||||
<td><%= sale.product_name rescue '-' %></td>
|
<td><%= sale.product_name rescue '-' %></td>
|
||||||
<td><%= sale.total_item rescue '-' %></td>
|
<% if sale.status_type != "Discount" %>
|
||||||
|
<td><%= sale.total_item rescue '-' %></td>
|
||||||
|
<%else%>
|
||||||
|
<td><%= sale.total_item*(-1) rescue '-' %></td>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<td><%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
<td><%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||||
<td><%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
<td><%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -132,10 +139,12 @@
|
|||||||
<% count = count + 1 %>
|
<% count = count + 1 %>
|
||||||
<% sub_total += sale.grand_total %>
|
<% sub_total += sale.grand_total %>
|
||||||
<% #sub_qty += sale.total_item %>
|
<% #sub_qty += sale.total_item %>
|
||||||
<% if sale.status_type!="Discount" && (!sale.product_name.include? "FOC")
|
<% if sale.status_type !="Discount" && (!sale.product_name.include? "FOC")
|
||||||
sub_qty += sale.total_item
|
sub_qty += sale.total_item
|
||||||
end %>
|
end %>
|
||||||
|
<% if sale.status_type =="Discount"
|
||||||
|
sub_qty += sale.total_item*(-1)
|
||||||
|
end %>
|
||||||
<% if count == value %>
|
<% if count == value %>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"> </td>
|
<td colspan="3"> </td>
|
||||||
|
|||||||
Reference in New Issue
Block a user