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" 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>
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<!-- Nav tabs - End -->
@@ -156,6 +159,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 -->
@@ -353,8 +389,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;