| Line 1745... |
Line 1745... |
| 1745 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1745 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1746 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
1746 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
| 1747 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1747 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1748 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
1748 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
| 1749 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1749 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1750 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))),amScraping.proposedSp)
|
1750 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)),amScraping.proposedSp))
|
| 1751 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,amScraping.proposedSp))
|
1751 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,amScraping.proposedSp))
|
| 1752 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
1752 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
| 1753 |
sheet_iterator+=1
|
1753 |
sheet_iterator+=1
|
| 1754 |
|
1754 |
|
| 1755 |
almostCompetitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.ALMOST_COMPETE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
1755 |
almostCompetitiveItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.ALMOST_COMPETE).filter(AmazonScrapingHistory.timestamp==timestamp).all()
|
| Line 1835... |
Line 1835... |
| 1835 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1835 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1836 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
1836 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
| 1837 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1837 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1838 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
1838 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
| 1839 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1839 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1840 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))),amScraping.proposedSp)
|
1840 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)),amScraping.proposedSp))
|
| 1841 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,amScraping.proposedSp))
|
1841 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,amScraping.proposedSp))
|
| 1842 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
1842 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
| 1843 |
sheet_iterator+=1
|
1843 |
sheet_iterator+=1
|
| 1844 |
|
1844 |
|
| 1845 |
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()
|
1845 |
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()
|
| Line 1925... |
Line 1925... |
| 1925 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1925 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1926 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
1926 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
| 1927 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1927 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1928 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
1928 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
| 1929 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1929 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1930 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))),amScraping.proposedSp)
|
1930 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)),amScraping.proposedSp))
|
| 1931 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,amScraping.proposedSp))
|
1931 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,amScraping.proposedSp))
|
| 1932 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
1932 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
| 1933 |
sheet_iterator+=1
|
1933 |
sheet_iterator+=1
|
| - |
|
1934 |
|
| 1934 |
|
1935 |
|
| 1935 |
# sheet = wbk.add_sheet('Cheapest')
|
1936 |
# sheet = wbk.add_sheet('Cheapest')
|
| 1936 |
# xstr = lambda s: s or ""
|
1937 |
# xstr = lambda s: s or ""
|
| 1937 |
# heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1938 |
# heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| 1938 |
#
|
1939 |
#
|
| Line 2061... |
Line 2062... |
| 2061 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
2062 |
sheet.write(sheet_iterator, 45, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 2062 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
2063 |
sheet.write(sheet_iterator, 46, amScraping.reason)
|
| 2063 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
2064 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 2064 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
2065 |
sheet.write(sheet_iterator, 47, math.ceil(amScraping.proposedSp))
|
| 2065 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
2066 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 2066 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))),amScraping.proposedSp)
|
2067 |
sheet.write(sheet_iterator, 47, min(math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)),amScraping.proposedSp))
|
| 2067 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))))
|
2068 |
sheet.write(sheet_iterator, 48, getNewMargin(amScraping,math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice))))
|
| 2068 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
2069 |
sheet.write(sheet_iterator, 49, getInventoryMovementStatus(amScraping))
|
| 2069 |
sheet_iterator+=1
|
2070 |
sheet_iterator+=1
|
| 2070 |
|
2071 |
|
| 2071 |
exceptionCheapItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.EXCEPTION).filter(AmazonScrapingHistory.timestamp==timestamp)\
|
2072 |
exceptionCheapItems = session.query(AmazonScrapingHistory,Item).join((Item,AmazonScrapingHistory.item_id==Item.id)).filter(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.EXCEPTION).filter(AmazonScrapingHistory.timestamp==timestamp)\
|