update customer transaction list
This commit is contained in:
@@ -121,8 +121,9 @@ class Origami::CustomersController < BaseOrigamiController
|
|||||||
|
|
||||||
if status == true
|
if status == true
|
||||||
render json: JSON.generate({:status => true})
|
render json: JSON.generate({:status => true})
|
||||||
# Re-calc All Amount in Sale
|
if(id == "SAL")
|
||||||
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount)
|
sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -68,27 +68,39 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><%= t("views.right_panel.detail.date") %></th>
|
<th><%= t("views.right_panel.detail.date") %></th>
|
||||||
<!-- <th>Redeem</th> -->
|
<!-- <th>Redeem</th> -->
|
||||||
<th><%= t("views.right_panel.detail.discount_amount") %></th>
|
<th><%= t("views.right_panel.detail.amount") %></th>
|
||||||
<!-- <th>Balance</th> -->
|
<!-- <th>Balance</th> -->
|
||||||
<th><%= t("views.right_panel.detail.from_account") %></th>
|
|
||||||
<th><%= t("views.right_panel.detail.status") %></th>
|
<th><%= t("views.right_panel.detail.status") %></th>
|
||||||
|
<th><%= t("views.right_panel.detail.from_account") %></th>
|
||||||
|
|
||||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% if @response["status"] == true %>
|
<% if @response["status"] == true %>
|
||||||
<% @response["data"].each do |transaction| %>
|
<% @response["data"].each do |transaction| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= transaction["date"]%></td>
|
<td><%= transaction["date"]%></td>
|
||||||
<!-- <td><%= transaction["redeem"]%></td> -->
|
<% if transaction["status"] == 'Rebate' || transaction["status"] == 'Discount'%>
|
||||||
<td><%= transaction["deposit"] %></td>
|
<td><%= transaction["deposit"] %></td>
|
||||||
<!-- <td><%= transaction["balance"] %></td> -->
|
<% else %>
|
||||||
<td><%= transaction["account_status"] %></td>
|
<td>(<%= transaction["withdraw"] %>)</td>
|
||||||
<td><%= transaction["status"] %></td>
|
<% end %>
|
||||||
<td><%= transaction["receipt_no"] %></td>
|
<td><%= transaction["status"] %></td>
|
||||||
|
<td><%= transaction["account_status"] %></td>
|
||||||
</tr>
|
<td><%= transaction["receipt_no"] %></td>
|
||||||
<% end %>
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
<% if @response["data"].first["status"] != 'Discount'%>
|
||||||
|
<tr >
|
||||||
|
<th>Balance</th>
|
||||||
|
<th>
|
||||||
|
<%= @response["data"].first["balance"] %>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<%end%>
|
||||||
|
<%else%>
|
||||||
|
<tr><td colspan="5"><p class="align-center">There is no transaction coz of <%=@response["data"]%> ...</p></td></tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -133,13 +145,15 @@
|
|||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
||||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
<th><%= t("views.right_panel.detail.total_discount") %></th>
|
||||||
<th><%= t("views.right_panel.detail.tax_amount") %></th>
|
<th><%= t("views.right_panel.detail.tax_amount") %></th>
|
||||||
<th><%= t :cashier %></th>
|
<th><%= t("views.right_panel.detail.sub_total") %></th>
|
||||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
<th><%= t :cashier %></th>
|
||||||
|
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||||
|
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@@ -147,12 +161,14 @@
|
|||||||
<% @sales.each do |sale| %>
|
<% @sales.each do |sale| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||||
<td><%= sale.receipt_no %></td>
|
<td><%= sale.receipt_no %></td>
|
||||||
<td><%= sale.grand_total rescue '-' %></td>
|
<td><%= sale.total_discount %></td>
|
||||||
<td><%= sale.total_tax %></td>
|
<td><%= sale.total_tax %></td>
|
||||||
<td><%= sale.cashier_name rescue '-' %></td>
|
<td><%= sale.total_amount %></td>
|
||||||
<td> <%= sale.sale_status %> </td>
|
<td><%= sale.grand_total rescue '-' %></td>
|
||||||
<td> <%= sale.receipt_date.strftime("%d-%m-%Y %I:%m %p") %> </td>
|
<td><%= sale.cashier_name rescue '-' %></td>
|
||||||
|
<td> <%= sale.sale_status %> </td>
|
||||||
|
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<div class="card sales red text-white" data-id="<%= sale.sale_id %>">
|
<div class="card sales red text-white" data-id="<%= sale.sale_id %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= sale.receipt_no %>
|
<%= sale.receipt_no %>
|
||||||
<span class="pull-right font-12"><%= sale.sale_status %></span>
|
<span class="float-right font-12"><%= sale.sale_status %></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= table.name %>
|
<%= table.name %>
|
||||||
<span class="pull-right font-12 new_text_<%= table.id %>"> billed</span>
|
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span>
|
||||||
<div style="font-size:12px;"></div>
|
<div style="font-size:12px;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= table.name %>
|
<%= table.name %>
|
||||||
<span class="pull-right font-12 new_text_<%= table.id %>"> new</span>
|
<span class="float-right font-12 new_text_<%= table.id %>"> new</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= table.name %>
|
<%= table.name %>
|
||||||
<span class="pull-right font-12 new_text_<%= table.id %> hide"> new</span>
|
<span class="float-right font-12 new_text_<%= table.id %> hide"> new</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -81,9 +81,9 @@
|
|||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= room.name %>
|
<%= room.name %>
|
||||||
<% if room.get_booking.nil? %>
|
<% if room.get_booking.nil? %>
|
||||||
<span class="pull-right font-12 new_text_<%= room.id %>"> billed</span>
|
<span class="float-right font-12 new_text_<%= room.id %>"> billed</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="pull-right font-12 new_text_<%= room.id %>"> new</span>
|
<span class="float-right font-12 new_text_<%= room.id %>"> new</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
|
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= room.name %>
|
<%= room.name %>
|
||||||
<span class="pull-right font-12 new_text_<%= room.id %> hide">
|
<span class="float-right font-12 new_text_<%= room.id %> hide">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -134,6 +134,8 @@
|
|||||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
</div>
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
@@ -154,7 +156,16 @@
|
|||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
<% elsif !@date.nil? %>
|
<% elsif !@date.nil? %>
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12 text-right">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
Order No: <span id="order_no">
|
||||||
|
<% if @status_order == 'order' %>
|
||||||
|
<%= @obj_order.order_id rescue '' %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||||
Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></span>
|
Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></span>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
@@ -162,15 +173,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row p-l-5 p-r-5">
|
<div class="row p-l-5 p-r-5">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
<% if !@sale_array.empty? %>
|
|
||||||
<% if @status_sale == 'sale' %>
|
<% if @status_sale == 'sale' %>
|
||||||
<p class="hidden customer-id"><%= @sale_array[0].customer_id rescue '' %></p>
|
<p class="hidden customer-id"><%= @sale_array[0].customer_id rescue '' %></p>
|
||||||
Customer : <%= @sale_array[0].customer.name rescue '' %>
|
Customer : <%= @sale_array[0].customer.name rescue '' %>
|
||||||
<% else %>
|
<% elsif @status_order == 'order'
|
||||||
|
%>
|
||||||
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
|
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
|
||||||
Customer : <%= @customer.name rescue "" %>
|
Customer : <%= @customer.name rescue "" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -350,7 +362,7 @@
|
|||||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||||
<% if @dining.status != "available" %>
|
<% if @dining.status != "available" %>
|
||||||
<% if @status_order == 'order' %>
|
<% if @status_order == 'order' %>
|
||||||
<!-- <button type="button" id="customer" class="btn btn-block bg-blue waves-effect" disabled>Customer</button> -->
|
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
||||||
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" disabled>Edit</button> -->
|
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" disabled>Edit</button> -->
|
||||||
<!-- <button type="button" id="discount" class="btn btn-block bg-blue waves-effect" disabled>Discount</button> -->
|
<!-- <button type="button" id="discount" class="btn btn-block bg-blue waves-effect" disabled>Discount</button> -->
|
||||||
<!-- <button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect" disabled>Charges</button> -->
|
<!-- <button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect" disabled>Charges</button> -->
|
||||||
|
|||||||
Reference in New Issue
Block a user