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

View File

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