nfc add customer fixed

This commit is contained in:
yarzar_code
2020-09-02 17:16:01 +06:30
parent f8b56cf48a
commit fa630fd527
6 changed files with 241 additions and 256 deletions

View File

@@ -396,10 +396,7 @@
$("#paypar_account_no").on('focus', function(e){
if($(this).val() == ''){
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
},100);
getCardNo();
}
});
@@ -416,37 +413,34 @@
var sale_id = $("#sale_id").val() || 0;
var customer_mamber_card_no = 0;
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#search").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
data: { filter : customer_mamber_card_no ,type :"card"},
dataType: "json",
success: function(data) {
if (data[0].customer_id == false) {
swal("Alert!", data[0].message, "error");
// $.alert({
// title: 'Alert!',
// content: data[0].message,
// type: 'red',
// typeAnimated: true,
// btnClass: 'btn-danger',
// });
}else{
customer_id = data[0].customer_id;
customer_name = data[0].name;
update_sale(customer_id, customer_name,sale_id);
}
getCardNo();
customer_mamber_card_no = $("#search").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
data: { filter : customer_mamber_card_no ,type :"card"},
dataType: "json",
success: function(data) {
if (data[0].customer_id == false) {
swal("Alert!", data[0].message, "error");
// $.alert({
// title: 'Alert!',
// content: data[0].message,
// type: 'red',
// typeAnimated: true,
// btnClass: 'btn-danger',
// });
}else{
customer_id = data[0].customer_id;
customer_name = data[0].name;
update_sale(customer_id, customer_name,sale_id);
}
});
}
},100);
}
});
}
});
/*new customer UI func:*/
@@ -495,12 +489,14 @@
// get CardNo from Java
function setCardNo(cardNo){
$("#sxModal").hide();
check_member = localStorage.getItem("member_card");
if(cardNo.length == 16){
if(check_member == "true"){
$("#paypar_account_no").val(cardNo);
$("#search").val(cardNo);
$("#type").val("card");
$("#filter_form").submit();
}else{
if($.inArray(cardNo, paypar_account_no) !== -1){
swal({