-
+
-
+
<%= 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