| Line 1155... |
Line 1155... |
| 1155 |
for order in orders:
|
1155 |
for order in orders:
|
| 1156 |
if not orderCountByItemIdSourceId.has_key(order.lineitems[0].item_id):
|
1156 |
if not orderCountByItemIdSourceId.has_key(order.lineitems[0].item_id):
|
| 1157 |
orderCountByItemIdSourceId[order.lineitems[0].item_id] = {}
|
1157 |
orderCountByItemIdSourceId[order.lineitems[0].item_id] = {}
|
| 1158 |
|
1158 |
|
| 1159 |
if orderCountByItemIdSourceId[order.lineitems[0].item_id].has_key(order.source):
|
1159 |
if orderCountByItemIdSourceId[order.lineitems[0].item_id].has_key(order.source):
|
| 1160 |
orderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = orderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] + 1
|
1160 |
orderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = orderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] + order.lineitems[0].quantity
|
| 1161 |
else:
|
1161 |
else:
|
| 1162 |
orderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = 1
|
1162 |
orderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = order.lineitems[0].quantity
|
| 1163 |
|
1163 |
|
| 1164 |
|
1164 |
|
| 1165 |
for order in rtoOrders:
|
1165 |
for order in rtoOrders:
|
| 1166 |
if not rtoOrderCountByItemIdSourceId.has_key(order.lineitems[0].item_id):
|
1166 |
if not rtoOrderCountByItemIdSourceId.has_key(order.lineitems[0].item_id):
|
| 1167 |
rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id] = {}
|
1167 |
rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id] = {}
|
| 1168 |
|
1168 |
|
| 1169 |
if rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id].has_key(order.source):
|
1169 |
if rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id].has_key(order.source):
|
| 1170 |
rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] + 1
|
1170 |
rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] + order.lineitems[0].quantity
|
| 1171 |
else:
|
1171 |
else:
|
| 1172 |
rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = 1
|
1172 |
rtoOrderCountByItemIdSourceId[order.lineitems[0].item_id][order.source] = order.lineitems[0].quantity
|
| 1173 |
|
1173 |
|
| 1174 |
|
1174 |
|
| 1175 |
for itemId, status in oosStatusMap.iteritems():
|
1175 |
for itemId, status in oosStatusMap.iteritems():
|
| 1176 |
total_order_count = 0
|
1176 |
total_order_count = 0
|
| 1177 |
total_rto_count = 0
|
1177 |
total_rto_count = 0
|
| Line 1183... |
Line 1183... |
| 1183 |
order_count = 0
|
1183 |
order_count = 0
|
| 1184 |
rto_count = 0
|
1184 |
rto_count = 0
|
| 1185 |
if orderCountByItemIdSourceId.has_key(itemId) and orderCountByItemIdSourceId[itemId].has_key(sid):
|
1185 |
if orderCountByItemIdSourceId.has_key(itemId) and orderCountByItemIdSourceId[itemId].has_key(sid):
|
| 1186 |
order_count = orderCountByItemIdSourceId[itemId][sid]
|
1186 |
order_count = orderCountByItemIdSourceId[itemId][sid]
|
| 1187 |
if rtoOrderCountByItemIdSourceId.has_key(itemId) and rtoOrderCountByItemIdSourceId[itemId].has_key(sid):
|
1187 |
if rtoOrderCountByItemIdSourceId.has_key(itemId) and rtoOrderCountByItemIdSourceId[itemId].has_key(sid):
|
| 1188 |
rto_count = rtoOrderCountByItemIdSourceId[itemId][sid]
|
1188 |
rto_count = rtoOrderCountByItemIdSourceId[itemId][sid]
|
| 1189 |
oosStatus.num_orders = order_count
|
1189 |
oosStatus.num_orders = order_count
|
| 1190 |
oosStatus.rto_orders = rto_count
|
1190 |
oosStatus.rto_orders = rto_count
|
| 1191 |
oosStatus.is_oos = status
|
1191 |
oosStatus.is_oos = status
|
| 1192 |
if oosStatus.is_oos and order_count > 0:
|
1192 |
if oosStatus.is_oos and order_count > 0:
|
| 1193 |
oosStatus.is_oos = False
|
1193 |
oosStatus.is_oos = False
|