Subversion Repositories SmartDukaan

Rev

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

Rev 9780 Rev 9825
Line 164... Line 164...
164
</script>
164
</script>
165
<script type="text/javascript">
165
<script type="text/javascript">
166
$('#populateStuff').live('click', function(){
166
$('#populateStuff').live('click', function(){
167
	var itemId=$('#itemId').val();
167
	var itemId=$('#itemId').val();
168
	var whId=$('#warehouseId').val();
168
	var whId=$('#warehouseId').val();
-
 
169
	var sellingPrice=$('#sellingPrice').val();
169
	if ( whId==null || whId=="" || isNaN(whId)){
170
	if ( whId==null || whId=="" || isNaN(whId)){
170
		jAlert('Please enter valid warehouse id', 'ERROR');
171
		jAlert('Please enter valid warehouse id', 'ERROR');
171
		return false;
172
		return false;
172
	}
173
	}
-
 
174
	if (sellingPrice==0 || sellingPrice=="" || isNaN(sellingPrice)){
-
 
175
		jAlert('Illegal Entry In Selling Price', 'ERROR');
-
 
176
		return false;
-
 
177
	}
173
	jQuery.ajax({
178
	jQuery.ajax({
174
        type : "GET",
179
        type : "GET",
175
        url : "/Support/snapdeal-list!getItemDetailsInJson?itemId="+itemId+"&warehouseId="+whId,
180
        url : "/Support/snapdeal-list!getItemDetailsInJson?itemId="+itemId+"&warehouseId="+whId+"&sellingPrice="+sellingPrice,
176
		beforeSend: function(){
181
		beforeSend: function(){
177
        $('#ajax-spinner').show();
182
        $('#ajax-spinner').show();
178
		$('#add-new-item')[0].reset();
183
		$('#add-new-item')[0].reset();
179
        },
184
        },
180
        complete: function(){
185
        complete: function(){
Line 195... Line 200...
195
		$('input#commissionRate').val(parsedData.CommissionRate);
200
		$('input#commissionRate').val(parsedData.CommissionRate);
196
		$('input#returnProvision').val(parsedData.ReturnProvision);
201
		$('input#returnProvision').val(parsedData.ReturnProvision);
197
		$('input#emiFee').val(parsedData.EmiFee);
202
		$('input#emiFee').val(parsedData.EmiFee);
198
		$('input#closingFee').val(parsedData.ClosingFee);
203
		$('input#closingFee').val(parsedData.ClosingFee);
199
		$('input#serviceTaxRate').val(parsedData.ServiceTaxRate);
204
		$('input#serviceTaxRate').val(parsedData.ServiceTaxRate);
200
		$('input#sellingPrice').val('0.0');
205
		$('input#sellingPrice').val(sellingPrice);
201
		$('input#transferPrice').val('0.0');
206
		$('input#transferPrice').val('0.0');
202
		$('input#exceptionPrice').val('0.0');
207
		$('input#exceptionPrice').val('0.0');
203
		$('input#commission').val('0.0');
208
		$('input#commission').val('0.0');
204
		$('input#serviceTax').val('0.0');
209
		$('input#serviceTax').val('0.0');
205
		$('input#courierCost').val('0.0');
210
		$('input#courierCost').val('0.0');
206
		$('input#maxNlc').val(parsedData.MaxNlc);
211
		$('input#maxNlc').val(parsedData.MaxNlc);
207
		$('input#warehouseId').val(whId);
212
		$('input#warehouseId').val(whId);
-
 
213
		$('input#vat').val(parsedData.VatRate);
-
 
214
		calculateStuff();
208
        },
215
        },
209
		error : function() {
216
		error : function() {
210
			alert("Either item id is already present in snapdeal item or  not a valid item Id");
217
			alert("Either item id is already present in snapdeal item or  not a valid item Id");
211
		 },
218
		 },
212
    });
219
    });