<%if !@table.nil?%> <%else%> <%end%>

Receipt No: <%=@sale_data.receipt_no rescue ' '%>

Date: <%=@sale_data.receipt_date.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

<% sub_total = 0 %> <% @sale_data.sale_items.includes(:discount_item).each do |sale_item| %> <% sub_total += sale_item.qty * sale_item.unit_price %> <% if sale_item.price > 0 && sale_item.status.blank? %> data-item-discount="<%=sale_item.discount_item.discount%>" data-item-discount_type="<%=sale_item.discount_item.discount_type%>" <% end %>> <% end %> <% end %>
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 %>
<%= item_price %>
<% else %> <%= item_price %>
<% end %>
<%if @sale_data.discount_type == 'member_discount'%> <%else%> <%end%>
Sub Total: <%= number_format(sub_total, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i ) %>
Member Discount:Discount:(<%= number_format(@sale_data.total_discount, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i ) %>)
Discount Control

<% @accounts.each do |acc| %> <% end %>

5%
1
2
3
10%
4
5
6
15%
7
8
9
20%
0
.
00
30%
DEL
CLR

<% if @member_discount%> <%end %>