| Line 214... |
Line 214... |
| 214 |
lastXdaysSale = lastXdaysSale[:-1]
|
214 |
lastXdaysSale = lastXdaysSale[:-1]
|
| 215 |
if oosStatus.rto_orders:
|
215 |
if oosStatus.rto_orders:
|
| 216 |
rtoCount = oosStatus.rto_orders
|
216 |
rtoCount = oosStatus.rto_orders
|
| 217 |
if numDaysInStock>0:
|
217 |
if numDaysInStock>0:
|
| 218 |
avgSales = float(salesCount)/float(numDaysInStock)
|
218 |
avgSales = float(salesCount)/float(numDaysInStock)
|
| 219 |
itemStockPurchaseParam = ItemStockPurchaseParams()
|
- |
|
| 220 |
itemStockPurchaseParam.minStockLevel = 0
|
219 |
itemStockPurchaseParam = None
|
| 221 |
itemStockPurchaseParam.numOfDaysStock = 0
|
- |
|
| 222 |
try:
|
220 |
try:
|
| 223 |
itemStockPurchaseParam = inventory_client.getItemStockPurchaseParams(key)
|
221 |
itemStockPurchaseParam = inventory_client.getItemStockPurchaseParams(key)
|
| 224 |
except Exception as e:
|
222 |
except Exception as e:
|
| 225 |
if errorsMap.has_key(key):
|
223 |
if errorsMap.has_key(key):
|
| 226 |
errorsMap[key] = errorsMap.get(key) + "| Item Stock Purchase Param Missing"
|
224 |
errorsMap[key] = errorsMap.get(key) + "| Item Stock Purchase Param Missing"
|
| 227 |
else:
|
225 |
else:
|
| 228 |
errorsMap[key] = "Item Stock Purchase Param Missing "
|
226 |
errorsMap[key] = "Item Stock Purchase Param Missing "
|
| 229 |
continue
|
227 |
continue
|
| 230 |
inventory_client.updateItemStockPurchaseParams(key, 0, 0)
|
228 |
inventory_client.updateItemStockPurchaseParams(key, 0, 0)
|
| 231 |
itemStockPurchaseParam = inventory_client.getItemStockPurchaseParams(key)
|
229 |
itemStockPurchaseParam = inventory_client.getItemStockPurchaseParams(key)
|
| - |
|
230 |
|
| - |
|
231 |
if itemStockPurchaseParam is None:
|
| - |
|
232 |
itemStockPurchaseParam = ItemStockPurchaseParams()
|
| - |
|
233 |
inventory_client.updateItemStockPurchaseParams(key, 0, 0)
|
| - |
|
234 |
itemStockPurchaseParam.minStockLevel = 0
|
| - |
|
235 |
itemStockPurchaseParam.numOfDaysStock = 0
|
| - |
|
236 |
itemStockPurchaseParam.item_id = key
|
| - |
|
237 |
|
| 232 |
advancedPOParameters[key] = [round(avgSales * itemStockPurchaseParam.numOfDaysStock), round(avgSales,2), numDaysInStock, itemStockPurchaseParam.minStockLevel, itemStockPurchaseParam.numOfDaysStock, lastXdaysSale, rtoCount]
|
238 |
advancedPOParameters[key] = [round(avgSales * itemStockPurchaseParam.numOfDaysStock), round(avgSales,2), numDaysInStock, itemStockPurchaseParam.minStockLevel, itemStockPurchaseParam.numOfDaysStock, lastXdaysSale, rtoCount]
|
| 233 |
|
239 |
|
| 234 |
cumulativeRequirementsItemIds = list(set(requirements.keys()+SKUListForPO))
|
240 |
cumulativeRequirementsItemIds = list(set(requirements.keys()+SKUListForPO))
|
| 235 |
netRequirements = {}
|
241 |
netRequirements = {}
|
| 236 |
for itemId in cumulativeRequirementsItemIds:
|
242 |
for itemId in cumulativeRequirementsItemIds:
|