update receipt no detail report

This commit is contained in:
Thein Lin Kyaw
2020-01-03 16:43:05 +06:30
parent b3eead7aa2
commit 8b5478cf27
2 changed files with 54 additions and 53 deletions

View File

@@ -136,23 +136,24 @@
<% sale_payments = result.sale_payments %>
<% if sale_payments.length > 0%>
<% sale_payments.each do |rec| %>
<% next if rec.payment_method == 'credit_note' && result.payments_for_credits_amount < rec.payment_amount %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment <%= rec.payment_method.upcase %></td>
<td><%= number_format(rec.payment_amount, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %> ( <%= rec.payment_status %> )</td>
<td>&nbsp;</td>
</tr>
<% if !rec.payment_reference.nil? %>
<% if rec.payment_amount > 0 %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment Ref.</td>
<td><%= rec.payment_reference %></td>
<td>Payment <%= rec.payment_method.upcase %></td>
<td><%= number_format(rec.payment_amount, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %> ( <%= rec.payment_status %> )</td>
<td>&nbsp;</td>
</tr>
<% if !rec.payment_reference.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment Ref.</td>
<td><%= rec.payment_reference %></td>
<td>&nbsp;</td>
</tr>
<% end %>
<% end %>
<% end %>
<% if result.amount_changed != 0 %>

View File

@@ -9,7 +9,7 @@
<div class="col-md-12">
<div class="margin-top-20">
<div class="card">
<div class="table-responsive">
<div class="table-responsive">
<table class="table table-striped" border="0">
<thead>
<tr>
@@ -18,9 +18,9 @@
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<% end %>
<th colspan="7"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr>
<% end %>
@@ -28,9 +28,9 @@
<th><b><%= t("views.right_panel.detail.shift_name") %></b></th>
<th><b><%= t("views.right_panel.detail.table") %></b></th>
<th><b><%= t("views.right_panel.detail.receipt_no") %></b></th>
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
<th><b><%= t("views.right_panel.detail.revenue") %></b></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -47,7 +47,7 @@
<td><%= @shift_from %> - <%= @shift_to %></td>
<td><%= table_type %> - <%= table_name %></td>
<td><%= result.receipt_no rescue '-' %> </td>
<td><%= result.cashier_name rescue '-' %></td>
<td><%= result.cashier_name rescue '-' %></td>
<td><%=result.grand_total%></td>
<!-- <td>&nbsp;</td> -->
</tr>
@@ -66,8 +66,8 @@
<% if item.price.to_i < 0.to_i %>
<% if item.qty.to_i < 0.to_i%>
[PROMO QTY]<%= item.product_name rescue '-' %>
<% else %>
[PROMO PRICE]<%= item.product_name rescue '-' %>
<% else %>
[PROMO PRICE]<%= item.product_name rescue '-' %>
<% end %>
<% else %>
<%= item.product_name rescue '-' %>
@@ -76,71 +76,71 @@
<td><%= item.qty rescue '-' %></td>
<td><%= item.unit_price rescue '-' %></td>
<td><%= item.price rescue '-' %></td>
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
</tr>
<% end %>
<tr><td colspan="5">&nbsp;</td></tr>
<%survey = Survey.find_by_receipt_no(result.receipt_no)%>
<% if !survey.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>No. of Guest</td>
<td><%= survey.total_customer rescue '-' %></td>
<td>&nbsp;</td>
</tr>
<% end %>
<td>&nbsp;</td>
</tr>
<% end %>
<% if !result.total_amount.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td><%= result.total_amount %></td>
<td>&nbsp;</td>
</tr>
<td>&nbsp;</td>
</tr>
<% end %>
<% if result.total_discount.to_f > 0 %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.total") %>
<%= t("views.right_panel.detail.discount") %>
<%= t("views.right_panel.detail.discount") %>
<%= t("views.right_panel.detail.amount") %></td>
<td> - <%= result.total_discount %> </td>
<td>&nbsp;</td>
</tr>
<td>&nbsp;</td>
</tr>
<% end %>
<% if !result.total_tax.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Tax Amount </td>
<td><%= result.total_tax %> </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<% end %>
<% sale_payments = SalePayment.get_sale_payments(result) %>
<% if sale_payments.length > 0%>
<% sale_payments = result.sale_payments %>
<% if sale_payments.length > 0%>
<% sale_payments.each do |rec| %>
<%if rec.payment_amount.to_f > 0 %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment <%= rec.payment_method.upcase %></td>
<td><%= rec.payment_amount %> ( <%= rec.payment_status %> )</td>
<td>&nbsp;</td>
</tr>
</tr>
<% if !rec.payment_reference.nil? %>
<% if !rec.payment_reference.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment Ref.</td>
<td><%= rec.payment_reference %></td>
<td>&nbsp;</td>
@@ -148,10 +148,10 @@
<% end %>
<% end %>
<% end %>
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %></td>
<td><%= result.amount_changed %></td>
<td>&nbsp;</td>
@@ -160,32 +160,32 @@
<% if !result.customer_id.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Customer</td>
<td><%= result.customer.name rescue '-'%>
<td><%= result.customer.name rescue '-'%>
(<%= result.customer.company rescue '-' %>)
</td>
<td>&nbsp;</td>
</tr>
<% end %>
<% end %>
<% end %>
<tr style="border-top:4px double #666;">
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><b>Total Nett</b> - <b><%= grand_total %></b></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
</html>