| Line 32... |
Line 32... |
| 32 |
print "[ERROR] Unexpected config error:", sys.exc_info()[0]
|
32 |
print "[ERROR] Unexpected config error:", sys.exc_info()[0]
|
| 33 |
self.cutoff_time = 15
|
33 |
self.cutoff_time = 15
|
| 34 |
self.stock_threshold = 2
|
34 |
self.stock_threshold = 2
|
| 35 |
self.time_to_producre = 48
|
35 |
self.time_to_producre = 48
|
| 36 |
self.default_pincode = "110001"
|
36 |
self.default_pincode = "110001"
|
| - |
|
37 |
|
| - |
|
38 |
##FIXME
|
| - |
|
39 |
self.kanwaar_effected_pins_by_two_days = ['244713', '247667', '248001', '248002', '248003', '248005', '248006',
|
| - |
|
40 |
'248008', '248009', '248110', '248146', '248171', '248179', '249201',
|
| - |
|
41 |
'249401', '249403', '249404', '249407', '249408', '249409', '249410',
|
| - |
|
42 |
'249411', '262405', '263139', '263153']
|
| - |
|
43 |
self.kanwaar_effected_pins_by_one_day = ['201001', '201002', '201003', '201004', '201005', '201007', '201009',
|
| - |
|
44 |
'201010', '201011', '201012', '201014', '201204', '202001', '202002',
|
| - |
|
45 |
'203001', '203131', '204101']
|
| 37 |
|
46 |
|
| 38 |
def getProvider(self, providerId):
|
47 |
def getProvider(self, providerId):
|
| 39 |
"""
|
48 |
"""
|
| 40 |
Returns a provider for a given provider ID. Throws an exception if none found.
|
49 |
Returns a provider for a given provider ID. Throws an exception if none found.
|
| 41 |
|
50 |
|
| Line 143... |
Line 152... |
| 143 |
delivery_time = int(math.ceil(delivery_time/24.0))
|
152 |
delivery_time = int(math.ceil(delivery_time/24.0))
|
| 144 |
|
153 |
|
| 145 |
|
154 |
|
| 146 |
## FIXME Due to Kanwaar on the delhi Dehradun route deliveries on following pin codes will be effected.
|
155 |
## FIXME Due to Kanwaar on the delhi Dehradun route deliveries on following pin codes will be effected.
|
| 147 |
## Changing as per ticket number #462
|
156 |
## Changing as per ticket number #462
|
| 148 |
kanwaar_effected_pins_by_two_days = [244713, 247667, 248001, 248002, 248003, 248005, 248006, 248008, 248009, 248110, 248146,
|
- |
|
| 149 |
248171, 248179, 249201, 249401, 249403, 249404, 249407, 249408, 249409, 249410, 249411,
|
- |
|
| 150 |
262405, 263139, 263153]
|
- |
|
| 151 |
kanwaar_effected_pins_by_one_day = [201001, 201002, 201003, 201004, 201005, 201007, 201009, 201010,
|
- |
|
| 152 |
201011, 201012, 201014, 201204, 202001, 202002, 203001, 203131, 204101]
|
- |
|
| 153 |
if destination_pin in kanwaar_effected_pins_by_two_days:
|
157 |
if destination_pin in self.kanwaar_effected_pins_by_two_days:
|
| 154 |
delivery_time += 2;
|
158 |
delivery_time += 2;
|
| 155 |
elif destination_pin in kanwaar_effected_pins_by_one_day:
|
159 |
elif destination_pin in self.kanwaar_effected_pins_by_one_day:
|
| 156 |
delivery_time += 1;
|
160 |
delivery_time += 1;
|
| 157 |
## FIXME Remove the above code once Kanwaar season is over
|
161 |
## FIXME Remove the above code once Kanwaar season is over
|
| 158 |
|
162 |
|
| 159 |
logistics_info = LogisticsInfo()
|
163 |
logistics_info = LogisticsInfo()
|
| 160 |
logistics_info.deliveryTime = delivery_time
|
164 |
logistics_info.deliveryTime = delivery_time
|