| Line 115... |
Line 115... |
| 115 |
markReasonForItem(autoDecrementItem,'Item in short term promotion',Decision.AUTO_DECREMENT_FAILED)
|
115 |
markReasonForItem(autoDecrementItem,'Item in short term promotion',Decision.AUTO_DECREMENT_FAILED)
|
| 116 |
continue
|
116 |
continue
|
| 117 |
if math.ceil(autoDecrementItem.proposedSp) >= autoDecrementItem.ourSellingPrice:
|
117 |
if math.ceil(autoDecrementItem.proposedSp) >= autoDecrementItem.ourSellingPrice:
|
| 118 |
markReasonForItem(autoDecrementItem,'Proposed SP greater than or equal to current SP',Decision.AUTO_DECREMENT_FAILED)
|
118 |
markReasonForItem(autoDecrementItem,'Proposed SP greater than or equal to current SP',Decision.AUTO_DECREMENT_FAILED)
|
| 119 |
continue
|
119 |
continue
|
| 120 |
if autoDecrementItem.proposedSellingPrice < autoDecrementItem.lowestPossibleSp:
|
120 |
if autoDecrementItem.proposedSp < autoDecrementItem.lowestPossibleSp:
|
| 121 |
markReasonForItem(autoDecrementItem,'Proposed SP less than lowest possible SP',Decision.AUTO_DECREMENT_FAILED)
|
121 |
markReasonForItem(autoDecrementItem,'Proposed SP less than lowest possible SP',Decision.AUTO_DECREMENT_FAILED)
|
| 122 |
continue
|
122 |
continue
|
| 123 |
try:
|
123 |
try:
|
| 124 |
daysOfStock = (float(autoDecrementItem.ourInventory))/autoDecrementItem.avgSale
|
124 |
daysOfStock = (float(autoDecrementItem.ourInventory))/autoDecrementItem.avgSale
|
| 125 |
except:
|
125 |
except:
|
| Line 178... |
Line 178... |
| 178 |
markReasonForItem(autoIncrementItem,'We are the only seller',Decision.AUTO_INCREMENT_FAILED)
|
178 |
markReasonForItem(autoIncrementItem,'We are the only seller',Decision.AUTO_INCREMENT_FAILED)
|
| 179 |
continue
|
179 |
continue
|
| 180 |
if autoIncrementItem.proposedSp <= autoIncrementItem.ourSellingPrice:
|
180 |
if autoIncrementItem.proposedSp <= autoIncrementItem.ourSellingPrice:
|
| 181 |
markReasonForItem(autoIncrementItem,'Proposed SP less than current SP',Decision.AUTO_INCREMENT_FAILED)
|
181 |
markReasonForItem(autoIncrementItem,'Proposed SP less than current SP',Decision.AUTO_INCREMENT_FAILED)
|
| 182 |
continue
|
182 |
continue
|
| 183 |
if autoIncrementItem.proposedSellingPrice >=10000 and autoIncrementItem.ourSellingPrice<10000:
|
183 |
if autoIncrementItem.proposedSp >=10000 and autoIncrementItem.ourSellingPrice<10000:
|
| 184 |
markReasonForItem(autoIncrementItem,'Proposed SP is greater than 10,000 and current sp is less than 10,000',Decision.AUTO_INCREMENT_FAILED)
|
184 |
markReasonForItem(autoIncrementItem,'Proposed SP is greater than 10,000 and current sp is less than 10,000',Decision.AUTO_INCREMENT_FAILED)
|
| 185 |
continue
|
185 |
continue
|
| 186 |
|
186 |
|
| 187 |
if autoIncrementItem.isPromotion and math.ceil(autoIncrementItem.promoPrice+max(10,.01*autoIncrementItem.promoPrice)) > (amazonLongTermActivePromotions.get(sku)).promoPrice:
|
187 |
if autoIncrementItem.isPromotion and (math.ceil(autoIncrementItem.promoPrice+max(10,.01*autoIncrementItem.promoPrice)) > (amazonLongTermActivePromotions.get(sku)).promoPrice):
|
| 188 |
markReasonForItem(autoIncrementItem,'Proposed SP cant be greater than promo price',Decision.AUTO_INCREMENT_FAILED)
|
188 |
markReasonForItem(autoIncrementItem,'Proposed SP cant be greater than promo price',Decision.AUTO_INCREMENT_FAILED)
|
| 189 |
continue
|
189 |
continue
|
| 190 |
|
190 |
|
| 191 |
|
191 |
|
| 192 |
if autoIncrementItem.avgSale==0:
|
192 |
if autoIncrementItem.avgSale==0:
|
| Line 1057... |
Line 1057... |
| 1057 |
sheet_iterator+=1
|
1057 |
sheet_iterator+=1
|
| 1058 |
continue
|
1058 |
continue
|
| 1059 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1059 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1060 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1060 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1061 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1061 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1062 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSellingPrice))
|
1062 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1063 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1063 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1064 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1064 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
| 1065 |
sheet_iterator+=1
|
1065 |
sheet_iterator+=1
|
| 1066 |
|
1066 |
|
| 1067 |
sheet = wbk.add_sheet('Competitive')
|
1067 |
sheet = wbk.add_sheet('Competitive')
|
| Line 1164... |
Line 1164... |
| 1164 |
sheet_iterator+=1
|
1164 |
sheet_iterator+=1
|
| 1165 |
continue
|
1165 |
continue
|
| 1166 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1166 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1167 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1167 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1168 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1168 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1169 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSellingPrice))
|
1169 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1170 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1170 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1171 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1171 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
| 1172 |
sheet_iterator+=1
|
1172 |
sheet_iterator+=1
|
| 1173 |
|
1173 |
|
| 1174 |
sheet = wbk.add_sheet('Almost Competitive')
|
1174 |
sheet = wbk.add_sheet('Almost Competitive')
|
| Line 1280... |
Line 1280... |
| 1280 |
sheet_iterator+=1
|
1280 |
sheet_iterator+=1
|
| 1281 |
continue
|
1281 |
continue
|
| 1282 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1282 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1283 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1283 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1284 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1284 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1285 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSellingPrice))
|
1285 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1286 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1286 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1287 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1287 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
| 1288 |
sheet_iterator+=1
|
1288 |
sheet_iterator+=1
|
| 1289 |
|
1289 |
|
| 1290 |
sheet = wbk.add_sheet('Among Cheapest')
|
1290 |
sheet = wbk.add_sheet('Among Cheapest')
|
| Line 1387... |
Line 1387... |
| 1387 |
sheet_iterator+=1
|
1387 |
sheet_iterator+=1
|
| 1388 |
continue
|
1388 |
continue
|
| 1389 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1389 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1390 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1390 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1391 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1391 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1392 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSellingPrice))
|
1392 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1393 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1393 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1394 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1394 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
| 1395 |
sheet_iterator+=1
|
1395 |
sheet_iterator+=1
|
| 1396 |
|
1396 |
|
| 1397 |
sheet = wbk.add_sheet('Cheapest')
|
1397 |
sheet = wbk.add_sheet('Cheapest')
|
| Line 1494... |
Line 1494... |
| 1494 |
sheet_iterator+=1
|
1494 |
sheet_iterator+=1
|
| 1495 |
continue
|
1495 |
continue
|
| 1496 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1496 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1497 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1497 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1498 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1498 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1499 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSellingPrice))
|
1499 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1500 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1500 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1501 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1501 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
| 1502 |
sheet_iterator+=1
|
1502 |
sheet_iterator+=1
|
| 1503 |
|
1503 |
|
| 1504 |
sheet = wbk.add_sheet('Negative Margin')
|
1504 |
sheet = wbk.add_sheet('Negative Margin')
|