diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index 6f336158..4a4d13b8 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -1,4 +1,4 @@ -
+ +
- + -->
- +
- + @@ -25,7 +25,7 @@ <%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
- + @@ -48,12 +48,12 @@
<% @i = 0 %> <% @crm_customers.each do |crm_customer| %> - + @@ -62,15 +62,15 @@ - + - + <% end %> - +
- <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> + <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> <%= @i += 1 %> <% end %> <%= crm_customer.contact_no %> <%= crm_customer.email %> <%= link_to 'Show', crm_customer_path(crm_customer) %>

- + <%= paginate @crm_customers %>
@@ -98,9 +98,9 @@ $(function() { $('.datepicker').css('cursor','pointer'); // Read Card Reader - $("#member_acc_no").on('click', function(e){ - var cardNo = ""; - $("#sxModal").show(); + $("#member_acc_no").on('click', function(e){ + var cardNo = ""; + $("#sxModal").show(); setTimeout(function(){ getCardNo(); $("#sxModal").hide(); @@ -120,16 +120,16 @@ $(document).on('click',".customer_tr",function(){ // var url = "/"+customer_id; update_sale(customer_id,sale_id); }else{ - + var url = "customers/"+customer_id; } - - $.ajax({ - type: "GET", - url: url, + + $.ajax({ + type: "GET", + url: url, data: {}, dataType: "json", - success: function(data) { + success: function(data) { $('#customer_id').val(data.id); $('#customer_name').val(data.name); $('#customer_company').val(data.company); @@ -158,7 +158,7 @@ $(document).on('click',".customer_tr",function(){ }else{ $('.mdm').prop( "checked", true ) } - + $('.membership_authentication_code').val(data.membership_authentication_code); $('#update_customer').removeAttr('disabled').val(''); @@ -177,7 +177,7 @@ $(document).on('click',".customer_tr",function(){ } }); // }else{ - + // } }) @@ -186,44 +186,43 @@ $(document).on('click',".customer_tr",function(){ title: 'Confirm!', content: 'Are You Sure to assign this customer!', buttons: { - + cancel: function () { - + }, confirm: { text: 'Confirm', btnClass: 'btn-green', keys: ['enter', 'shift'], action: function(){ - $.ajax({ - type: "POST", + $.ajax({ + type: "POST", url: "update_sale/" , data: {customer_id:customer_id,sale_id:sale_id}, dataType: "json", success: function(data) { if(data.status == true) - { + { window.location.href = '/origami' }else{ alert('Record not found!'); location.reload(); } - - } + + } }); } } - + } }); } $('#reset').click(function() { - + window.location.href = '/crm/customers' return false; }); - \ No newline at end of file