add receipt no for online order

This commit is contained in:
phyusin
2018-09-17 11:39:44 +06:30
parent 6e09482ef0
commit 953e3e83f1
5 changed files with 9 additions and 5 deletions

View File

@@ -408,7 +408,7 @@ class OrderReservation < ApplicationRecord
end
end
query = OrderReservation.select("order_reservations.*, sales.receipt_date, deliveries.provider, deliveries.delivery_fee, customers.name, customers.email")
query = OrderReservation.select("order_reservations.*, sales.receipt_date, sales.receipt_no, deliveries.provider, deliveries.delivery_fee, customers.name, customers.email")
.joins(" JOIN deliveries on deliveries.order_reservation_id = order_reservations.order_reservation_id")
.joins(" JOIN customers on customers.customer_id = order_reservations.customer_id")
.joins(" JOIN sales on sales.sale_id = order_reservations.sale_id")

View File

@@ -90,7 +90,7 @@
</tr>
<% end %>
<tr>
<td colspan="4"><b>Total</b></td>
<td colspan="5"><b>Total</b></td>
<td colspan="4"><b><%= number_with_precision(total_credit_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td>
<td><b><%= number_with_precision(total_credit_payment, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td>
</tr>

View File

@@ -62,7 +62,7 @@
</tr>
<% end %>
<tr>
<td colspan="4"><b>Total</b></td>
<td colspan="5"><b>Total</b></td>
<td colspan="4"><b><%= total_credit_amount rescue '-' %></b></td>
<td><b><%= total_credit_payment rescue '-' %></b></td>
</tr>

View File

@@ -42,6 +42,7 @@
<tr>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
<th> <%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t :reference_number %></th>
<th><%= t :customer %></th>
<!-- <th><%= t("views.right_panel.detail.type") %></th> -->
@@ -139,6 +140,7 @@
%>
<tr>
<td><%= order_reservation.receipt_date.utc.getlocal.strftime("%Y-%m-%d") %></td>
<td><%= order_reservation.receipt_no %></td>
<td><%= order_reservation.transaction_ref %></td>
<td><%= order_reservation.name %></td>
<!-- <td><%= order_reservation.order_reservation_type %></td> -->
@@ -160,7 +162,7 @@
end %>
<tr>
<td colspan="6"><b>Total</b></td>
<td colspan="7"><b>Total</b></td>
<td><b><%= number_with_precision(total_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></b></td>
<td><b><%= number_with_precision(total_discount_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></b></td>
<td><b><%= number_with_precision(total_delivery_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%></b></td>

View File

@@ -25,6 +25,7 @@
<tr>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
<th> <%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t :reference_number %></th>
<th><%= t :customer %></th>
<!-- <th><%= t("views.right_panel.detail.type") %></th> -->
@@ -115,6 +116,7 @@
%>
<tr>
<td><%= order_reservation.receipt_date.utc.getlocal.strftime("%Y-%m-%d") %></td>
<td><%= order_reservation.receipt_no %></td>
<td><%= order_reservation.transaction_ref %></td>
<td><%= order_reservation.name %></td>
<!-- <td><%= order_reservation.order_reservation_type %></td> -->
@@ -136,7 +138,7 @@
end %>
<tr>
<td colspan="6"><b>Total</b></td>
<td colspan="7"><b>Total</b></td>
<td><b><%= total_amount rescue '0.0'%></b></td>
<td><b><%= total_discount_amount rescue '0.0'%></b></td>
<td><b><%= total_delivery_fee rescue '0.0'%></b></td>