Subversion Repositories SmartDukaan

Rev

Rev 22292 | Rev 22488 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22292 Rev 22354
Line 485... Line 485...
485
            $('#' + domId).html(response);
485
            $('#' + domId).html(response);
486
        }
486
        }
487
    });  
487
    });  
488
}
488
}
489
 
489
 
-
 
490
 
-
 
491
function contactUs(domId){
-
 
492
	jQuery.ajax({
-
 
493
        type : "GET",
-
 
494
        url : context+"/contactUs",
-
 
495
        success : function(response) {
-
 
496
            $('#' + domId).html(response);
-
 
497
        }
-
 
498
    });  
-
 
499
}
-
 
500
 
-
 
501
function writeOldCustomerDetailsByMobileNumber(mobileNumber){
-
 
502
	jQuery.ajax({
-
 
503
        type : "GET",
-
 
504
        url : context+"/customer/mobileNumber?mobileNumber="+mobileNumber,
-
 
505
        success : function(response) {
-
 
506
        	console.log("response"+response);
-
 
507
        	var customer = response.response;
-
 
508
            $('#firstName').attr('value', customer.firstName);
-
 
509
            $('#lastName').attr('value', customer.lastName);
-
 
510
            $('#email').attr('value', customer.emailId);
-
 
511
            $('#phone').attr('value', customer.mobileNumber);
-
 
512
            $('#alternatePhone').attr('value', customer.address.phoneNumber);
-
 
513
            $('#line1').attr('value', customer.address.line1);
-
 
514
            $('#line2').attr('value', customer.address.line2);
-
 
515
            $('#landmark').attr('value', customer.address.landmark);
-
 
516
            $('#pinCode').attr('value', customer.address.pinCode);
-
 
517
            $('#city').attr('value', customer.address.city);
-
 
518
            $('#state').attr('value', customer.address.state);
-
 
519
        }
-
 
520
    });  
-
 
521
}
-
 
522
 
490
function saleHistorySearchInfo(search_text, searchType, startTime, endTime){
523
function saleHistorySearchInfo(search_text, searchType, startTime, endTime){
491
	saleHistory("main-content", search_text, searchType, startTime, endTime);
524
	saleHistory("main-content", search_text, searchType, startTime, endTime);
492
}
525
}
493
 
526
 
494
 
527
 
Line 518... Line 551...
518
	var amount = 0;
551
	var amount = 0;
519
	var netPayableAmount = parseFloat($("form#cd input.netPayableAmount").val());
552
	var netPayableAmount = parseFloat($("form#cd input.netPayableAmount").val());
520
	
553
	
521
	
554
	
522
	$("form#cd input.amount").each(function(){
555
	$("form#cd input.amount").each(function(){
523
		if ($(this).val() ==""){
556
		if ($(this).val() == ""){
524
			$(this).val(0);
557
			$(this).val(0);
525
		}
558
		}
526
		var tmpAmount = parseFloat($(this).val());
559
		var tmpAmount = parseFloat($(this).val());
527
		amount = amount + tmpAmount;
560
		amount = amount + tmpAmount;
528
	});
561
	});
529
	
562
	
530
	console.log(amount);
563
	console.log(amount);
531
	console.log(netPayableAmount);
564
	console.log(netPayableAmount);
532
	
565
	
533
	if (amount!=netPayableAmount){
566
	if (amount != netPayableAmount){
534
		alert("Mismatch in amount");
567
		if(amount < netPayableAmount){
-
 
568
			alert("[" + (netPayableAmount - amount) + "] is more required to complete the payment");
-
 
569
		}else{
-
 
570
			alert("[" + (amount - netPayableAmount) + "] is extra amount, please reduce the amount");
-
 
571
		}
-
 
572
		$("form#cd input.netPayableAmount").each(function(){
-
 
573
			$(this).addClass("border-highlight");
-
 
574
		});
535
		error = true;
575
		error = true;
536
	}
576
	}
537
	
577
	
538
	if (error){
578
	if (error){
539
		return false;
579
		return false;