| Line 1292... |
Line 1292... |
| 1292 |
return myCostToAmazon
|
1292 |
return myCostToAmazon
|
| 1293 |
|
1293 |
|
| 1294 |
def getInventoryMovementStatus(amScraping):
|
1294 |
def getInventoryMovementStatus(amScraping):
|
| 1295 |
try:
|
1295 |
try:
|
| 1296 |
nodStock = (float(amScraping.avgSale))/amScraping.ourInventory
|
1296 |
nodStock = (float(amScraping.avgSale))/amScraping.ourInventory
|
| - |
|
1297 |
except Exception as e:
|
| - |
|
1298 |
print "exception in nod stock"
|
| 1297 |
except:
|
1299 |
print e
|
| 1298 |
nodStock = float("inf")
|
1300 |
nodStock = float("inf")
|
| 1299 |
try:
|
1301 |
try:
|
| 1300 |
if amScraping.avgSale==0:
|
1302 |
if amScraping.avgSale==0:
|
| 1301 |
return "Not Moving"
|
1303 |
return "Not Moving"
|
| 1302 |
elif nodStock > 30:
|
1304 |
elif nodStock > 30:
|
| 1303 |
return "Slow Moving"
|
1305 |
return "Slow Moving"
|
| 1304 |
else:
|
1306 |
else:
|
| 1305 |
"Fast Moving"
|
1307 |
"Fast Moving"
|
| - |
|
1308 |
except Exception as e:
|
| 1306 |
except:
|
1309 |
print e
|
| - |
|
1310 |
print "exception in ims"
|
| 1307 |
return ""
|
1311 |
return ""
|
| 1308 |
|
1312 |
|
| 1309 |
def getMargin(amScraping):
|
1313 |
def getMargin(amScraping):
|
| 1310 |
#sheet.write(sheet_iterator, 30, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
1314 |
#sheet.write(sheet_iterator, 30, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
| 1311 |
#Promo Price minus costs plus subsidy
|
1315 |
#Promo Price minus costs plus subsidy
|
| Line 1452... |
Line 1456... |
| 1452 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1456 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1453 |
except:
|
1457 |
except:
|
| 1454 |
daysOfStock = float("inf")
|
1458 |
daysOfStock = float("inf")
|
| 1455 |
sheet.write(sheet_iterator, 39, daysOfStock)
|
1459 |
sheet.write(sheet_iterator, 39, daysOfStock)
|
| 1456 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
1460 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
| 1457 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1461 |
#sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1458 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1462 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
| 1459 |
sheet_iterator+=1
|
1463 |
sheet_iterator+=1
|
| 1460 |
#TODO : Take excell sheet generation code inside a function
|
1464 |
#TODO : Take excell sheet generation code inside a function
|
| 1461 |
competitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.COMPETITIVE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
1465 |
competitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.COMPETITIVE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
| 1462 |
for competitiveItem in competitiveItems:
|
1466 |
for competitiveItem in competitiveItems:
|