Subversion Repositories SmartDukaan

Rev

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

Rev 10922 Rev 12661
Line 202... Line 202...
202
}
202
}
203
</script>
203
</script>
204
<script type="text/javascript">
204
<script type="text/javascript">
205
$(function(){	
205
$(function(){	
206
$("#amazon-form").live('submit', function(){
206
$("#amazon-form").live('submit', function(){
-
 
207
    var fbaPrice = $('#fbaPrice').val();
-
 
208
    var nonFbaPrice = $('#sellingPrice').val();
-
 
209
	var fbbPrice = $('#fbbPrice').val();
-
 
210
    var holdInventory = $('#holdInventory').val();
-
 
211
    var defaultInventory = $('#defaultInventory').val();
-
 
212
    var customHandlingTime = $('#customHandlingTime').val();
-
 
213
    if ( fbaPrice==null || fbaPrice=="" || isNaN(fbaPrice))
-
 
214
      {
-
 
215
      jAlert('Illegal Entry In Fba Price Field', 'ERROR');
-
 
216
      return false;
-
 
217
      }
-
 
218
	  
-
 
219
    if ( nonFbaPrice==null || nonFbaPrice=="" || isNaN(nonFbaPrice) )
-
 
220
      {
-
 
221
      jAlert('Illegal Entry In Non Fba Price Field', 'ERROR');
-
 
222
      return false;
-
 
223
      }
-
 
224
	  
-
 
225
    if ( fbbPrice==null || fbbPrice=="" || isNaN(fbbPrice) )
-
 
226
      {
-
 
227
      jAlert('Illegal Entry In Fbb Price Field', 'ERROR');
-
 
228
      return false;
-
 
229
      }
-
 
230
      
-
 
231
    if ( customHandlingTime > 30 || customHandlingTime==null || customHandlingTime=="" || isNaN(customHandlingTime) )
-
 
232
      {
-
 
233
      jAlert('Unacceptable Value In Lead Time To Ship', 'ERROR');
-
 
234
      return false;
-
 
235
      }
-
 
236
	  
-
 
237
    if ( holdInventory==null || holdInventory=="" || isNaN(holdInventory))
-
 
238
      {
-
 
239
      jAlert('Illegal Entry In Hold Inventory Field', 'ERROR');
-
 
240
      return false;
-
 
241
      }
-
 
242
	  
-
 
243
    if ( defaultInventory==null || defaultInventory=="" || isNaN(defaultInventory) )
-
 
244
      {
-
 
245
      jAlert('Illegal Entry In Default Inventory Field', 'ERROR');
-
 
246
      return false;
-
 
247
      }  	
-
 
248
 
-
 
249
 
207
    var data = $(this).serialize() 
250
    var data = $(this).serialize() 
208
 
251
 
209
    jQuery.ajax({
252
    jQuery.ajax({
210
        url: "/Support/amazon-list!update",
253
        url: "/Support/amazon-list!update",
211
        type: 'POST',
254
        type: 'POST',
212
        data: data,
255
        data: data,
213
        async: false,
256
        async: false,
214
		beforeSend: function(){
257
		beforeSend: function(){
215
        $('#ajax-spinner').show();
258
        $('#ajax-spinner').show();
-
 
259
        },
-
 
260
        complete: function(){
-
 
261
        $('#ajax-spinner').hide();
-
 
262
        },
-
 
263
        success: function (data) {
-
 
264
            alert("Changes propagated successfully");
-
 
265
        },
-
 
266
		 error : function() {
-
 
267
		 	alert("OOPS!!!Failed to do changes.Try Again.");
-
 
268
		 },
-
 
269
        cache: false,
-
 
270
        contentType: "application/x-www-form-urlencoded",
-
 
271
        processData: false
-
 
272
    });
-
 
273
 
-
 
274
    return false;
-
 
275
});
-
 
276
});
-
 
277
</script>
-
 
278
<script type="text/javascript">
-
 
279
$(function(){	
-
 
280
$("#amazon-promo-form").live('submit', function(){
-
 
281
    var fbaPromoStatus = $('#isFbaPromotionActive').val();
-
 
282
	var fbbPromoStatus = $('#isFbbPromotionActive').val();
-
 
283
	if (fbaPromoStatus){
-
 
284
		var fbaPromoPrice = $('#fbaPromoPrice').val();
-
 
285
		var maxFbaSalePrice = $('#fbaMaxSalePrice').val();
-
 
286
		
-
 
287
		if (fbaPromoPrice<=0){
-
 
288
			jAlert('Illegal value in Fba Promo Price field', 'ERROR');
-
 
289
      		return false;
-
 
290
		}
-
 
291
		
-
 
292
		if (maxFbaSalePrice<=0){
-
 
293
			jAlert('Illegal value in Fba Max Promo Price field', 'ERROR');
-
 
294
      		return false;
-
 
295
		}
-
 
296
		
-
 
297
		if (fbaPromoPrice > maxFbaSalePrice){
-
 
298
			jAlert('Fba Promo Price cant be greater than Fba Max Promo Price', 'ERROR');
-
 
299
      		return false;
-
 
300
		}
-
 
301
	}
-
 
302
	
-
 
303
	if (fbbPromoStatus){
-
 
304
		var fbbPromoPrice = $('#fbbPromoPrice').val();
-
 
305
		var maxFbbSalePrice = $('#fbbMaxSalePrice').val();
-
 
306
		
-
 
307
		if (fbbPromoPrice<=0){
-
 
308
			jAlert('Illegal value in Fbb Promo Price field', 'ERROR');
-
 
309
      		return false;
-
 
310
		}
-
 
311
		
-
 
312
		if (maxFbbSalePrice<=0){
-
 
313
			jAlert('Illegal value in Fbb Max Promo Price field', 'ERROR');
-
 
314
      		return false;
-
 
315
		}
-
 
316
		
-
 
317
		if (fbbPromoPrice > maxFbbSalePrice){
-
 
318
			jAlert('Fbb Promo Price cant be greater than Fbb Max Promo Price', 'ERROR');
-
 
319
      		return false;
-
 
320
		}
-
 
321
	}
-
 
322
 
-
 
323
	var data = $(this).serialize() 
-
 
324
 
-
 
325
    jQuery.ajax({
-
 
326
        url: "/Support/amazon-list!updatePromo",
-
 
327
        type: 'POST',
-
 
328
        data: data,
-
 
329
        async: false,
-
 
330
		beforeSend: function(){
-
 
331
        $('#ajax-spinner').show();
216
        },
332
        },
217
        complete: function(){
333
        complete: function(){
218
        $('#ajax-spinner').hide();
334
        $('#ajax-spinner').hide();
219
        },
335
        },
220
        success: function (data) {
336
        success: function (data) {