UI for credit payment

This commit is contained in:
phyusin
2018-07-04 18:46:13 +06:30
parent 9de4ca04dc
commit 2d05886be4
15 changed files with 2017 additions and 1271 deletions

View File

@@ -17,6 +17,9 @@
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#orders" role="tab">Orders</a>
</li>
<li class="nav-item credit_items">
<a class="nav-link" data-toggle="tab" href="#credits" role="tab"><%= t :credit %></a>
</li>
</ul>
<!-- Nav tabs - End -->
<div id="custom-slimscroll">
@@ -47,11 +50,6 @@
<% end %>
<div class="card-block">
<%= table.name %>
<% if !@order_items_count.nil? %>
<% if @order_items_count.key?(table.id) %>
(Orders : <%= @order_items_count[table.id] %>)
<% end %>
<% end %>
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span>
<div style="font-size:12px;"></div>
</div>
@@ -64,11 +62,6 @@
<% end %>
<div class="card-block">
<%= table.name %>
<% if !@order_items_count.nil? %>
<% if @order_items_count.key?(table.id) %>
(Orders : <%= @order_items_count[table.id] %>)
<% end %>
<% end %>
<span class="float-right font-12 new_text_<%= table.id %>"> new</span>
</div>
</div>
@@ -94,11 +87,6 @@
<div class="card rooms red text-white table_<%= room.id %>" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
<% if !@order_items_count.nil? %>
<% if @order_items_count.key?(room.id) %>
(Orders : <%= @order_items_count[room.id] %>)
<% end %>
<% end %>
<span class="float-right font-12 new_text_<%= room.id %>"> billed</span>
</div>
</div>
@@ -106,11 +94,6 @@
<div class="card rooms blue text-white table_<%= room.id %>" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
<% if !@order_items_count.nil? %>
<% if @order_items_count.key?(room.id) %>
(Orders : <%= @order_items_count[room.id] %>)
<% end %>
<% end %>
<span class="float-right font-12 new_text_<%= room.id %>"> new</span>
</div>
</div>
@@ -155,6 +138,39 @@
</div>
</div>
<!-- Credit Item Lists-->
<div class="tab-pane dining" id="credits" role="tabpanel">
<div class="card-block">
<div class="row m-t-10 m-l-10 clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<input type="text" name="filter" id="filter" style="height: 32px;" placeholder="Receipt No." class="form-control" onchange="getCreditData();">
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<select class="form-control" id="sel_customer" name="sel_customer" placeholder="Select Customer" onchange="getCreditData();" >
<option value="">-- Select Customer --</option>
<% if !@customers.empty? %>
<% @customers.each do |cus| %>
<option value="<%= cus[0] %>"><%= cus[1] %></option>
<% end %>
<% end %>
</select>
</div>
</div>
<div class="row clearfix m-t-20 m-l-10">
<table class="table table-responsive tbl_credit_lists">
<thead>
<th><%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t :customer %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t("views.right_panel.detail.credit_amount") %> </th>
</thead>
<tbody class="tbd_credit_lists"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- tabs - End -->
@@ -251,12 +267,25 @@
</div>
</div>
</div>
<!-- script data for credit lists -->
<script type="text/html" id="html_credit_items">
<tr class="row_{key} credit_detail" data-id="{sale_payment_id}">
<td>{receipt_date}</td>
<td>{receipt_no}</td>
<td>{cashier_name}</td>
<td>{customer_name}</td>
<td>{credit_amount}</td>
</tr>
</script>
<!-- script data for credit lists -->
<script>
$(document).ready(function(){
/* check webview loaded*/
var webview = <%= @webview %>;
showHideNavbar(webview);
getCreditSales(); //credit sales script data binding
$(".tables").on('click', function(){
var dining_id = $(this).attr("data-id");
window.location.href = '/origami/table/' + dining_id;