Subversion Repositories SmartDukaan

Rev

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

Rev 8822 Rev 8898
Line 522... Line 522...
522
            $('#refundAmountGateway').val('');
522
            $('#refundAmountGateway').val('');
523
    	});
523
    	});
524
    });
524
    });
525
    
525
    
526
    $('#refundPhysicalOrderForm').live('submit', function(){
526
    $('#refundPhysicalOrderForm').live('submit', function(){
-
 
527
    	var orderAmount = $("input[name='orderAmount']").val();
-
 
528
    	var orderAmountFloat = parseFloat(orderAmount);
527
    	var radioBtnValue = $("input[name='rfdRadio']:checked").val()
529
    	var radioBtnValue = $("input[name='rfdRadio']:checked").val();
528
    	if(radioBtnValue == 'rfdCoupon')
530
    	if(radioBtnValue == 'rfdCoupon')
529
		{
531
		{
530
			var couponDeatils = $("input[name='couponDetails']").val();
532
			var couponDeatils = $("input[name='couponDetails']").val();
531
			var refundAmountCoupon = $("input[name='refundAmountCoupon']").val();
533
			var refundAmountCoupon = $("input[name='refundAmountCoupon']").val();
-
 
534
			var refundAmountCouponFloat = parseFloat(refundAmountCoupon);
532
			if(couponDeatils==null || couponDeatils=="")
535
			if(couponDeatils==null || couponDeatils=="")
533
			{
536
			{
534
				alert("Coupon Details are Mandatory. Please fill the Details");
537
				alert("Coupon Details are Mandatory. Please fill the Details");
535
				$('input[name=couponDetails]').focus();
538
				$('input[name=couponDetails]').focus();
536
				return false;
539
				return false;
Line 539... Line 542...
539
			{
542
			{
540
				alert("Refund Amount is Mandatory. Please fill the Amount");
543
				alert("Refund Amount is Mandatory. Please fill the Amount");
541
				$('input[name=refundAmountCoupon]').focus();
544
				$('input[name=refundAmountCoupon]').focus();
542
				return false;
545
				return false;
543
			}
546
			}
-
 
547
			if(refundAmountCouponFloat > orderAmountFloat){
-
 
548
				var didConfirm = confirm("Refund Amount is Greater Than Order Total Amount.\nAre you still want to Proceed");
-
 
549
				if(didConfirm==false){
-
 
550
					return false;
-
 
551
				}
-
 
552
			}
544
		}
553
		}
545
		if(radioBtnValue == 'rfdCheque')
554
		if(radioBtnValue == 'rfdCheque')
546
		{
555
		{
547
			var chequeDetails = $("input[name='chequeDetails']").val();
556
			var chequeDetails = $("input[name='chequeDetails']").val();
548
			var refundAmountCheque = $("input[name='refundAmountCheque']").val();
557
			var refundAmountCheque = $("input[name='refundAmountCheque']").val();
Line 561... Line 570...
561
		}
570
		}
562
		if(radioBtnValue == 'rfdGateway')
571
		if(radioBtnValue == 'rfdGateway')
563
		{
572
		{
564
			var comments = $("input[name='comments']").val();
573
			var comments = $("input[name='comments']").val();
565
			var refundAmountGateway = $("input[name='refundAmountGateway']").val();
574
			var refundAmountGateway = $("input[name='refundAmountGateway']").val();
-
 
575
			var refundAmountGatewayFloat = parseFloat(refundAmountGateway);
566
			if(comments==null || comments=="")
576
			if(comments==null || comments=="")
567
			{
577
			{
568
				alert("Comments Mandatory. Please fill the Details");
578
				alert("Comments Mandatory. Please fill the Details");
569
				$('input[name=comments]').focus();
579
				$('input[name=comments]').focus();
570
				return false;
580
				return false;
Line 573... Line 583...
573
			{
583
			{
574
				alert("Refund Amount is Mandatory. Please fill the Amount");
584
				alert("Refund Amount is Mandatory. Please fill the Amount");
575
				$('input[name=refundAmountGateway]').focus();
585
				$('input[name=refundAmountGateway]').focus();
576
				return false;
586
				return false;
577
			}
587
			}
-
 
588
			if(refundAmountGatewayFloat > orderAmountFloat){
-
 
589
				var didConfirm = confirm("Refund Amount is Greater Than Order Total Amount.\nAre you still want to Proceed");
-
 
590
				if(didConfirm==false){
-
 
591
					return false;
-
 
592
				}
-
 
593
			}
578
		}
594
		}
579
    	refundOrderPayment($(this).serialize());
595
    	refundOrderPayment($(this).serialize());
580
    	return false;
596
    	return false;
581
    });
597
    });
582
    
598