Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Nweni
2017-06-14 10:07:48 +06:30
30 changed files with 668 additions and 542 deletions

View File

@@ -24,9 +24,10 @@
<tr>
<td colspan="6">
<%= form_tag crm_customers_path, :method => :get do %>
<div class="input-append form-group pull-left">
<input type="text" name="filter" placeholder="Search" class="form-control input-sm col-md-8">
<% path ="/origami/#{@sale_id}/customers" %>
<%= form_tag path, :method => :get do %>
<div class="input-append col-md-12 form-group pull-left">
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" class="form-control input-sm col-md-4">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</div>
<% end %>
@@ -42,17 +43,21 @@
</thead>
<tbody>
<% @crm_customers.each do |crm_customer| %>
<tr>
<td>
<input type="radio" style="width:20px;" value="<%= crm_customer.customer_id %>" name="checkbox" class="checkbox_check" ></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company rescue '-' %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
</tr>
<% if @crm_customers.count > 0 %>
<% @crm_customers.each do |crm_customer| %>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company rescue '-' %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
</tr>
<% end %>
<%else%>
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
<% end %>
</tbody>
</table>
@@ -110,8 +115,9 @@
<%end%>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<a href="<%= origami_root_path%>" class="btn btn-primary btn-lg ">
Back
<br>
<a href="<%= origami_root_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div>
</div>
@@ -128,11 +134,11 @@
$('.datepicker').css('cursor','pointer');
});
$(document).on('click',".checkbox_check",function(){
if(this.checked){
$(document).on('click',".customer_tr",function(){
// if(this.checked){
var sale_id = $("#sale_id").val() || 0;
var customer_id = $(this).val();
var customer_id = $(this).attr('data-ref');
if(sale_id != 0){
// var url = "/"+customer_id;
@@ -171,9 +177,9 @@
//$(".edit_customer").attr('method', 'PATCH');
}
});
}else{
// }else{
}
// }
})
function update_sale(customer_id,sale_id) {