update addorder sale item xls

This commit is contained in:
Aung Myo
2018-05-14 10:50:04 +06:30
parent 34141e1284
commit 4baff5918c
2 changed files with 21 additions and 12 deletions

View File

@@ -59,16 +59,18 @@
<% unless @sale_data.blank? %>
<% @sale_data.each do |sale| %>
<!-- all total qty sum -->
<!--
<% if sale.status_type != "Discount" && sale.status_type != "foc"
total_qty += sale.total_item
end %>
<% if sale.status_type == "foc" && sale.price > 0
total_qty += sale.total_item
end %>
-->
<% if sale.status_type == "Discount"
total_qty += sale.total_item*(-1)
end %>
<!-- end all total qty -->
<!--
<% if sale.status_type == "foc" && sale.grand_total < 0
total_item_foc += sale.grand_total*(-1)
end %>
@@ -76,7 +78,7 @@
<% if sale.status_type == "Discount" && sale.grand_total < 0
total_item_dis += sale.grand_total*(-1)
end %>
-->
<% if !acc_arr.include?(sale.account_id) %>
<tr>
<td><b><%= sale.account_name %></b></td>
@@ -103,7 +105,12 @@
<% end %>
<td><%= sale.item_code 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.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
@@ -114,10 +121,12 @@
<% count = count + 1 %>
<% sub_total += sale.grand_total %>
<% #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
end %>
<% if sale.status_type =="Discount"
sub_qty += sale.total_item*(-1)
end %>
<% if count == value %>
<tr>
<td colspan="3">&nbsp;</td>

View File

@@ -20,11 +20,11 @@ class ActionController::Base
end
else
#check for license file
# if check_license
# current_license(ENV["SX_PROVISION_URL"])
# else
# redirect_to activate_path
# end
if check_license
current_license(ENV["SX_PROVISION_URL"])
else
redirect_to activate_path
end
end
end