add table no and cus id in payment ui

This commit is contained in:
Yan
2017-07-10 17:17:22 +06:30
parent 082627018f
commit 152af3a3cb
2 changed files with 10 additions and 2 deletions

View File

@@ -85,6 +85,7 @@ class Origami::PaymentsController < BaseOrigamiController
@sale_data = Sale.find_by_sale_id(sale_id) @sale_data = Sale.find_by_sale_id(sale_id)
@balance = 0.00 @balance = 0.00
@accountable_type = '' @accountable_type = ''
@table_no = ''
#get customer amount #get customer amount
@customer = Customer.find(@sale_data.customer_id) @customer = Customer.find(@sale_data.customer_id)
@@ -105,6 +106,12 @@ class Origami::PaymentsController < BaseOrigamiController
#end customer amount #end customer amount
@sale_data.bookings.each do |sbk|
df = DiningFacility.find(sbk.dining_facility_id)
@table_no = df.type + ' ' + df.name
break
end
@sale_data.sale_payments.each do |spay| @sale_data.sale_payments.each do |spay|
if spay.payment_method == "cash" if spay.payment_method == "cash"
@cash = spay.payment_amount @cash = spay.payment_amount

View File

@@ -10,11 +10,12 @@
<td style="width:50%;"><strong>Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></strong></td> <td style="width:50%;"><strong>Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></strong></td>
</tr> </tr>
<tr> <tr>
<td><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></td> <td><strong>Table No</strong> - <%=@table_no%></td>
<td><strong>Sale Id</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></td> <td><strong>Sale Id</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></td>
</tr> </tr>
<tr> <tr>
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td> <td style="width:50%;"><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
<td style="width:50%;"><strong>Customer ID :</strong> <%= @sale_data.customer.customer_id%></td>
</tr> </tr>
</table> </table>
</div> </div>