update customer transaction list
This commit is contained in:
@@ -68,27 +68,39 @@
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.date") %></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><%= t("views.right_panel.detail.from_account") %></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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @response["status"] == true %>
|
||||
<% @response["data"].each do |transaction| %>
|
||||
<tr>
|
||||
<td><%= transaction["date"]%></td>
|
||||
<!-- <td><%= transaction["redeem"]%></td> -->
|
||||
<td><%= transaction["deposit"] %></td>
|
||||
<!-- <td><%= transaction["balance"] %></td> -->
|
||||
<td><%= transaction["account_status"] %></td>
|
||||
<td><%= transaction["status"] %></td>
|
||||
<td><%= transaction["receipt_no"] %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
<% @response["data"].each do |transaction| %>
|
||||
<tr>
|
||||
<td><%= transaction["date"]%></td>
|
||||
<% if transaction["status"] == 'Rebate' || transaction["status"] == 'Discount'%>
|
||||
<td><%= transaction["deposit"] %></td>
|
||||
<% else %>
|
||||
<td>(<%= transaction["withdraw"] %>)</td>
|
||||
<% end %>
|
||||
<td><%= transaction["status"] %></td>
|
||||
<td><%= transaction["account_status"] %></td>
|
||||
<td><%= transaction["receipt_no"] %></td>
|
||||
</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 %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -133,13 +145,15 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.sale_id") %></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.tax_amount") %></th>
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></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.total_discount") %></th>
|
||||
<th><%= t("views.right_panel.detail.tax_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.sub_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -147,12 +161,14 @@
|
||||
<% @sales.each do |sale| %>
|
||||
<tr>
|
||||
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
<td><%= sale.total_tax %></td>
|
||||
<td><%= sale.cashier_name rescue '-' %></td>
|
||||
<td> <%= sale.sale_status %> </td>
|
||||
<td> <%= sale.receipt_date.strftime("%d-%m-%Y %I:%m %p") %> </td>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td><%= sale.total_discount %></td>
|
||||
<td><%= sale.total_tax %></td>
|
||||
<td><%= sale.total_amount %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></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>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user