Subversion Repositories SmartDukaan

Rev

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

Rev 22452 Rev 24033
Line 31... Line 31...
31
        $(this).closest('tr').find('#item-amount').html(quantity * price);
31
        $(this).closest('tr').find('#item-amount').html(quantity * price);
32
        updateTotalAmount();
32
        updateTotalAmount();
33
    });
33
    });
34
 
34
 
35
    $('input[name$=item_id]').live('change', function() {
35
    $('input[name$=item_id]').live('change', function() {
-
 
36
    	var count=0;
-
 
37
    	$(this).closest('table>tr')).forEach(function(el){
-
 
38
    		if($(el).find('input[name=item_id]').val()==$(this).val()) {
-
 
39
    			count += 1;
-
 
40
    		}
-
 
41
    	});
-
 
42
    	if(count==2) {
-
 
43
    		alert("item should not be repeated twice");
-
 
44
    		return;
-
 
45
    	}
36
        updateModelName($(this).closest('tr'), $(this).val());
46
        updateModelName($(this).closest('tr'), $(this).val());
-
 
47
        updateModelPrice($(this).closest('tr'), $(this).val());
37
    });
48
    });
38
    
49
    
39
    $('#walletFlag').live('change', function(){
50
    $('#walletFlag').live('change', function(){
40
        $('.rtgsgroup').toggle();
51
        $('.rtgsgroup').toggle();
41
        $('.rtgsgroup input').attr('disabled', function(i, v) { return !v; });
52
        $('.rtgsgroup input').attr('disabled', function(i, v) { return !v; });