Subversion Repositories SmartDukaan

Rev

Rev 13146 | Rev 13356 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
442 rajveer 1
'''
2
Created on 13-Sep-2010
3
 
4
@author: rajveer
5
'''
6
 
7
from shop2020.logistics.service.impl import DataService
644 chandransh 8
from shop2020.logistics.service.impl.DataService import Awb, AwbUpdate, Provider, \
3218 rajveer 9
     DeliveryEstimate, WarehouseAllocation, \
5555 rajveer 10
    PublicHolidays, ServiceableLocationDetails, PickupStore
3044 chandransh 11
from shop2020.thriftpy.logistics.ttypes import LogisticsServiceException,\
7786 manish.sha 12
    DeliveryType, LogisticsLocationInfo
442 rajveer 13
from shop2020.utils.Utils import log_entry, to_py_date, to_java_date
5964 amar.kumar 14
from sqlalchemy.sql import or_
442 rajveer 15
from elixir import session
1730 ankur.sing 16
import datetime, time
1504 ankur.sing 17
import sys
3355 chandransh 18
import logging
13146 manish.sha 19
import os
7293 anupam.sin 20
from shop2020.clients.CatalogClient import CatalogClient
3355 chandransh 21
logging.basicConfig(level=logging.DEBUG)
442 rajveer 22
 
3217 rajveer 23
warehouse_allocation_cache = {}
24
serviceable_location_cache = {}
25
delivery_estimate_cache = {}
6370 rajveer 26
 
3218 rajveer 27
'''
28
This class is for only data transfer. Never used outside this module.
29
'''
30
class _DeliveryEstimateObject:
6537 rajveer 31
    def __init__(self, delivery_time, delivery_delay, provider_id, codAllowed, otgAvailable):
3218 rajveer 32
        self.delivery_time = delivery_time
6537 rajveer 33
        self.delivery_delay = delivery_delay
3218 rajveer 34
        self.provider_id = provider_id
4866 rajveer 35
        self.codAllowed = codAllowed
6524 rajveer 36
        self.otgAvailable = otgAvailable
3218 rajveer 37
 
3187 rajveer 38
def initialize(dbname="logistics", db_hostname="localhost"):
442 rajveer 39
    log_entry("initialize@DataAccessor", "Initializing data service")
3187 rajveer 40
    DataService.initialize(dbname, db_hostname)
3218 rajveer 41
    print "Starting cache population at: " + str(datetime.datetime.now())
3217 rajveer 42
    __cache_warehouse_allocation_table()
43
    __cache_serviceable_location_details_table()
44
    __cache_delivery_estimate_table()
45
    close_session()
3218 rajveer 46
    print "Done cache population at: " + str(datetime.datetime.now())
442 rajveer 47
 
3217 rajveer 48
def __cache_delivery_estimate_table():
49
    delivery_estimates = DeliveryEstimate.query.all()
50
    for delivery_estimate in delivery_estimates:
7857 rajveer 51
        delivery_estimate_cache[delivery_estimate.destination_pin, delivery_estimate.provider_id, delivery_estimate.warehouse_location]\
6537 rajveer 52
        =delivery_estimate.delivery_time, delivery_estimate.delivery_delay
3217 rajveer 53
 
54
def __cache_serviceable_location_details_table():
5964 amar.kumar 55
    serviceable_locations = ServiceableLocationDetails.query.filter(or_("exp!=0","cod!=0"))
3217 rajveer 56
    for serviceable_location in serviceable_locations:
57
        try:
58
            provider_pincodes = serviceable_location_cache[serviceable_location.provider_id]
59
        except:
60
            provider_pincodes = {}
61
            serviceable_location_cache[serviceable_location.provider_id] = provider_pincodes 
7627 rajveer 62
        provider_pincodes[serviceable_location.dest_pincode] = serviceable_location.dest_code, serviceable_location.exp, serviceable_location.cod, serviceable_location.otgAvailable, serviceable_location.websiteCodLimit, serviceable_location.storeCodLimit, serviceable_location.providerPrepaidLimit
3217 rajveer 63
 
64
def __cache_warehouse_allocation_table():
65
    warehouse_allocations = WarehouseAllocation.query.all()
66
    for warehouse_allocation in warehouse_allocations:
67
        warehouse_allocation_cache[warehouse_allocation.pincode]=warehouse_allocation.primary_warehouse_location
68
 
644 chandransh 69
def get_provider(provider_id):
766 rajveer 70
    provider =  Provider.get_by(id=provider_id)
71
    return provider
644 chandransh 72
 
73
def get_providers():
5387 rajveer 74
    providers = Provider.query.filter_by(isActive = 1).all()
766 rajveer 75
    return providers 
644 chandransh 76
 
7608 rajveer 77
def get_logistics_estimation(destination_pin, item_selling_price, weight, type, billingWarehouseId):
5692 rajveer 78
    logging.info("Getting logistics estimation for pincode:" + destination_pin )
1504 ankur.sing 79
 
7608 rajveer 80
    provider_id, codAllowed, otgAvailable = __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price, weight, type, billingWarehouseId)
9964 anupam.sin 81
 
82
    if item_selling_price > 60000 or item_selling_price <= 250:
83
        codAllowed = False
84
 
7857 rajveer 85
    warehouse_location = 0
86
    if billingWarehouseId in [12,13]:
87
        warehouse_location = 1
88
 
3217 rajveer 89
    if not provider_id:
5692 rajveer 90
        raise LogisticsServiceException(101, "No provider assigned for pincode: " + str(destination_pin))
644 chandransh 91
    try:
7857 rajveer 92
        delivery_time = delivery_estimate_cache[destination_pin, provider_id, warehouse_location][0]
93
        delivery_delay = delivery_estimate_cache[destination_pin, provider_id, warehouse_location][1]
6537 rajveer 94
        delivery_estimate = _DeliveryEstimateObject(delivery_time, delivery_delay, provider_id, codAllowed, otgAvailable)
3218 rajveer 95
        return delivery_estimate
1504 ankur.sing 96
    except Exception as ex:
97
        print ex
644 chandransh 98
        raise LogisticsServiceException(103, "No Logistics partner listed for this destination pincode and the primary warehouse")
3150 rajveer 99
 
7608 rajveer 100
def __get_logistics_provider_for_destination_pincode(destination_pin, item_selling_price, weight, type, billingWarehouseId):
9154 rajveer 101
    if serviceable_location_cache.get(6).has_key(destination_pin):
102
        if weight < 480 and serviceable_location_cache.get(3).has_key(destination_pin) and type == DeliveryType.PREPAID:
7981 rajveer 103
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(3).get(destination_pin)
104
            if item_selling_price <= providerPrepaidLimit:
105
                iscod = iscod and item_selling_price <= websiteCodLimit
106
                otgAvailable = otgAvailable and item_selling_price >= 2000
107
                return 3, iscod, otgAvailable
108
        else:
109
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(6).get(destination_pin)
110
            if item_selling_price <= providerPrepaidLimit:
111
                iscod = iscod and item_selling_price <= websiteCodLimit
112
                otgAvailable = otgAvailable and item_selling_price >= 2000
113
                return 6, iscod, otgAvailable
114
 
115
    if serviceable_location_cache.get(3).has_key(destination_pin):
116
        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(3).get(destination_pin)
7627 rajveer 117
        if item_selling_price <= providerPrepaidLimit:
7608 rajveer 118
            iscod = iscod and item_selling_price <= websiteCodLimit
119
            otgAvailable = otgAvailable and item_selling_price >= 2000
7981 rajveer 120
            return 3, iscod, otgAvailable
8575 rajveer 121
 
122
    if billingWarehouseId not in [12,13] and serviceable_location_cache.get(7).has_key(destination_pin):
123
        if item_selling_price < 3000 and serviceable_location_cache.get(1).has_key(destination_pin):
124
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(1).get(destination_pin)
125
            if item_selling_price <= providerPrepaidLimit:
126
                iscod = iscod and item_selling_price <= websiteCodLimit
127
                otgAvailable = otgAvailable and item_selling_price >= 2000
128
                return 1, iscod, otgAvailable
129
        else:
130
            dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(7).get(destination_pin)
131
            if item_selling_price <= providerPrepaidLimit:
132
                iscod = iscod and item_selling_price <= websiteCodLimit
133
                otgAvailable = otgAvailable and item_selling_price >= 2000
134
                return 7, iscod, otgAvailable
135
 
7627 rajveer 136
    if serviceable_location_cache.get(1).has_key(destination_pin):
137
        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit, providerPrepaidLimit = serviceable_location_cache.get(1).get(destination_pin)
138
        if item_selling_price <= providerPrepaidLimit:
7608 rajveer 139
            iscod = iscod and item_selling_price <= websiteCodLimit
140
            otgAvailable = otgAvailable and item_selling_price >= 2000
7627 rajveer 141
            return 1, iscod, otgAvailable
7981 rajveer 142
 
10185 amit.gupta 143
    return None, False, False    
5278 rajveer 144
 
6017 amar.kumar 145
def get_destination_code(providerId, pinCode):
146
    serviceableLocationDetail = ServiceableLocationDetails.query.filter_by(provider_id = providerId, dest_pincode = pinCode).one()
147
    return serviceableLocationDetail.dest_code
148
 
644 chandransh 149
def add_empty_AWBs(numbers, provider_id, type):
442 rajveer 150
    for number in numbers:
644 chandransh 151
        query = Awb.query.filter_by(awb_number = number, provider_id = provider_id)
444 rajveer 152
        try:
153
            query.one()
154
        except:    
644 chandransh 155
            awb = Awb()
444 rajveer 156
            awb.awb_number = number
644 chandransh 157
            awb.provider_id = provider_id
444 rajveer 158
            awb.is_available = True
644 chandransh 159
            awb.type = type
160
    session.commit()
442 rajveer 161
 
444 rajveer 162
def set_AWB_as_used(awb_number):
644 chandransh 163
    query = Awb.query.filter_by(awb_number = awb_number)
444 rajveer 164
    awb = query.one() 
165
    awb.is_available=False
166
    session.commit()
167
 
3044 chandransh 168
def get_empty_AWB(provider_id, type = DeliveryType.PREPAID):
2342 chandransh 169
    query = Awb.query.with_lockmode("update").filter_by(provider_id = provider_id, is_available = True)  #check the provider thing
3044 chandransh 170
    if type == DeliveryType.PREPAID:
171
        query = query.filter_by(type="Prepaid")
172
    if type == DeliveryType.COD:
173
        query = query.filter_by(type="COD")
174
 
13158 manish.sha 175
    additionalQuery = query
176
    query = query.filter_by(awbUsedFor=0)
177
 
442 rajveer 178
    try:
644 chandransh 179
        awb = query.first()
13158 manish.sha 180
        if awb is None:
181
            additionalQuery = additionalQuery.filter_by(awbUsedFor=2)
182
            awb = additionalQuery.first()
644 chandransh 183
        awb.is_available = False
184
        session.commit()
444 rajveer 185
        return awb.awb_number
442 rajveer 186
    except:
644 chandransh 187
        raise LogisticsServiceException(103, "Unable to get an AWB for the given Provider: " + str(provider_id))
1137 chandransh 188
 
3103 chandransh 189
def get_free_awb_count(provider_id, type):
190
    count = Awb.query.filter_by(provider_id = provider_id, is_available = True, type=type).count()
1137 chandransh 191
    if count == None:
192
        count = 0
193
    return count
442 rajveer 194
 
644 chandransh 195
def get_shipment_info(awb_number, provider_id):
196
    awb = Awb.get_by(awb_number = awb_number, provider_id = provider_id)
197
    query = AwbUpdate.query.filter_by(awb = awb)
766 rajveer 198
    info = query.all()
199
    return info
200
 
6643 rajveer 201
def store_shipment_info(update):
202
    updates = AwbUpdate.query.filter_by(providerId = update.providerId, awbNumber  = update.awbNumber, location = update.location, date = to_py_date(update.date), status = update.status, description = update.description).all()
203
    if not updates:
204
        dupdate = AwbUpdate()
205
        dupdate.providerId = update.providerId
206
        dupdate.awbNumber  = update.awbNumber
207
        dupdate.location = update.location
208
        dupdate.date = to_py_date(update.date)
209
        dupdate.status = update.status
210
        dupdate.description = update.description
211
        session.commit()
212
 
1730 ankur.sing 213
def get_holidays(start_date, end_date):
214
    query = PublicHolidays.query
215
    if start_date != -1:
216
        query = query.filter(PublicHolidays.date >= to_py_date(start_date))
217
    if end_date != -1:
218
        query = query.filter(PublicHolidays.date <= to_py_date(end_date))
219
    holidays = query.all()
220
    holiday_dates = [to_java_date(datetime.datetime(*time.strptime(str(holiday.date), '%Y-%m-%d')[:3])) for holiday in holidays] 
221
    return holiday_dates
222
 
5527 anupam.sin 223
def get_provider_for_pickup_type(pickUp):
224
    return Provider.query.filter(Provider.pickup == pickUp).first().id
225
 
766 rajveer 226
def close_session():
227
    if session.is_active:
228
        print "session is active. closing it."
2823 chandransh 229
        session.close()
3376 rajveer 230
 
231
def is_alive():
232
    try:
233
        session.query(Awb.id).limit(1).one()
234
        return True
235
    except:
5555 rajveer 236
        return False
237
 
238
def get_all_pickup_stores():
5572 anupam.sin 239
    pickupStores = PickupStore.query.all()
240
    return pickupStores
5555 rajveer 241
 
242
def get_pickup_store(storeId):
5719 rajveer 243
    return PickupStore.query.filter_by(id = storeId).one()
244
 
245
def get_pickup_store_by_hotspot_id(hotspotId):
246
    return PickupStore.query.filter_by(hotspotId = hotspotId).one()
6322 amar.kumar 247
 
6524 rajveer 248
def add_pincode(provider, pincode, destCode, exp, cod, stationType, otgAvailable):
7914 rajveer 249
    provider = Provider.query.filter_by(id = provider).one()
6322 amar.kumar 250
    serviceableLocationDetails = ServiceableLocationDetails()
251
    serviceableLocationDetails.provider = provider
252
    serviceableLocationDetails.dest_pincode = pincode
253
    serviceableLocationDetails.dest_code = destCode
254
    serviceableLocationDetails.exp = exp
255
    serviceableLocationDetails.cod = cod
256
    serviceableLocationDetails.station_type = stationType
6524 rajveer 257
    serviceableLocationDetails.otgAvailable = otgAvailable
7733 manish.sha 258
    if provider.id == 1:
7627 rajveer 259
        codlimit = 10000
260
        prepaidlimit = 50000
7733 manish.sha 261
    elif provider.id == 3:
7627 rajveer 262
        codlimit = 25000
263
        prepaidlimit = 100000
7733 manish.sha 264
    elif provider.id == 6:
7627 rajveer 265
        codlimit = 25000
266
        prepaidlimit = 100000
267
    serviceableLocationDetails.providerPrepaidLimit = prepaidlimit
268
    serviceableLocationDetails.providerCodLimit = codlimit
269
    serviceableLocationDetails.websiteCodLimit = codlimit
270
    serviceableLocationDetails.storeCodLimit = codlimit
6322 amar.kumar 271
    session.commit()
272
 
6524 rajveer 273
def update_pincode(providerId, pincode, exp, cod, otgAvailable):
6615 amar.kumar 274
    serviceableLocationDetails = ServiceableLocationDetails.get_by(provider_id = providerId, dest_pincode = pincode)
6322 amar.kumar 275
    serviceableLocationDetails.exp = exp
276
    serviceableLocationDetails.cod = cod
6524 rajveer 277
    serviceableLocationDetails.otgAvailable = otgAvailable
7256 rajveer 278
    session.commit()
7567 rajveer 279
 
13146 manish.sha 280
def add_new_awbs(provider_id, isCod, awbs, awbUsedFor):
7567 rajveer 281
    provider = get_provider(provider_id)
282
    if isCod:
283
        dtype = 'Cod'
284
    else:
285
        dtype = 'Prepaid'
286
    for awb in awbs:
287
        a = Awb()
288
        a.type =  dtype
289
        a.is_available = True
290
        a.awb_number = awb
13146 manish.sha 291
        a.awbUsedFor = awbUsedFor
7567 rajveer 292
        a.provider = provider 
293
    session.commit()
7608 rajveer 294
    return True
7256 rajveer 295
 
296
def adjust_delivery_time(start_time, delivery_days):
297
    '''
298
    Returns the actual no. of days which will pass while 'delivery_days'
299
    no. of business days will pass since 'order_time'. 
300
    '''
301
    start_date = start_time.date()
302
    end_date = start_date + datetime.timedelta(days = delivery_days)
7272 amit.gupta 303
    holidays = get_holidays(to_java_date(start_time), -1)
7256 rajveer 304
    holidays = [to_py_date(holiday).date() for holiday in holidays]
305
 
306
    while start_date <= end_date:
307
        if start_date.weekday() == 6 or start_date in holidays:
308
            delivery_days = delivery_days + 1
309
            end_date = end_date + datetime.timedelta(days = 1)
310
        start_date = start_date + datetime.timedelta(days = 1)
311
 
312
    return delivery_days
7275 rajveer 313
 
314
def get_min_advance_amount(itemId, destination_pin, providerId, codAllowed):
315
    client = CatalogClient().get_client()
316
    sp = client.getStorePricing(itemId)
317
 
318
    if codAllowed:
319
        return sp.minAdvancePrice, True
320
    else:
7857 rajveer 321
        dest_code, exp, iscod, otgAvailable, websiteCodLimit, storeCodLimit = serviceable_location_cache.get(providerId).get(destination_pin)
7275 rajveer 322
        if iscod:
323
            if providerId == 6:
7489 rajveer 324
                return max(sp.minAdvancePrice, sp.recommendedPrice - storeCodLimit), True
7275 rajveer 325
            if providerId == 3:
7489 rajveer 326
                return max(sp.minAdvancePrice, sp.recommendedPrice - storeCodLimit), True
7275 rajveer 327
            if providerId == 1:
7489 rajveer 328
                return max(sp.minAdvancePrice, sp.recommendedPrice - storeCodLimit), True
7275 rajveer 329
        else:
7425 rajveer 330
            return sp.recommendedPrice, False
7733 manish.sha 331
#Start:- Added by Manish Sharma for Multiple Pincode Updation on 05-Jul-2013
332
 
7786 manish.sha 333
def run_Logistics_Location_Info_Update(logisticsLocationInfoList, runCompleteUpdate):
334
    if runCompleteUpdate == True :
335
        serviceableLocationDetails = ServiceableLocationDetails.query.all()
336
        for serviceableLocationDetail in serviceableLocationDetails:
7841 manish.sha 337
            serviceableLocationDetail.exp = False
338
            serviceableLocationDetail.cod = False
7786 manish.sha 339
    for logisticsLocationInfo in logisticsLocationInfoList:
7841 manish.sha 340
        serviceableLocationDetail = ServiceableLocationDetails.get_by(provider_id = logisticsLocationInfo.providerId, dest_pincode = logisticsLocationInfo.pinCode)
7914 rajveer 341
        provider = Provider.query.filter_by(id = logisticsLocationInfo.providerId).one()
7841 manish.sha 342
        if serviceableLocationDetail:
343
            serviceableLocationDetail.exp = logisticsLocationInfo.expAvailable
344
            serviceableLocationDetail.cod = logisticsLocationInfo.codAvailable
345
            serviceableLocationDetail.otgAvailable = logisticsLocationInfo.otgAvailable
346
            serviceableLocationDetail.providerCodLimit = logisticsLocationInfo.codLimit
347
            serviceableLocationDetail.providerPrepaidLimit = logisticsLocationInfo.prepaidLimit
348
            serviceableLocationDetail.storeCodLimit = logisticsLocationInfo.codLimit
8219 manish.sha 349
            serviceableLocationDetail.websiteCodLimit = min(26000,logisticsLocationInfo.codLimit)
7841 manish.sha 350
        else:
351
            serviceableLocationDetail= ServiceableLocationDetails()
352
            serviceableLocationDetail.provider = provider
353
            serviceableLocationDetail.dest_pincode = logisticsLocationInfo.pinCode
354
            serviceableLocationDetail.dest_code = logisticsLocationInfo.destinationCode
355
            serviceableLocationDetail.exp = logisticsLocationInfo.expAvailable
356
            serviceableLocationDetail.cod = logisticsLocationInfo.codAvailable
357
            serviceableLocationDetail.station_type = 0
358
            serviceableLocationDetail.otgAvailable = logisticsLocationInfo.otgAvailable
359
            serviceableLocationDetail.providerCodLimit = logisticsLocationInfo.codLimit
360
            serviceableLocationDetail.providerPrepaidLimit = logisticsLocationInfo.prepaidLimit
361
            serviceableLocationDetail.storeCodLimit = logisticsLocationInfo.codLimit
8219 manish.sha 362
            serviceableLocationDetail.websiteCodLimit = min(26000,logisticsLocationInfo.codLimit)
7841 manish.sha 363
 
7870 rajveer 364
        deliveryEstimate = DeliveryEstimate.get_by(provider_id = logisticsLocationInfo.providerId, destination_pin = logisticsLocationInfo.pinCode, warehouse_location = logisticsLocationInfo.warehouseId) 
7841 manish.sha 365
        if deliveryEstimate:
366
            deliveryEstimate.warehouse_location= logisticsLocationInfo.warehouseId
367
            deliveryEstimate.delivery_time= logisticsLocationInfo.deliveryTime
368
            deliveryEstimate.delivery_delay= logisticsLocationInfo.delivery_delay
369
        else:
370
            deliveryEstimate = DeliveryEstimate()
371
            deliveryEstimate.destination_pin= logisticsLocationInfo.pinCode
372
            deliveryEstimate.provider = provider
373
            deliveryEstimate.warehouse_location= logisticsLocationInfo.warehouseId
374
            deliveryEstimate.delivery_time= logisticsLocationInfo.deliveryTime
375
            deliveryEstimate.delivery_delay= logisticsLocationInfo.delivery_delay
7733 manish.sha 376
    session.commit()
7786 manish.sha 377
 
7733 manish.sha 378
#End:- Added by Manish Sharma for Multiple Pincode Updation on 05-Jul-2013             
7275 rajveer 379
 
12895 manish.sha 380
def get_first_delivery_estimate_for_wh_location(pincode, whLocation):
381
    delEstimate = DeliveryEstimate.query.filter(DeliveryEstimate.destination_pin == pincode).filter(DeliveryEstimate.warehouse_location == whLocation).first()
382
    if delEstimate is None:
383
        return -1
384
    else:
385
        return 1
13146 manish.sha 386
 
387
def get_provider_limit_details_for_pincode(provider, pincode):
388
    serviceAbleDetails = ServiceableLocationDetails.get_by(provider_id = provider, dest_pincode = pincode)
389
    returnDataMap = {}
390
    if serviceAbleDetails:
391
        returnDataMap["websiteCodLimit"] = str(serviceAbleDetails.websiteCodLimit)
392
        returnDataMap["providerPrepaidLimit"] = str(serviceAbleDetails.providerPrepaidLimit)
393
 
394
    return returnDataMap
395
 
396
def get_new_empty_awb(providerId, type, orderQuantity):
397
    query = Awb.query.with_lockmode("update").filter_by(provider_id = providerId, is_available = True)  #check the provider thing
398
    if type == DeliveryType.PREPAID:
399
        query = query.filter_by(type="Prepaid")
400
    if type == DeliveryType.COD:
401
        query = query.filter_by(type="COD")
402
 
403
    additionalQuery = query
404
    if orderQuantity == 1:
405
        query = query.filter_by(awbUsedFor=0)
406
    if orderQuantity >1:
407
        query = query.filter_by(awbUsedFor=1) 
408
 
409
    try:
410
        awb = query.first()
411
        if awb is None:
412
            additionalQuery = additionalQuery.filter_by(awbUsedFor=2)
413
            awb = additionalQuery.first()
414
        awb.is_available = False
415
        session.commit()
416
        return awb.awb_number
417
    except:
418
        raise LogisticsServiceException(103, "Unable to get an AWB for the given Provider: " + str(providerId))
419