| Line 112... |
Line 112... |
| 112 |
else:
|
112 |
else:
|
| 113 |
sku = 'FBB'+str(autoDecrementItem.item_id)
|
113 |
sku = 'FBB'+str(autoDecrementItem.item_id)
|
| 114 |
if amazonShortTermActivePromotions.has_key(sku):
|
114 |
if amazonShortTermActivePromotions.has_key(sku):
|
| 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.promoPrice:
|
| 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.proposedSp < 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
|
| Line 175... |
Line 175... |
| 175 |
markReasonForItem(autoIncrementItem,'Item in short term promotion',Decision.AUTO_INCREMENT_FAILED)
|
175 |
markReasonForItem(autoIncrementItem,'Item in short term promotion',Decision.AUTO_INCREMENT_FAILED)
|
| 176 |
continue
|
176 |
continue
|
| 177 |
if autoIncrementItem.totalSeller==1 and autoIncrementItem.ourRank==1:
|
177 |
if autoIncrementItem.totalSeller==1 and autoIncrementItem.ourRank==1:
|
| 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.promoPrice:
|
| 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.proposedSp >=10000 and autoIncrementItem.ourSellingPrice<10000:
|
183 |
if autoIncrementItem.proposedSp >=10000 and autoIncrementItem.promoPrice<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)
|
| Line 195... |
Line 195... |
| 195 |
|
195 |
|
| 196 |
daysOfStock = (float(autoIncrementItem.ourInventory))/autoIncrementItem.avgSale
|
196 |
daysOfStock = (float(autoIncrementItem.ourInventory))/autoIncrementItem.avgSale
|
| 197 |
if daysOfStock > 5:
|
197 |
if daysOfStock > 5:
|
| 198 |
markReasonForItem(autoIncrementItem,'Days of stock greater than 5',Decision.AUTO_INCREMENT_FAILED)
|
198 |
markReasonForItem(autoIncrementItem,'Days of stock greater than 5',Decision.AUTO_INCREMENT_FAILED)
|
| 199 |
continue
|
199 |
continue
|
| 200 |
antecedentPrice = session.query(AmazonScrapingHistory.ourSellingPrice).filter(AmazonScrapingHistory.item_id==autoIncrementItem.item_id).filter(AmazonScrapingHistory.timestamp>time-timedelta(days=1)).order_by(asc(AmazonScrapingHistory.timestamp)).first()
|
200 |
if autoIncrementItem.isPromotion:
|
| 201 |
if antecedentPrice is not None:
|
201 |
antecedentPrice = session.query(AmazonScrapingHistory.promoPrice).filter(AmazonScrapingHistory.item_id==autoIncrementItem.item_id).filter(AmazonScrapingHistory.timestamp>time-timedelta(days=1)).order_by(asc(AmazonScrapingHistory.timestamp)).first()
|
| - |
|
202 |
if antecedentPrice is not None:
|
| 202 |
if float(math.ceil(autoIncrementItem.ourSellingPrice+max(10,.01*autoIncrementItem.ourSellingPrice))-math.ceil(antecedentPrice[0]+max(10,.01*antecedentPrice[0])))/math.ceil(antecedentPrice[0]+max(10,.01*antecedentPrice[0]))>.02:
|
203 |
if float(math.ceil(autoIncrementItem.promoPrice+max(10,.01*autoIncrementItem.promoPrice))-math.ceil(antecedentPrice[0]+max(10,.01*antecedentPrice[0])))/math.ceil(antecedentPrice[0]+max(10,.01*antecedentPrice[0]))>.02:
|
| 203 |
markReasonForItem(autoIncrementItem,'Maximum price increase in last 24 hours should be 2%',Decision.AUTO_INCREMENT_FAILED)
|
204 |
markReasonForItem(autoIncrementItem,'Maximum price increase in last 24 hours should be 2%',Decision.AUTO_INCREMENT_FAILED)
|
| - |
|
205 |
continue
|
| - |
|
206 |
else:
|
| 204 |
continue
|
207 |
antecedentPrice = session.query(AmazonScrapingHistory.ourSellingPrice).filter(AmazonScrapingHistory.item_id==autoIncrementItem.item_id).filter(AmazonScrapingHistory.timestamp>time-timedelta(days=1)).order_by(asc(AmazonScrapingHistory.timestamp)).first()
|
| - |
|
208 |
if antecedentPrice is not None:
|
| - |
|
209 |
if float(math.ceil(autoIncrementItem.ourSellingPrice+max(10,.01*autoIncrementItem.ourSellingPrice))-math.ceil(antecedentPrice[0]+max(10,.01*antecedentPrice[0])))/math.ceil(antecedentPrice[0]+max(10,.01*antecedentPrice[0]))>.02:
|
| - |
|
210 |
markReasonForItem(autoIncrementItem,'Maximum price increase in last 24 hours should be 2%',Decision.AUTO_INCREMENT_FAILED)
|
| - |
|
211 |
continue
|
| 205 |
fbaSaleSnapshot = transaction_client.getAmazonFbaSalesLatestSnapshotForItemLocationWise(autoIncrementItem.item_id,autoIncrementItem.warehouseLocation)
|
212 |
fbaSaleSnapshot = transaction_client.getAmazonFbaSalesLatestSnapshotForItemLocationWise(autoIncrementItem.item_id,autoIncrementItem.warehouseLocation)
|
| 206 |
if getLastDaySale(fbaSaleSnapshot)<=2:
|
213 |
if getLastDaySale(fbaSaleSnapshot)<=2:
|
| 207 |
markReasonForItem(autoIncrementItem,'Last day sale is less than 3',Decision.AUTO_INCREMENT_FAILED)
|
214 |
markReasonForItem(autoIncrementItem,'Last day sale is less than 3',Decision.AUTO_INCREMENT_FAILED)
|
| 208 |
continue
|
215 |
continue
|
| 209 |
|
216 |
|
| Line 1052... |
Line 1059... |
| 1052 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
1059 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
| 1053 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
1060 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
| 1054 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
1061 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
| 1055 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
1062 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
| 1056 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
1063 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
| 1057 |
sheet.write(sheet_iterator, 28, round(amScraping.ourSellingPrice - amScraping.lowestPossibleSp))
|
1064 |
sheet.write(sheet_iterator, 28, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
| 1058 |
sheet.write(sheet_iterator, 29, item.risky)
|
1065 |
sheet.write(sheet_iterator, 29, item.risky)
|
| 1059 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
1066 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
| 1060 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
1067 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
| 1061 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
1068 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
| 1062 |
sheet_iterator+=1
|
1069 |
sheet_iterator+=1
|
| Line 1149... |
Line 1156... |
| 1149 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
1156 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
| 1150 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
1157 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
| 1151 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
1158 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
| 1152 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
1159 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
| 1153 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
1160 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
| 1154 |
sheet.write(sheet_iterator, 28, round(amScraping.ourSellingPrice - amScraping.lowestPossibleSp))
|
1161 |
sheet.write(sheet_iterator, 28, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
| 1155 |
sheet.write(sheet_iterator, 29, item.risky)
|
1162 |
sheet.write(sheet_iterator, 29, item.risky)
|
| 1156 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
1163 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
| 1157 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
1164 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
| 1158 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
1165 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
| 1159 |
if amScraping.decision is None:
|
1166 |
if amScraping.decision is None:
|
| Line 1163... |
Line 1170... |
| 1163 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1170 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1164 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1171 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1165 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1172 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1166 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
1173 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1167 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1174 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1168 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1175 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1169 |
sheet_iterator+=1
|
1176 |
sheet_iterator+=1
|
| 1170 |
|
1177 |
|
| 1171 |
sheet = wbk.add_sheet('Almost Competitive')
|
1178 |
sheet = wbk.add_sheet('Almost Competitive')
|
| 1172 |
xstr = lambda s: s or ""
|
1179 |
xstr = lambda s: s or ""
|
| 1173 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1180 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| Line 1264... |
Line 1271... |
| 1264 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
1271 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
| 1265 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
1272 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
| 1266 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
1273 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
| 1267 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
1274 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
| 1268 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
1275 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
| 1269 |
sheet.write(sheet_iterator, 28, round(amScraping.ourSellingPrice - amScraping.lowestPossibleSp))
|
1276 |
sheet.write(sheet_iterator, 28, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
| 1270 |
sheet.write(sheet_iterator, 29, item.risky)
|
1277 |
sheet.write(sheet_iterator, 29, item.risky)
|
| 1271 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
1278 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
| 1272 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
1279 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
| 1273 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
1280 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
| 1274 |
if amScraping.decision is None:
|
1281 |
if amScraping.decision is None:
|
| Line 1278... |
Line 1285... |
| 1278 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1285 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1279 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1286 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1280 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1287 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1281 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
1288 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1282 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1289 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1283 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1290 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1284 |
sheet_iterator+=1
|
1291 |
sheet_iterator+=1
|
| 1285 |
|
1292 |
|
| 1286 |
sheet = wbk.add_sheet('Among Cheapest')
|
1293 |
sheet = wbk.add_sheet('Among Cheapest')
|
| 1287 |
xstr = lambda s: s or ""
|
1294 |
xstr = lambda s: s or ""
|
| 1288 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1295 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| Line 1371... |
Line 1378... |
| 1371 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
1378 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
| 1372 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
1379 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
| 1373 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
1380 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
| 1374 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
1381 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
| 1375 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
1382 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
| 1376 |
sheet.write(sheet_iterator, 28, round(amScraping.ourSellingPrice - amScraping.lowestPossibleSp))
|
1383 |
sheet.write(sheet_iterator, 28, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
| 1377 |
sheet.write(sheet_iterator, 29, item.risky)
|
1384 |
sheet.write(sheet_iterator, 29, item.risky)
|
| 1378 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
1385 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
| 1379 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
1386 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
| 1380 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
1387 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
| 1381 |
if amScraping.decision is None:
|
1388 |
if amScraping.decision is None:
|
| Line 1385... |
Line 1392... |
| 1385 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1392 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1386 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1393 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1387 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1394 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1388 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
1395 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1389 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1396 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1390 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1397 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1391 |
sheet_iterator+=1
|
1398 |
sheet_iterator+=1
|
| 1392 |
|
1399 |
|
| 1393 |
sheet = wbk.add_sheet('Cheapest')
|
1400 |
sheet = wbk.add_sheet('Cheapest')
|
| 1394 |
xstr = lambda s: s or ""
|
1401 |
xstr = lambda s: s or ""
|
| 1395 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1402 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| Line 1478... |
Line 1485... |
| 1478 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
1485 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
| 1479 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
1486 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
| 1480 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
1487 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
| 1481 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
1488 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
| 1482 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
1489 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
| 1483 |
sheet.write(sheet_iterator, 28, round(amScraping.ourSellingPrice - amScraping.lowestPossibleSp))
|
1490 |
sheet.write(sheet_iterator, 28, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
| 1484 |
sheet.write(sheet_iterator, 29, item.risky)
|
1491 |
sheet.write(sheet_iterator, 29, item.risky)
|
| 1485 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
1492 |
sheet.write(sheet_iterator, 30, amScraping.proposedSp)
|
| 1486 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
1493 |
sheet.write(sheet_iterator, 31, amScraping.avgSale)
|
| 1487 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
1494 |
sheet.write(sheet_iterator, 32, getOosString(saleMap.get(sku)))
|
| 1488 |
if amScraping.decision is None:
|
1495 |
if amScraping.decision is None:
|
| Line 1492... |
Line 1499... |
| 1492 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
1499 |
sheet.write(sheet_iterator, 33, Decision._VALUES_TO_NAMES.get(amScraping.decision))
|
| 1493 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
1500 |
sheet.write(sheet_iterator, 34, amScraping.reason)
|
| 1494 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
1501 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1495 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
1502 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.proposedSp))
|
| 1496 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
1503 |
if Decision._VALUES_TO_NAMES.get(amScraping.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1497 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.ourSellingPrice+max(10,.01*amScraping.ourSellingPrice)))
|
1504 |
sheet.write(sheet_iterator, 35, math.ceil(amScraping.promoPrice+max(10,.01*amScraping.promoPrice)))
|
| 1498 |
sheet_iterator+=1
|
1505 |
sheet_iterator+=1
|
| 1499 |
|
1506 |
|
| 1500 |
sheet = wbk.add_sheet('Negative Margin')
|
1507 |
sheet = wbk.add_sheet('Negative Margin')
|
| 1501 |
xstr = lambda s: s or ""
|
1508 |
xstr = lambda s: s or ""
|
| 1502 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
1509 |
heading_xf = xlwt.easyxf('font: bold on; align: wrap off, vert centre, horiz center')
|
| Line 1580... |
Line 1587... |
| 1580 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
1587 |
sheet.write(sheet_iterator, 23, amScraping.otherCost)
|
| 1581 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
1588 |
sheet.write(sheet_iterator, 24, amScraping.wanlc)
|
| 1582 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
1589 |
sheet.write(sheet_iterator, 25, amScraping.commission)
|
| 1583 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
1590 |
sheet.write(sheet_iterator, 26, amScraping.competitorCommission)
|
| 1584 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
1591 |
sheet.write(sheet_iterator, 27, amScraping.returnProvision)
|
| 1585 |
sheet.write(sheet_iterator, 28, round(amScraping.ourSellingPrice - amScraping.lowestPossibleSp))
|
1592 |
sheet.write(sheet_iterator, 28, round(amScraping.promoPrice - amScraping.lowestPossibleSp))
|
| 1586 |
sheet.write(sheet_iterator, 29, amScraping.avgSale)
|
1593 |
sheet.write(sheet_iterator, 29, amScraping.avgSale)
|
| 1587 |
sheet.write(sheet_iterator, 30, getOosString(saleMap.get(sku)))
|
1594 |
sheet.write(sheet_iterator, 30, getOosString(saleMap.get(sku)))
|
| 1588 |
sheet_iterator+=1
|
1595 |
sheet_iterator+=1
|
| 1589 |
|
1596 |
|
| 1590 |
sheet = wbk.add_sheet('Exception List')
|
1597 |
sheet = wbk.add_sheet('Exception List')
|