precision

This commit is contained in:
Myat Zin Wai Maw
2019-09-05 18:12:17 +06:30
parent 1ced4a3d6d
commit 258aba669b
5 changed files with 58 additions and 12 deletions

View File

@@ -2,6 +2,20 @@
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<% if !@print_settings.nil? %>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end
%>
<% end %>
<div class="row clearfix">
<!-- Column One -->
<div class="col-lg-6 col-md-6 col-sm-6">
@@ -350,7 +364,7 @@
<table class="table" id="order-charges-table" border="0">
<tr>
<td class="charges-name"><strong>Sub Total:</strong></td>
<td class="item-attr"><strong id="sub-total"><%= sub_total %></strong></td>
<td class="item-attr"><strong id="sub-total"><%= number_with_precision(sub_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong></td>
</tr>
<tr>
<%if @obj_sale != nil && @obj_sale.discount_type == 'member_discount'%>
@@ -359,7 +373,7 @@
<td class="charges-name"><strong>Discount:</strong></td>
<%end%>
<td class="item-attr"><strong id="order-discount">(<%= @obj_sale.total_discount rescue 0%>)</strong></td>
<td class="item-attr"><strong id="order-discount">(<%= number_with_precision(@obj_sale.total_discount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %>)</strong></td>
</tr>
<% if @status_sale == "sale" %>
<tr>
@@ -382,15 +396,15 @@
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
<% end %>
</td>
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0%></strong></td>
<td class="item-attr"><strong id="order-Tax"><%= number_with_precision(@obj_sale.total_tax, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Rounding Adj:</strong></td>
<td class="item-attr"><strong id="order-round-adj"><%= @obj_sale.rounding_adjustment rescue 0%></strong></td>
<td class="item-attr"><strong id="order-round-adj"><%= number_with_precision(@obj_sale.rounding_adjustment, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Grand Total:</strong></td>
<td class="item-attr"><strong id="order-grand-total"><%= @obj_sale.grand_total rescue 0%></strong></td>
<td class="item-attr"><strong id="order-grand-total"><%= number_with_precision(@obj_sale.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong></td>
</tr>
<% end %>
<tr class="rebate_amount"></tr>