<%=@sale_data.sale_id %>
Receipt No: <%=@sale_data.receipt_no rescue ' '%>
Date: <%=@sale_data.receipt_date.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>
| Items | QTY | Price |
|---|---|---|
|
<%=sale_item.product_name%>@<%=sale_item.unit_price%>
<% if sale_item.discount_item %>
<% if sale_item.discount_item.nett? %>
With a <%= number_format(sale_item.discount_item.discount) %> discount
<% elsif sale_item.discount_item.percentage? %>
With a <%= number_format(sale_item.discount_item.discount, precision: 0) %>% discount
<% end %>
<% else %>
<% end %>
|
<%=sale_item.qty%> |
<% item_price = sale_item.qty*sale_item.unit_price %>
<% if sale_item.discount_item %>
<% discount_price = item_price + sale_item.discount_item.price %>
<%= discount_price %>
|
| Sub Total: | <%= number_format(sub_total, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i ) %> | |
| Member Discount: | <%else%>Discount: | <%end%>(<%= number_format(@sale_data.total_discount, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i ) %>) |
| Tax: | <%= number_format(@sale_data.total_tax, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i ) %> | |
| Grand Total: | <%= number_format(@sale_data.grand_total, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i ) %> |