Subversion Repositories SmartDukaan

Rev

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

Rev 10324 Rev 12867
Line 20... Line 20...
20
    });
20
    });
21
 
21
 
22
    $('input[name$=quantity]').live('change', function() {
22
    $('input[name$=quantity]').live('change', function() {
23
        var price = $(this).closest('tr').find('input[name$=unitPrice]');
23
        var price = $(this).closest('tr').find('input[name$=unitPrice]');
24
        var quantity    = $(this).val();
24
        var quantity    = $(this).val();
-
 
25
        if(quantity==0){
-
 
26
        	alert('Quantity entered by is zero for the Item Id  '+ $('input[name$=itemId]') +'. This Item will not be considered in PO');
-
 
27
        }
25
        $(this).closest('tr').find('#amount').html(quantity * price);
28
        $(this).closest('tr').find('#amount').html(quantity * price);
26
        updateTotalAmount($(this).closest('div.lineitems').attr('supplierId'));
29
        updateTotalAmount($(this).closest('div.lineitems').attr('supplierId'));
27
    });
30
    });
28
 
31
 
29
    $('form.create-purchase-order').live('submit', function() {
32
    $('form.create-purchase-order').live('submit', function() {
Line 101... Line 104...
101
    	else{
104
    	else{
102
    		$('.extraCstInputs-class').hide();
105
    		$('.extraCstInputs-class').hide();
103
    		$('.cstBorneByUs-class').val('0.00');
106
    		$('.cstBorneByUs-class').val('0.00');
104
    	}
107
    	}
105
    });
108
    });
-
 
109
    /*
-
 
110
    $('.adjustInventoryForm').hide();
-
 
111
    $('.adjustInventoryButton').attr('disabled',false);
-
 
112
    
-
 
113
    $('.adjustInventoryButton').live('click', function() {
-
 
114
        $(this).hide();
-
 
115
        $('.adjustInventoryButton').attr('disabled',true);
-
 
116
        $(this).siblings('.adjustInventoryForm').show();
-
 
117
    });
-
 
118
 
-
 
119
    $('.cancelButton').live('click', function() {
-
 
120
        $(this).parent().parent().siblings('.adjustInventoryButton').show();
-
 
121
        $('.adjustInventoryButton').attr('disabled',false);
-
 
122
        $('.quantityAdjust').val('');
-
 
123
        $(this).parent().parent().hide();
-
 
124
    });
-
 
125
    
-
 
126
    
-
 
127
    $('.setWeightForm').hide();
-
 
128
    $('.setWeightButton').attr('disabled',false);
-
 
129
    
-
 
130
    $('.setWeightButton').live('click', function() {
-
 
131
        $(this).hide();
-
 
132
        $('.setWeightButton').attr('disabled',true);
-
 
133
        $(this).siblings('.setWeightForm').show();
-
 
134
    });
-
 
135
 
-
 
136
    $('.cancelWeightButton').live('click', function() {
-
 
137
        $(this).parent().parent().siblings('.setWeightButton').show();
-
 
138
        $('.setWeightButton').attr('disabled',false);
-
 
139
        $('.weightVal').val('');
-
 
140
        $(this).parent().parent().hide();
-
 
141
    });
-
 
142
    
-
 
143
    $('.setWeightNew').live('click', function() {
-
 
144
    	alert('Hi');
-
 
145
    	var itemId = $(this).attr('itemId');
-
 
146
    	var weight = $('.weightVal_'+itemId).val();
-
 
147
    	var poId = $('.poId').val();
-
 
148
    	console.log(typeof(weight));
-
 
149
    	alert(weight);
-
 
150
    	alert(poId);
-
 
151
    	if(weight >15.0){
-
 
152
    		//alert('Inside Condition');
-
 
153
    		var didConfirm = confirm("Weight Entered is greater than 15 Kgs.\nAre you still want to Proceed");
-
 
154
			if(didConfirm==false){
-
 
155
				return false;
-
 
156
			}
-
 
157
    	}
-
 
158
        submitSetWeightForm(itemId,weight,poId);
-
 
159
        return false;
-
 
160
    });
-
 
161
    
-
 
162
    $('.weightVal').keypress(function(e) {
-
 
163
        var a = [];
-
 
164
        var k = e.which;
-
 
165
 
-
 
166
        for (i = 46; i < 58; i++){
-
 
167
    		if(i == 47){
-
 
168
    			continue;
-
 
169
    		}
-
 
170
    		else{
-
 
171
            	a.push(i);
-
 
172
    		}
-
 
173
    	}
-
 
174
 
-
 
175
        if (!(a.indexOf(k)>=0)){
-
 
176
            e.preventDefault();
-
 
177
    	}
-
 
178
    });*/
106
});
179
});