Subversion Repositories SmartDukaan

Rev

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

Rev 12898 Rev 12904
Line 447... Line 447...
447
                itemAvailability = None
447
                itemAvailability = None
448
                try:
448
                try:
449
                    itemAvailability = inv_client.getItemAvailabilityAtLocation(item_id, 1)
449
                    itemAvailability = inv_client.getItemAvailabilityAtLocation(item_id, 1)
450
                except:
450
                except:
451
                    pass
451
                    pass
-
 
452
                
-
 
453
                print 'itemAvailability billling Warehouse ', itemAvailability[2]
452
                if itemAvailability is not None:
454
                if itemAvailability is not None:
453
                    billingWarehouse = None
455
                    billingWarehouse = None
454
                    try:
456
                    try:
455
                        billingWarehouse = inv_client.getWarehouse(itemAvailability.billingWarehouseId)
457
                        billingWarehouse = inv_client.getWarehouse(itemAvailability[2])
456
                    except:
458
                    except:
457
                        pass
459
                        pass
-
 
460
                    
-
 
461
                    print 'billingWarehouse Id Location ', billingWarehouse.stateId
458
                    if billingWarehouse is not None:
462
                    if billingWarehouse is not None:
459
                        
463
                        estimateVal = None
460
                        if not logistics_client.isAlive() :
464
                        if not logistics_client.isAlive() :
461
                            logistics_client = LogisticsClient().get_client()
465
                            logistics_client = LogisticsClient().get_client()
462
                        try:
466
                        try:
463
                            estimateVal = logistics_client.getFirstDeliveryEstimateForWhLocation(customer_pincode, billingWarehouse.logisticsLocation)
467
                            estimateVal = logistics_client.getFirstDeliveryEstimateForWhLocation(customer_pincode, billingWarehouse.stateId)
464
                            if estimateVal ==-1:
468
                            if estimateVal ==-1:
465
                                item_delivery_estimate =-1
469
                                item_delivery_estimate =-1
466
                        except:
470
                        except:
467
                            pass
471
                            pass
-
 
472
                        print 'estimateVal Value ', estimateVal
468
            if old_estimate != item_delivery_estimate:
473
            if old_estimate != item_delivery_estimate:
469
                line.estimate = item_delivery_estimate
474
                line.estimate = item_delivery_estimate
470
                cart.updated_on = current_time
475
                cart.updated_on = current_time
471
        else:
476
        else:
472
            Discount.query.filter(Discount.line==line).delete()
477
            Discount.query.filter(Discount.line==line).delete()