| Line 1251... |
Line 1251... |
| 1251 |
sheet.write(0, 27, "Lowest FBA", heading_xf)
|
1251 |
sheet.write(0, 27, "Lowest FBA", heading_xf)
|
| 1252 |
sheet.write(0, 28, "Competitive Price", heading_xf)
|
1252 |
sheet.write(0, 28, "Competitive Price", heading_xf)
|
| 1253 |
sheet.write(0, 29, "Other Cost", heading_xf)
|
1253 |
sheet.write(0, 29, "Other Cost", heading_xf)
|
| 1254 |
sheet.write(0, 30, "WANLC", heading_xf)
|
1254 |
sheet.write(0, 30, "WANLC", heading_xf)
|
| 1255 |
sheet.write(0, 31, "Subsidy", heading_xf)
|
1255 |
sheet.write(0, 31, "Subsidy", heading_xf)
|
| - |
|
1256 |
sheet.write(0, 32, "MAX SALE PRICE", heading_xf)
|
| 1256 |
sheet.write(0, 32, "Commission", heading_xf)
|
1257 |
sheet.write(0, 33, "Commission", heading_xf)
|
| 1257 |
sheet.write(0, 33, "Competitor Commission", heading_xf)
|
1258 |
sheet.write(0, 34, "Competitor Commission", heading_xf)
|
| 1258 |
sheet.write(0, 34, "Return Provision", heading_xf)
|
1259 |
sheet.write(0, 35, "Return Provision", heading_xf)
|
| 1259 |
sheet.write(0, 35, "Vat Rate", heading_xf)
|
1260 |
sheet.write(0, 36, "Vat Rate", heading_xf)
|
| 1260 |
sheet.write(0, 36, "Margin", heading_xf)
|
1261 |
sheet.write(0, 37, "Margin", heading_xf)
|
| 1261 |
sheet.write(0, 37, "Proposed Sp", heading_xf)
|
1262 |
sheet.write(0, 38, "Proposed Sp", heading_xf)
|
| 1262 |
sheet.write(0, 38, "Avg Sale", heading_xf)
|
1263 |
sheet.write(0, 39, "Avg Sale", heading_xf)
|
| 1263 |
sheet.write(0, 39, "NOD", heading_xf)
|
1264 |
sheet.write(0, 40, "NOD", heading_xf)
|
| 1264 |
sheet.write(0, 40, "Sales History", heading_xf)
|
1265 |
sheet.write(0, 41, "Sales History", heading_xf)
|
| 1265 |
sheet.write(0, 41, "Decision", heading_xf)
|
1266 |
sheet.write(0, 42, "Decision", heading_xf)
|
| 1266 |
sheet.write(0, 42, "Reason", heading_xf)
|
1267 |
sheet.write(0, 43, "Reason", heading_xf)
|
| 1267 |
sheet.write(0, 43, "Updated Price", heading_xf)
|
1268 |
sheet.write(0, 44, "Updated Price", heading_xf)
|
| 1268 |
sheet.write(0, 44, "Proposed Margin", heading_xf)
|
1269 |
sheet.write(0, 45, "Proposed Margin", heading_xf)
|
| 1269 |
sheet.write(0, 45, "Inventory Movement Status")
|
1270 |
sheet.write(0, 46, "Inventory Movement Status")
|
| 1270 |
|
1271 |
|
| 1271 |
def getPackagingCost(data):
|
1272 |
def getPackagingCost(data):
|
| 1272 |
#TODO : Get packagingCost from marketplaceitems table
|
1273 |
#TODO : Get packagingCost from marketplaceitems table
|
| 1273 |
return 15
|
1274 |
return 15
|
| 1274 |
|
1275 |
|
| Line 1291... |
Line 1292... |
| 1291 |
|
1292 |
|
| 1292 |
def getCostToAmazon(data):
|
1293 |
def getCostToAmazon(data):
|
| 1293 |
myCostToAmazon = round(data.promoPrice*data.commission/100*(1+getServiceTax(data)/100)+getCourierCost(data)*(1+getServiceTax(data)/100))
|
1294 |
myCostToAmazon = round(data.promoPrice*data.commission/100*(1+getServiceTax(data)/100)+getCourierCost(data)*(1+getServiceTax(data)/100))
|
| 1294 |
return myCostToAmazon
|
1295 |
return myCostToAmazon
|
| 1295 |
|
1296 |
|
| - |
|
1297 |
def getMsp(item_id,location):
|
| - |
|
1298 |
if location==1:
|
| - |
|
1299 |
sku='FBA'+str(item_id)
|
| - |
|
1300 |
elif location==2:
|
| - |
|
1301 |
sku='FBB'+str(item_id)
|
| - |
|
1302 |
else:
|
| - |
|
1303 |
return 0.0
|
| - |
|
1304 |
if amazonLongTermActivePromotions.has_key(sku):
|
| - |
|
1305 |
msp = (amazonLongTermActivePromotions.get(sku)).salePrice
|
| - |
|
1306 |
elif amazonShortTermActivePromotions.has_key(sku):
|
| - |
|
1307 |
msp = (amazonShortTermActivePromotions.get(sku)).salePrice
|
| - |
|
1308 |
else:
|
| - |
|
1309 |
msp = 0
|
| - |
|
1310 |
return msp
|
| - |
|
1311 |
|
| - |
|
1312 |
|
| 1296 |
def getInventoryMovementStatus(amScraping):
|
1313 |
def getInventoryMovementStatus(amScraping):
|
| 1297 |
try:
|
1314 |
try:
|
| 1298 |
nodStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1315 |
nodStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1299 |
except Exception as e:
|
1316 |
except Exception as e:
|
| 1300 |
print "exception in nod stock"
|
1317 |
print "exception in nod stock"
|
| Line 1445... |
Line 1462... |
| 1445 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
1462 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
| 1446 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
1463 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
| 1447 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
1464 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
| 1448 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
1465 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
| 1449 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
1466 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
| - |
|
1467 |
if amScraping.promotion:
|
| - |
|
1468 |
sheet.write(sheet_iterator, 32, getMsp(amScraping.item_id,amScraping.warehouseLocation))
|
| - |
|
1469 |
else:
|
| - |
|
1470 |
sheet.write(sheet_iterator, 32, 0.0)
|
| 1450 |
sheet.write(sheet_iterator, 32, amScraping.commission)
|
1471 |
sheet.write(sheet_iterator, 33, amScraping.commission)
|
| 1451 |
sheet.write(sheet_iterator, 33, amScraping.competitorCommission)
|
1472 |
sheet.write(sheet_iterator, 34, amScraping.competitorCommission)
|
| 1452 |
sheet.write(sheet_iterator, 34, amScraping.returnProvision)
|
1473 |
sheet.write(sheet_iterator, 35, amScraping.returnProvision)
|
| 1453 |
sheet.write(sheet_iterator, 35, amScraping.vatRate)
|
1474 |
sheet.write(sheet_iterator, 36, amScraping.vatRate)
|
| 1454 |
sheet.write(sheet_iterator, 36, getMargin(amScraping))
|
1475 |
sheet.write(sheet_iterator, 37, getMargin(amScraping))
|
| 1455 |
sheet.write(sheet_iterator, 37, amScraping.proposedSp)
|
1476 |
sheet.write(sheet_iterator, 38, amScraping.proposedSp)
|
| 1456 |
sheet.write(sheet_iterator, 38, amScraping.avgSale)
|
1477 |
sheet.write(sheet_iterator, 39, amScraping.avgSale)
|
| 1457 |
try:
|
1478 |
try:
|
| 1458 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1479 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1459 |
except:
|
1480 |
except:
|
| 1460 |
daysOfStock = float("inf")
|
1481 |
daysOfStock = float("inf")
|
| 1461 |
if str(daysOfStock)=='inf':
|
1482 |
if str(daysOfStock)=='inf':
|
| 1462 |
sheet.write(sheet_iterator, 39, str(daysOfStock))
|
1483 |
sheet.write(sheet_iterator, 40, str(daysOfStock))
|
| 1463 |
else:
|
1484 |
else:
|
| 1464 |
sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
|
1485 |
sheet.write(sheet_iterator, 40, str(round(daysOfStock,1)))
|
| 1465 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
1486 |
sheet.write(sheet_iterator, 41, getOosString(saleMap.get(sku)))
|
| 1466 |
#sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1487 |
#sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1467 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1488 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1468 |
sheet_iterator+=1
|
1489 |
sheet_iterator+=1
|
| 1469 |
#TODO : Take excell sheet generation code inside a function
|
1490 |
#TODO : Take excell sheet generation code inside a function
|
| 1470 |
competitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.COMPETITIVE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
1491 |
competitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.COMPETITIVE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
| 1471 |
for competitiveItem in competitiveItems:
|
1492 |
for competitiveItem in competitiveItems:
|
| 1472 |
amScraping = competitiveItem[0]
|
1493 |
amScraping = competitiveItem[0]
|
| Line 1513... |
Line 1534... |
| 1513 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
1534 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
| 1514 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
1535 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
| 1515 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
1536 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
| 1516 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
1537 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
| 1517 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
1538 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
| - |
|
1539 |
if amScraping.promotion:
|
| - |
|
1540 |
sheet.write(sheet_iterator, 32, getMsp(amScraping.item_id,amScraping.warehouseLocation))
|
| - |
|
1541 |
else:
|
| - |
|
1542 |
sheet.write(sheet_iterator, 32, 0.0)
|
| 1518 |
sheet.write(sheet_iterator, 32, amScraping.commission)
|
1543 |
sheet.write(sheet_iterator, 33, amScraping.commission)
|
| 1519 |
sheet.write(sheet_iterator, 33, amScraping.competitorCommission)
|
1544 |
sheet.write(sheet_iterator, 34, amScraping.competitorCommission)
|
| 1520 |
sheet.write(sheet_iterator, 34, amScraping.returnProvision)
|
1545 |
sheet.write(sheet_iterator, 35, amScraping.returnProvision)
|
| 1521 |
sheet.write(sheet_iterator, 35, amScraping.vatRate)
|
1546 |
sheet.write(sheet_iterator, 36, amScraping.vatRate)
|
| 1522 |
sheet.write(sheet_iterator, 36, getMargin(amScraping))
|
1547 |
sheet.write(sheet_iterator, 37, getMargin(amScraping))
|
| 1523 |
sheet.write(sheet_iterator, 37, amScraping.proposedSp)
|
1548 |
sheet.write(sheet_iterator, 38, amScraping.proposedSp)
|
| 1524 |
sheet.write(sheet_iterator, 38, amScraping.avgSale)
|
1549 |
sheet.write(sheet_iterator, 39, amScraping.avgSale)
|
| 1525 |
try:
|
1550 |
try:
|
| 1526 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1551 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1527 |
except:
|
1552 |
except:
|
| 1528 |
daysOfStock = float("inf")
|
1553 |
daysOfStock = float("inf")
|
| 1529 |
if str(daysOfStock)=='inf':
|
1554 |
if str(daysOfStock)=='inf':
|
| 1530 |
sheet.write(sheet_iterator, 39, str(daysOfStock))
|
1555 |
sheet.write(sheet_iterator, 40, str(daysOfStock))
|
| 1531 |
else:
|
1556 |
else:
|
| 1532 |
sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
|
1557 |
sheet.write(sheet_iterator, 40, str(round(daysOfStock,1)))
|
| 1533 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
1558 |
sheet.write(sheet_iterator, 41, getOosString(saleMap.get(sku)))
|
| 1534 |
if amScraping.decision is None:
|
1559 |
if amScraping.decision is None:
|
| 1535 |
sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
|
1560 |
sheet.write(sheet_iterator, 42, 'Auto Pricing Inactive')
|
| 1536 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1561 |
sheet.write(sheet_iterator, 45, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1537 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1562 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1538 |
sheet_iterator+=1
|
1563 |
sheet_iterator+=1
|
| 1539 |
continue
|
1564 |
continue
|
| 1540 |
sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1565 |
sheet.write(sheet_iterator, 42, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1541 |
sheet.write(sheet_iterator, 42, amScraping.reason)
|
1566 |
sheet.write(sheet_iterator, 43, amScraping.reason)
|
| 1542 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1567 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1543 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.proposedSp))
|
1568 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.proposedSp))
|
| 1544 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1569 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1545 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
1570 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1546 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1571 |
sheet.write(sheet_iterator, 45, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1547 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1572 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1548 |
sheet_iterator+=1
|
1573 |
sheet_iterator+=1
|
| 1549 |
|
1574 |
|
| 1550 |
almostCompetitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.ALMOST_COMPETE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
1575 |
almostCompetitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.ALMOST_COMPETE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
| 1551 |
for almostCompetitiveItem in almostCompetitiveItems:
|
1576 |
for almostCompetitiveItem in almostCompetitiveItems:
|
| 1552 |
amScraping = almostCompetitiveItem[0]
|
1577 |
amScraping = almostCompetitiveItem[0]
|
| Line 1593... |
Line 1618... |
| 1593 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
1618 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
| 1594 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
1619 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
| 1595 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
1620 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
| 1596 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
1621 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
| 1597 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
1622 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
| - |
|
1623 |
if amScraping.promotion:
|
| - |
|
1624 |
sheet.write(sheet_iterator, 32, getMsp(amScraping.item_id,amScraping.warehouseLocation))
|
| - |
|
1625 |
else:
|
| - |
|
1626 |
sheet.write(sheet_iterator, 32, 0.0)
|
| 1598 |
sheet.write(sheet_iterator, 32, amScraping.commission)
|
1627 |
sheet.write(sheet_iterator, 33, amScraping.commission)
|
| 1599 |
sheet.write(sheet_iterator, 33, amScraping.competitorCommission)
|
1628 |
sheet.write(sheet_iterator, 34, amScraping.competitorCommission)
|
| 1600 |
sheet.write(sheet_iterator, 34, amScraping.returnProvision)
|
1629 |
sheet.write(sheet_iterator, 35, amScraping.returnProvision)
|
| 1601 |
sheet.write(sheet_iterator, 35, amScraping.vatRate)
|
1630 |
sheet.write(sheet_iterator, 36, amScraping.vatRate)
|
| 1602 |
sheet.write(sheet_iterator, 36, getMargin(amScraping))
|
1631 |
sheet.write(sheet_iterator, 37, getMargin(amScraping))
|
| 1603 |
sheet.write(sheet_iterator, 37, amScraping.proposedSp)
|
1632 |
sheet.write(sheet_iterator, 38, amScraping.proposedSp)
|
| 1604 |
sheet.write(sheet_iterator, 38, amScraping.avgSale)
|
1633 |
sheet.write(sheet_iterator, 39, amScraping.avgSale)
|
| 1605 |
try:
|
1634 |
try:
|
| 1606 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1635 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1607 |
except:
|
1636 |
except:
|
| 1608 |
daysOfStock = float("inf")
|
1637 |
daysOfStock = float("inf")
|
| 1609 |
if str(daysOfStock)=='inf':
|
1638 |
if str(daysOfStock)=='inf':
|
| 1610 |
sheet.write(sheet_iterator, 39, str(daysOfStock))
|
1639 |
sheet.write(sheet_iterator, 40, str(daysOfStock))
|
| 1611 |
else:
|
1640 |
else:
|
| 1612 |
sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
|
1641 |
sheet.write(sheet_iterator, 40, str(round(daysOfStock,1)))
|
| 1613 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
1642 |
sheet.write(sheet_iterator, 41, getOosString(saleMap.get(sku)))
|
| 1614 |
if amScraping.decision is None:
|
1643 |
if amScraping.decision is None:
|
| 1615 |
sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
|
1644 |
sheet.write(sheet_iterator, 42, 'Auto Pricing Inactive')
|
| 1616 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1645 |
sheet.write(sheet_iterator, 45, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1617 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1646 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1618 |
sheet_iterator+=1
|
1647 |
sheet_iterator+=1
|
| 1619 |
continue
|
1648 |
continue
|
| 1620 |
sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1649 |
sheet.write(sheet_iterator, 42, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1621 |
sheet.write(sheet_iterator, 42, amScraping.reason)
|
1650 |
sheet.write(sheet_iterator, 43, amScraping.reason)
|
| 1622 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1651 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1623 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.proposedSp))
|
1652 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.proposedSp))
|
| 1624 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1653 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1625 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
1654 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1626 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1655 |
sheet.write(sheet_iterator, 45, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1627 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1656 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1628 |
sheet_iterator+=1
|
1657 |
sheet_iterator+=1
|
| 1629 |
|
1658 |
|
| 1630 |
amongCheapestItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.AMONG_CHEAPEST_CAN_COMPETE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
1659 |
amongCheapestItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.AMONG_CHEAPEST_CAN_COMPETE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
| 1631 |
for amongCheapestItem in amongCheapestItems:
|
1660 |
for amongCheapestItem in amongCheapestItems:
|
| 1632 |
amScraping = amongCheapestItem[0]
|
1661 |
amScraping = amongCheapestItem[0]
|
| Line 1673... |
Line 1702... |
| 1673 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
1702 |
sheet.write(sheet_iterator, 27, amScraping.lowestFbaOffer)
|
| 1674 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
1703 |
sheet.write(sheet_iterator, 28, amScraping.competitivePrice)
|
| 1675 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
1704 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
| 1676 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
1705 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
| 1677 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
1706 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
| - |
|
1707 |
if amScraping.promotion:
|
| - |
|
1708 |
sheet.write(sheet_iterator, 32, getMsp(amScraping.item_id,amScraping.warehouseLocation))
|
| - |
|
1709 |
else:
|
| - |
|
1710 |
sheet.write(sheet_iterator, 32, 0.0)
|
| 1678 |
sheet.write(sheet_iterator, 32, amScraping.commission)
|
1711 |
sheet.write(sheet_iterator, 33, amScraping.commission)
|
| 1679 |
sheet.write(sheet_iterator, 33, amScraping.competitorCommission)
|
1712 |
sheet.write(sheet_iterator, 34, amScraping.competitorCommission)
|
| 1680 |
sheet.write(sheet_iterator, 34, amScraping.returnProvision)
|
1713 |
sheet.write(sheet_iterator, 35, amScraping.returnProvision)
|
| 1681 |
sheet.write(sheet_iterator, 35, amScraping.vatRate)
|
1714 |
sheet.write(sheet_iterator, 36, amScraping.vatRate)
|
| 1682 |
sheet.write(sheet_iterator, 36, getMargin(amScraping))
|
1715 |
sheet.write(sheet_iterator, 37, getMargin(amScraping))
|
| 1683 |
sheet.write(sheet_iterator, 37, amScraping.proposedSp)
|
1716 |
sheet.write(sheet_iterator, 38, amScraping.proposedSp)
|
| 1684 |
sheet.write(sheet_iterator, 38, amScraping.avgSale)
|
1717 |
sheet.write(sheet_iterator, 39, amScraping.avgSale)
|
| 1685 |
try:
|
1718 |
try:
|
| 1686 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1719 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1687 |
except:
|
1720 |
except:
|
| 1688 |
daysOfStock = float("inf")
|
1721 |
daysOfStock = float("inf")
|
| 1689 |
if str(daysOfStock)=='inf':
|
1722 |
if str(daysOfStock)=='inf':
|
| 1690 |
sheet.write(sheet_iterator, 39, str(daysOfStock))
|
1723 |
sheet.write(sheet_iterator, 40, str(daysOfStock))
|
| 1691 |
else:
|
1724 |
else:
|
| 1692 |
sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
|
1725 |
sheet.write(sheet_iterator, 40, str(round(daysOfStock,1)))
|
| 1693 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
1726 |
sheet.write(sheet_iterator, 41, getOosString(saleMap.get(sku)))
|
| 1694 |
if amScraping.decision is None:
|
1727 |
if amScraping.decision is None:
|
| 1695 |
sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
|
1728 |
sheet.write(sheet_iterator, 42, 'Auto Pricing Inactive')
|
| 1696 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1729 |
sheet.write(sheet_iterator, 45, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1697 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1730 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1698 |
sheet_iterator+=1
|
1731 |
sheet_iterator+=1
|
| 1699 |
continue
|
1732 |
continue
|
| 1700 |
sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1733 |
sheet.write(sheet_iterator, 42, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1701 |
sheet.write(sheet_iterator, 42, amScraping.reason)
|
1734 |
sheet.write(sheet_iterator, 43, amScraping.reason)
|
| 1702 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1735 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1703 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.proposedSp))
|
1736 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.proposedSp))
|
| 1704 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1737 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1705 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
1738 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1706 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1739 |
sheet.write(sheet_iterator, 45, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1707 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1740 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1708 |
sheet_iterator+=1
|
1741 |
sheet_iterator+=1
|
| 1709 |
|
1742 |
|
| 1710 |
# sheet = wbk.add_sheet('Cheapest')
|
1743 |
# sheet = wbk.add_sheet('Cheapest')
|
| 1711 |
# xstr = lambda s: s or ""
|
1744 |
# xstr = lambda s: s or ""
|
| 1712 |
# heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1745 |
# heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| Line 1799... |
Line 1832... |
| 1799 |
sheet.write(sheet_iterator, 27, '')
|
1832 |
sheet.write(sheet_iterator, 27, '')
|
| 1800 |
sheet.write(sheet_iterator, 28, '')
|
1833 |
sheet.write(sheet_iterator, 28, '')
|
| 1801 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
1834 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
| 1802 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
1835 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
| 1803 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
1836 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
| - |
|
1837 |
if amScraping.promotion:
|
| - |
|
1838 |
sheet.write(sheet_iterator, 32, getMsp(amScraping.item_id,amScraping.warehouseLocation))
|
| - |
|
1839 |
else:
|
| - |
|
1840 |
sheet.write(sheet_iterator, 32, 0.0)
|
| 1804 |
sheet.write(sheet_iterator, 32, amScraping.commission)
|
1841 |
sheet.write(sheet_iterator, 33, amScraping.commission)
|
| 1805 |
sheet.write(sheet_iterator, 33, amScraping.competitorCommission)
|
1842 |
sheet.write(sheet_iterator, 34, amScraping.competitorCommission)
|
| 1806 |
sheet.write(sheet_iterator, 34, amScraping.returnProvision)
|
1843 |
sheet.write(sheet_iterator, 35, amScraping.returnProvision)
|
| 1807 |
sheet.write(sheet_iterator, 35, amScraping.vatRate)
|
1844 |
sheet.write(sheet_iterator, 36, amScraping.vatRate)
|
| 1808 |
sheet.write(sheet_iterator, 36, getMargin(amScraping))
|
1845 |
sheet.write(sheet_iterator, 37, getMargin(amScraping))
|
| 1809 |
sheet.write(sheet_iterator, 37, amScraping.proposedSp)
|
1846 |
sheet.write(sheet_iterator, 38, amScraping.proposedSp)
|
| 1810 |
sheet.write(sheet_iterator, 38, amScraping.avgSale)
|
1847 |
sheet.write(sheet_iterator, 39, amScraping.avgSale)
|
| 1811 |
try:
|
1848 |
try:
|
| 1812 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1849 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1813 |
except:
|
1850 |
except:
|
| 1814 |
daysOfStock = float("inf")
|
1851 |
daysOfStock = float("inf")
|
| 1815 |
if str(daysOfStock)=='inf':
|
1852 |
if str(daysOfStock)=='inf':
|
| 1816 |
sheet.write(sheet_iterator, 39, str(daysOfStock))
|
1853 |
sheet.write(sheet_iterator, 40, str(daysOfStock))
|
| 1817 |
else:
|
1854 |
else:
|
| 1818 |
sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
|
1855 |
sheet.write(sheet_iterator, 40, str(round(daysOfStock,1)))
|
| 1819 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
1856 |
sheet.write(sheet_iterator, 41, getOosString(saleMap.get(sku)))
|
| 1820 |
if amScraping.decision is None:
|
1857 |
if amScraping.decision is None:
|
| 1821 |
sheet.write(sheet_iterator, 41, 'Auto Pricing Inactive')
|
1858 |
sheet.write(sheet_iterator, 42, 'Auto Pricing Inactive')
|
| 1822 |
sheet.write(sheet_iterator, 44, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
1859 |
sheet.write(sheet_iterator, 45, round(amScraping.proposedSp - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,amScraping.proposedSp))))
|
| 1823 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1860 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1824 |
sheet_iterator+=1
|
1861 |
sheet_iterator+=1
|
| 1825 |
continue
|
1862 |
continue
|
| 1826 |
sheet.write(sheet_iterator, 41, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1863 |
sheet.write(sheet_iterator, 42, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1827 |
sheet.write(sheet_iterator, 42, amScraping.reason)
|
1864 |
sheet.write(sheet_iterator, 43, amScraping.reason)
|
| 1828 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1865 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1829 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.proposedSp))
|
1866 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.proposedSp))
|
| 1830 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1867 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1831 |
sheet.write(sheet_iterator, 43, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
1868 |
sheet.write(sheet_iterator, 44, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1832 |
sheet.write(sheet_iterator, 44, round(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)) - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))))))
|
1869 |
sheet.write(sheet_iterator, 45, round(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)) - getNewLowestPossibleSp(amScraping,12.36,getNewVatRate(amScraping.item_id,amScraping.warehouseLocation,math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))))))
|
| 1833 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1870 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1834 |
sheet_iterator+=1
|
1871 |
sheet_iterator+=1
|
| 1835 |
|
1872 |
|
| 1836 |
# sheet = wbk.add_sheet('Negative Margin')
|
1873 |
# sheet = wbk.add_sheet('Negative Margin')
|
| 1837 |
# xstr = lambda s: s or ""
|
1874 |
# xstr = lambda s: s or ""
|
| 1838 |
# heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1875 |
# heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| Line 1922... |
Line 1959... |
| 1922 |
sheet.write(sheet_iterator, 27, '')
|
1959 |
sheet.write(sheet_iterator, 27, '')
|
| 1923 |
sheet.write(sheet_iterator, 28, '')
|
1960 |
sheet.write(sheet_iterator, 28, '')
|
| 1924 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
1961 |
sheet.write(sheet_iterator, 29, amScraping.otherCost)
|
| 1925 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
1962 |
sheet.write(sheet_iterator, 30, amScraping.wanlc)
|
| 1926 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
1963 |
sheet.write(sheet_iterator, 31, amScraping.subsidy)
|
| - |
|
1964 |
if amScraping.promotion:
|
| - |
|
1965 |
sheet.write(sheet_iterator, 32, getMsp(amScraping.item_id,amScraping.warehouseLocation))
|
| - |
|
1966 |
else:
|
| - |
|
1967 |
sheet.write(sheet_iterator, 32, 0.0)
|
| 1927 |
sheet.write(sheet_iterator, 32, amScraping.commission)
|
1968 |
sheet.write(sheet_iterator, 33, amScraping.commission)
|
| 1928 |
sheet.write(sheet_iterator, 33, amScraping.competitorCommission)
|
1969 |
sheet.write(sheet_iterator, 34, amScraping.competitorCommission)
|
| 1929 |
sheet.write(sheet_iterator, 34, amScraping.returnProvision)
|
1970 |
sheet.write(sheet_iterator, 35, amScraping.returnProvision)
|
| 1930 |
sheet.write(sheet_iterator, 35, amScraping.vatRate)
|
1971 |
sheet.write(sheet_iterator, 36, amScraping.vatRate)
|
| 1931 |
sheet.write(sheet_iterator, 36, getMargin(amScraping))
|
1972 |
sheet.write(sheet_iterator, 37, getMargin(amScraping))
|
| 1932 |
sheet.write(sheet_iterator, 38, amScraping.avgSale)
|
1973 |
sheet.write(sheet_iterator, 39, amScraping.avgSale)
|
| 1933 |
try:
|
1974 |
try:
|
| 1934 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
1975 |
daysOfStock = (float(amScraping.ourInventory))/amScraping.avgSale
|
| 1935 |
except:
|
1976 |
except:
|
| 1936 |
daysOfStock = float("inf")
|
1977 |
daysOfStock = float("inf")
|
| 1937 |
if str(daysOfStock)=='inf':
|
1978 |
if str(daysOfStock)=='inf':
|
| 1938 |
sheet.write(sheet_iterator, 39, str(daysOfStock))
|
1979 |
sheet.write(sheet_iterator, 40, str(daysOfStock))
|
| 1939 |
else:
|
1980 |
else:
|
| 1940 |
sheet.write(sheet_iterator, 39, str(round(daysOfStock,1)))
|
1981 |
sheet.write(sheet_iterator, 40, str(round(daysOfStock,1)))
|
| 1941 |
sheet.write(sheet_iterator, 40, getOosString(saleMap.get(sku)))
|
1982 |
sheet.write(sheet_iterator, 41, getOosString(saleMap.get(sku)))
|
| 1942 |
sheet.write(sheet_iterator, 45, getInventoryMovementStatus(amScraping))
|
1983 |
sheet.write(sheet_iterator, 46, getInventoryMovementStatus(amScraping))
|
| 1943 |
sheet_iterator+=1
|
1984 |
sheet_iterator+=1
|
| 1944 |
|
1985 |
|
| 1945 |
sheet = wbk.add_sheet('Exception List')
|
1986 |
sheet = wbk.add_sheet('Exception List')
|
| 1946 |
xstr = lambda s: s or ""
|
1987 |
xstr = lambda s: s or ""
|
| 1947 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1988 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| Line 2021... |
Line 2062... |
| 2021 |
sheet_iterator+=1
|
2062 |
sheet_iterator+=1
|
| 2022 |
|
2063 |
|
| 2023 |
filename = "/tmp/amazon-report-"+runType+" " + str(timestamp) + ".xls"
|
2064 |
filename = "/tmp/amazon-report-"+runType+" " + str(timestamp) + ".xls"
|
| 2024 |
wbk.save(filename)
|
2065 |
wbk.save(filename)
|
| 2025 |
try:
|
2066 |
try:
|
| 2026 |
EmailAttachmentSender.mail("build@shop2020.in", "cafe@nes", ["kshitij.sood@saholic.com"], " Amazon Auto Pricing "+runType+" " + str(timestamp), "", [get_attachment_part(filename)], [""], [])
|
2067 |
#EmailAttachmentSender.mail("build@shop2020.in", "cafe@nes", ["kshitij.sood@saholic.com"], " Amazon Auto Pricing "+runType+" " + str(timestamp), "", [get_attachment_part(filename)], [""], [])
|
| 2027 |
#EmailAttachmentSender.mail("build@shop2020.in", "cafe@nes", ["chandan.kumar@saholic.com","manoj.kumar@saholic.com","yukti.jain@saholic.com","ankush.dhingra@saholic.com","manoj.pal@saholic.com"], " Amazon Auto Pricing "+runType+" " + str(timestamp), "", [get_attachment_part(filename)], ["rajneesh.arora@saholic.com","anikendra.das@saholic.com","amit.gupta@saholic.com","kshitij.sood@saholic.com","chaitnaya.vats@saholic.com","khushal.bhatia@saholic.com"], [])
|
2068 |
EmailAttachmentSender.mail("build@shop2020.in", "cafe@nes", ["chandan.kumar@saholic.com","manoj.kumar@saholic.com","yukti.jain@saholic.com","ankush.dhingra@saholic.com","manoj.pal@saholic.com"], " Amazon Auto Pricing "+runType+" " + str(timestamp), "", [get_attachment_part(filename)], ["rajneesh.arora@saholic.com","anikendra.das@saholic.com","amit.gupta@saholic.com","kshitij.sood@saholic.com","chaitnaya.vats@saholic.com","khushal.bhatia@saholic.com"], [])
|
| 2028 |
except Exception as e:
|
2069 |
except Exception as e:
|
| 2029 |
print e
|
2070 |
print e
|
| 2030 |
print "Unable to send report.Trying with local SMTP"
|
2071 |
print "Unable to send report.Trying with local SMTP"
|
| 2031 |
smtpServer = smtplib.SMTP('localhost')
|
2072 |
smtpServer = smtplib.SMTP('localhost')
|
| 2032 |
smtpServer.set_debuglevel(1)
|
2073 |
smtpServer.set_debuglevel(1)
|
| 2033 |
sender = 'build@shop2020.in'
|
2074 |
sender = 'build@shop2020.in'
|
| 2034 |
recipients = ["kshitij.sood@saholic.com"]
|
2075 |
#recipients = ["kshitij.sood@saholic.com"]
|
| 2035 |
msg = MIMEMultipart()
|
2076 |
msg = MIMEMultipart()
|
| 2036 |
msg['Subject'] = "Amazon Auto Pricing" + ' '+runType+' - ' + str(datetime.now())
|
2077 |
msg['Subject'] = "Amazon Auto Pricing" + ' '+runType+' - ' + str(datetime.now())
|
| 2037 |
msg['From'] = sender
|
2078 |
msg['From'] = sender
|
| 2038 |
#recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','amit.gupta@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
2079 |
recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','amit.gupta@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
| 2039 |
msg['To'] = ",".join(recipients)
|
2080 |
msg['To'] = ",".join(recipients)
|
| 2040 |
fileMsg = email.mime.base.MIMEBase('application','vnd.ms-excel')
|
2081 |
fileMsg = email.mime.base.MIMEBase('application','vnd.ms-excel')
|
| 2041 |
fileMsg.set_payload(file(filename).read())
|
2082 |
fileMsg.set_payload(file(filename).read())
|
| 2042 |
email.encoders.encode_base64(fileMsg)
|
2083 |
email.encoders.encode_base64(fileMsg)
|
| 2043 |
fileMsg.add_header('Content-Disposition','attachment;filename=amazon-auto-pricing.xls')
|
2084 |
fileMsg.add_header('Content-Disposition','attachment;filename=amazon-auto-pricing.xls')
|
| Line 2175... |
Line 2216... |
| 2175 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
2216 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
| 2176 |
mailServer.ehlo()
|
2217 |
mailServer.ehlo()
|
| 2177 |
mailServer.starttls()
|
2218 |
mailServer.starttls()
|
| 2178 |
mailServer.ehlo()
|
2219 |
mailServer.ehlo()
|
| 2179 |
|
2220 |
|
| 2180 |
recipients = ['kshitij.sood@saholic.com']
|
2221 |
#recipients = ['kshitij.sood@saholic.com']
|
| 2181 |
#recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','vikram.raghav@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
2222 |
recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','vikram.raghav@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
| 2182 |
msg = MIMEMultipart()
|
2223 |
msg = MIMEMultipart()
|
| 2183 |
msg['Subject'] = "Amazon Auto Pricing" + ' - ' + str(datetime.now())
|
2224 |
msg['Subject'] = "Amazon Auto Pricing" + ' - ' + str(datetime.now())
|
| 2184 |
msg['From'] = ""
|
2225 |
msg['From'] = ""
|
| 2185 |
msg['To'] = ",".join(recipients)
|
2226 |
msg['To'] = ",".join(recipients)
|
| 2186 |
msg.preamble = "Amazon Auto Pricing" + ' - ' + str(datetime.now())
|
2227 |
msg.preamble = "Amazon Auto Pricing" + ' - ' + str(datetime.now())
|
| Line 2265... |
Line 2306... |
| 2265 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
2306 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
| 2266 |
mailServer.ehlo()
|
2307 |
mailServer.ehlo()
|
| 2267 |
mailServer.starttls()
|
2308 |
mailServer.starttls()
|
| 2268 |
mailServer.ehlo()
|
2309 |
mailServer.ehlo()
|
| 2269 |
|
2310 |
|
| 2270 |
recipients = ['kshitij.sood@saholic.com']
|
2311 |
#recipients = ['kshitij.sood@saholic.com']
|
| 2271 |
#recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','vikram.raghav@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
2312 |
recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','vikram.raghav@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
| 2272 |
msg = MIMEMultipart()
|
2313 |
msg = MIMEMultipart()
|
| 2273 |
msg['Subject'] = "Amazon Negative Margin" + ' - ' + str(datetime.now())
|
2314 |
msg['Subject'] = "Amazon Negative Margin" + ' - ' + str(datetime.now())
|
| 2274 |
msg['From'] = ""
|
2315 |
msg['From'] = ""
|
| 2275 |
msg['To'] = ",".join(recipients)
|
2316 |
msg['To'] = ",".join(recipients)
|
| 2276 |
msg.preamble = "Amazon Negative Margin" + ' - ' + str(datetime.now())
|
2317 |
msg.preamble = "Amazon Negative Margin" + ' - ' + str(datetime.now())
|
| Line 2355... |
Line 2396... |
| 2355 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
2396 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
| 2356 |
mailServer.ehlo()
|
2397 |
mailServer.ehlo()
|
| 2357 |
mailServer.starttls()
|
2398 |
mailServer.starttls()
|
| 2358 |
mailServer.ehlo()
|
2399 |
mailServer.ehlo()
|
| 2359 |
|
2400 |
|
| 2360 |
recipients = ['kshitij.sood@saholic.com']
|
2401 |
#recipients = ['kshitij.sood@saholic.com']
|
| 2361 |
#recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','vikram.raghav@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
2402 |
recipients = ['rajneesh.arora@saholic.com','anikendra.das@saholic.com','vikram.raghav@saholic.com','kshitij.sood@saholic.com','khushal.bhatia@saholic.com','chaitnaya.vats@saholic.com','chandan.kumar@saholic.com','manoj.kumar@saholic.com','yukti.jain@saholic.com','ankush.dhingra@saholic.com','manoj.pal@saholic.com']
|
| 2362 |
msg = MIMEMultipart()
|
2403 |
msg = MIMEMultipart()
|
| 2363 |
msg['Subject'] = "Amazon Cant Compete Items" + ' - ' + str(datetime.now())
|
2404 |
msg['Subject'] = "Amazon Cant Compete Items" + ' - ' + str(datetime.now())
|
| 2364 |
msg['From'] = ""
|
2405 |
msg['From'] = ""
|
| 2365 |
msg['To'] = ",".join(recipients)
|
2406 |
msg['To'] = ",".join(recipients)
|
| 2366 |
msg.preamble = "Amazon Cant Compete Items" + ' - ' + str(datetime.now())
|
2407 |
msg.preamble = "Amazon Cant Compete Items" + ' - ' + str(datetime.now())
|