add foc amount in saleitem report
This commit is contained in:
@@ -8,7 +8,6 @@ class Origami::VoidController < BaseOrigamiController
|
||||
access_code = params[:access_code]
|
||||
if Sale.exists?(sale_id)
|
||||
sale = Sale.find_by_sale_id(sale_id)
|
||||
puts sale.to_json
|
||||
if sale.discount_type == "member_discount"
|
||||
sale.update_attributes(total_discount: 0)
|
||||
sale.compute_by_sale_items(sale_id, sale.sale_items,0,order_source)
|
||||
|
||||
@@ -95,7 +95,6 @@
|
||||
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 %>
|
||||
@@ -249,9 +248,21 @@
|
||||
<td colspan="3"> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></td>
|
||||
<td><span><%= total_qty%></span></td>
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
</tr>
|
||||
<% if @type =="" || @type =="all" || @type.nil? %>
|
||||
<tr class="foc_payment">
|
||||
<td colspan="5"> </td>
|
||||
<td>Total FOC Amount</td>
|
||||
<td><span><%= number_with_precision(@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
</tr>
|
||||
<tr class="foc_payment" style="border-top:2px solid grey;border-bottom:2px solid grey;">
|
||||
<td colspan="5"> </td>
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total -@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @type == "other"%>
|
||||
|
||||
@@ -296,6 +307,7 @@
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
var check_arr = [];
|
||||
var search = '<%= params[:period_type] %>';
|
||||
|
||||
|
||||
@@ -226,6 +226,18 @@
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
</tr>
|
||||
<% if @type =="" || @type =="all" %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
<td>Total FOC Amount</td>
|
||||
<td><span><%= number_with_precision(@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
</tr>
|
||||
<tr style="border-top:2px solid grey;border-bottom:2px solid grey;">
|
||||
<td colspan="5"> </td>
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total -@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @type == "other"%>
|
||||
|
||||
@@ -267,4 +279,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var type =<%=@type %>;
|
||||
console.log(type);
|
||||
$('.foc_payment').hide();
|
||||
if (type =="" || type =="all" ){
|
||||
$('.foc_payment').show();
|
||||
}
|
||||
else{
|
||||
$('.foc_payment').hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user