| Line 126... |
Line 126... |
| 126 |
def fetchItemsForAutoDecrease(time):
|
126 |
def fetchItemsForAutoDecrease(time):
|
| 127 |
successfulAutoDecrease = []
|
127 |
successfulAutoDecrease = []
|
| 128 |
autoDecrementItems = session.query(AmazonScrapingHistory).join((Amazonlisted,AmazonScrapingHistory.item_id==Amazonlisted.itemId))\
|
128 |
autoDecrementItems = session.query(AmazonScrapingHistory).join((Amazonlisted,AmazonScrapingHistory.item_id==Amazonlisted.itemId))\
|
| 129 |
.filter(AmazonScrapingHistory.timestamp==time).filter(or_(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.AMONG_CHEAPEST_CAN_COMPETE,AmazonScrapingHistory.competitiveCategory==CompetitionCategory.COMPETITIVE, AmazonScrapingHistory.competitiveCategory==CompetitionCategory.ALMOST_COMPETE ))\
|
129 |
.filter(AmazonScrapingHistory.timestamp==time).filter(or_(AmazonScrapingHistory.competitiveCategory==CompetitionCategory.AMONG_CHEAPEST_CAN_COMPETE,AmazonScrapingHistory.competitiveCategory==CompetitionCategory.COMPETITIVE, AmazonScrapingHistory.competitiveCategory==CompetitionCategory.ALMOST_COMPETE ))\
|
| 130 |
.filter(Amazonlisted.autoDecrement==True).all()
|
130 |
.filter(Amazonlisted.autoDecrement==True).all()
|
| 131 |
print len(autoDecrementItems)
|
- |
|
| 132 |
for autoDecrementItem in autoDecrementItems:
|
131 |
for autoDecrementItem in autoDecrementItems:
|
| 133 |
if autoDecrementItem.warehouseLocation == 1:
|
132 |
if autoDecrementItem.warehouseLocation == 1:
|
| 134 |
sku = 'FBA'+str(autoDecrementItem.item_id)
|
133 |
sku = 'FBA'+str(autoDecrementItem.item_id)
|
| 135 |
else:
|
134 |
elif autoDecrementItem.warehouseLocation == 2:
|
| 136 |
sku = 'FBB'+str(autoDecrementItem.item_id)
|
135 |
sku = 'FBB'+str(autoDecrementItem.item_id)
|
| - |
|
136 |
else:
|
| - |
|
137 |
sku = 'FBG'+str(autoDecrementItem.item_id)
|
| - |
|
138 |
|
| 137 |
if amazonShortTermActivePromotions.has_key(sku):
|
139 |
if amazonShortTermActivePromotions.has_key(sku):
|
| 138 |
markReasonForItem(autoDecrementItem,'Item in short term promotion',Decision.AUTO_DECREMENT_FAILED)
|
140 |
markReasonForItem(autoDecrementItem,'Item in short term promotion',Decision.AUTO_DECREMENT_FAILED)
|
| 139 |
continue
|
141 |
continue
|
| 140 |
if wpiTodayExpiry.has_key(sku) and not amazonLongTermActivePromotions.has_key(sku):
|
142 |
if wpiTodayExpiry.has_key(sku) and not amazonLongTermActivePromotions.has_key(sku):
|
| 141 |
markReasonForItem(autoDecrementItem,'Last Promotion ended in 24 hours and no current active promotion',Decision.AUTO_DECREMENT_FAILED)
|
143 |
markReasonForItem(autoDecrementItem,'Last Promotion ended in 24 hours and no current active promotion',Decision.AUTO_DECREMENT_FAILED)
|
| Line 192... |
Line 194... |
| 192 |
transaction_client = TransactionClient().get_client()
|
194 |
transaction_client = TransactionClient().get_client()
|
| 193 |
print len(autoIncrementItems)
|
195 |
print len(autoIncrementItems)
|
| 194 |
for autoIncrementItem in autoIncrementItems:
|
196 |
for autoIncrementItem in autoIncrementItems:
|
| 195 |
if autoIncrementItem.warehouseLocation == 1:
|
197 |
if autoIncrementItem.warehouseLocation == 1:
|
| 196 |
sku = 'FBA'+str(autoIncrementItem.item_id)
|
198 |
sku = 'FBA'+str(autoIncrementItem.item_id)
|
| 197 |
else:
|
199 |
elif autoIncrementItem.warehouseLocation == 2:
|
| 198 |
sku = 'FBB'+str(autoIncrementItem.item_id)
|
200 |
sku = 'FBB'+str(autoIncrementItem.item_id)
|
| - |
|
201 |
else:
|
| - |
|
202 |
sku = 'FBG'+str(autoIncrementItem.item_id)
|
| 199 |
if amazonShortTermActivePromotions.has_key(sku):
|
203 |
if amazonShortTermActivePromotions.has_key(sku):
|
| 200 |
markReasonForItem(autoIncrementItem,'Item in short term promotion',Decision.AUTO_INCREMENT_FAILED)
|
204 |
markReasonForItem(autoIncrementItem,'Item in short term promotion',Decision.AUTO_INCREMENT_FAILED)
|
| 201 |
continue
|
205 |
continue
|
| 202 |
if wpiTodayExpiry.has_key(sku) and not amazonLongTermActivePromotions.has_key(sku):
|
206 |
if wpiTodayExpiry.has_key(sku) and not amazonLongTermActivePromotions.has_key(sku):
|
| 203 |
markReasonForItem(autoIncrementItem,'Last Promotion ended in 24 hours and no current active promotion',Decision.AUTO_INCREMENT_FAILED)
|
207 |
markReasonForItem(autoIncrementItem,'Last Promotion ended in 24 hours and no current active promotion',Decision.AUTO_INCREMENT_FAILED)
|
| Line 247... |
Line 251... |
| 247 |
continue
|
251 |
continue
|
| 248 |
if autoIncrementItem.warehouseLocation==1:
|
252 |
if autoIncrementItem.warehouseLocation==1:
|
| 249 |
fcLocation = 0
|
253 |
fcLocation = 0
|
| 250 |
elif autoIncrementItem.warehouseLocation==2:
|
254 |
elif autoIncrementItem.warehouseLocation==2:
|
| 251 |
fcLocation = 1
|
255 |
fcLocation = 1
|
| - |
|
256 |
elif autoIncrementItem.warehouseLocation==3:
|
| - |
|
257 |
fcLocation = 2
|
| 252 |
else:
|
258 |
else:
|
| 253 |
pass
|
259 |
pass
|
| 254 |
fbaSaleSnapshot = transaction_client.getAmazonFbaSalesLatestSnapshotForItemLocationWise(autoIncrementItem.item_id,fcLocation)
|
260 |
fbaSaleSnapshot = transaction_client.getAmazonFbaSalesLatestSnapshotForItemLocationWise(autoIncrementItem.item_id,fcLocation)
|
| 255 |
if getLastDaySale(fbaSaleSnapshot)<=2:
|
261 |
if getLastDaySale(fbaSaleSnapshot)<=2:
|
| 256 |
markReasonForItem(autoIncrementItem,'Last day sale is less than 3',Decision.AUTO_INCREMENT_FAILED)
|
262 |
markReasonForItem(autoIncrementItem,'Last day sale is less than 3',Decision.AUTO_INCREMENT_FAILED)
|
| Line 393... |
Line 399... |
| 393 |
saleMap['FBA'+str(saleSnapshot.item_id)]=temp
|
399 |
saleMap['FBA'+str(saleSnapshot.item_id)]=temp
|
| 394 |
else:
|
400 |
else:
|
| 395 |
temp = []
|
401 |
temp = []
|
| 396 |
temp.append(saleSnapshot)
|
402 |
temp.append(saleSnapshot)
|
| 397 |
saleMap['FBA'+str(saleSnapshot.item_id)] = temp
|
403 |
saleMap['FBA'+str(saleSnapshot.item_id)] = temp
|
| 398 |
else:
|
404 |
elif saleSnapshot.fcLocation == 1:
|
| 399 |
if saleMap.has_key('FBB'+str(saleSnapshot.item_id)):
|
405 |
if saleMap.has_key('FBB'+str(saleSnapshot.item_id)):
|
| 400 |
temp = []
|
406 |
temp = []
|
| 401 |
val = saleMap.get('FBB'+str(saleSnapshot.item_id))
|
407 |
val = saleMap.get('FBB'+str(saleSnapshot.item_id))
|
| 402 |
for l in val:
|
408 |
for l in val:
|
| 403 |
temp.append(l)
|
409 |
temp.append(l)
|
| 404 |
saleMap['FBB'+str(saleSnapshot.item_id)]=temp
|
- |
|
| 405 |
temp.append(saleSnapshot)
|
410 |
temp.append(saleSnapshot)
|
| - |
|
411 |
saleMap['FBB'+str(saleSnapshot.item_id)]=temp
|
| 406 |
else:
|
412 |
else:
|
| 407 |
temp = []
|
413 |
temp = []
|
| 408 |
temp.append(saleSnapshot)
|
414 |
temp.append(saleSnapshot)
|
| 409 |
saleMap['FBB'+str(saleSnapshot.item_id)] = temp
|
415 |
saleMap['FBB'+str(saleSnapshot.item_id)] = temp
|
| - |
|
416 |
elif saleSnapshot.fcLocation == 2:
|
| - |
|
417 |
if saleMap.has_key('FBG'+str(saleSnapshot.item_id)):
|
| - |
|
418 |
temp = []
|
| - |
|
419 |
val = saleMap.get('FBG'+str(saleSnapshot.item_id))
|
| - |
|
420 |
for l in val:
|
| - |
|
421 |
temp.append(l)
|
| - |
|
422 |
temp.append(saleSnapshot)
|
| - |
|
423 |
saleMap['FBG'+str(saleSnapshot.item_id)]=temp
|
| - |
|
424 |
else:
|
| - |
|
425 |
temp = []
|
| - |
|
426 |
temp.append(saleSnapshot)
|
| - |
|
427 |
saleMap['FBG'+str(saleSnapshot.item_id)] = temp
|
| - |
|
428 |
else:
|
| - |
|
429 |
continue
|
| 410 |
|
430 |
|
| 411 |
|
431 |
|
| 412 |
def computeCourierCost(weight):
|
432 |
def computeCourierCost(weight):
|
| 413 |
try:
|
433 |
try:
|
| 414 |
cCost = 10.0;
|
434 |
cCost = 10.0;
|
| Line 439... |
Line 459... |
| 439 |
sku = 'FBA'+str(fbaInventoryItem.item_id)
|
459 |
sku = 'FBA'+str(fbaInventoryItem.item_id)
|
| 440 |
notListed.append(sku)
|
460 |
notListed.append(sku)
|
| 441 |
elif fbaInventoryItem.location==1:
|
461 |
elif fbaInventoryItem.location==1:
|
| 442 |
sku = 'FBB'+str(fbaInventoryItem.item_id)
|
462 |
sku = 'FBB'+str(fbaInventoryItem.item_id)
|
| 443 |
notListed.append(sku)
|
463 |
notListed.append(sku)
|
| - |
|
464 |
elif fbaInventoryItem.location==2:
|
| - |
|
465 |
sku = 'FBG'+str(fbaInventoryItem.item_id)
|
| - |
|
466 |
notListed.append(sku)
|
| 444 |
else:
|
467 |
else:
|
| 445 |
pass
|
468 |
pass
|
| 446 |
continue
|
469 |
continue
|
| 447 |
if d_amazon_listed.overrrideWanlc:
|
470 |
if d_amazon_listed.overrrideWanlc:
|
| 448 |
isNlcOverridden = True
|
471 |
isNlcOverridden = True
|
| Line 470... |
Line 493... |
| 470 |
sku = 'FBA'+str(fbaInventoryItem.item_id)
|
493 |
sku = 'FBA'+str(fbaInventoryItem.item_id)
|
| 471 |
state_id = 1
|
494 |
state_id = 1
|
| 472 |
elif fbaInventoryItem.location==1:
|
495 |
elif fbaInventoryItem.location==1:
|
| 473 |
sku = 'FBB'+str(fbaInventoryItem.item_id)
|
496 |
sku = 'FBB'+str(fbaInventoryItem.item_id)
|
| 474 |
state_id = 2
|
497 |
state_id = 2
|
| - |
|
498 |
elif fbaInventoryItem.location==2:
|
| - |
|
499 |
sku = 'FBG'+str(fbaInventoryItem.item_id)
|
| - |
|
500 |
state_id = 3
|
| 475 |
else:
|
501 |
else:
|
| 476 |
continue
|
502 |
continue
|
| 477 |
cc = computeCourierCost(it.weight)
|
503 |
cc = computeCourierCost(it.weight)
|
| 478 |
|
504 |
|
| 479 |
amazonItemInfo = __AmazonItemInfo(None, wanlc,cc, sku, it.product_group, it.brand, it.model_name, it.model_number, it.color, it.weight, category.parent_category_id, it.risky, None, runType, parent_category.display_name,sourcePercentage,fbaInventoryItem.availability,state_id,d_amazon_listed.otherCost,None,isNlcOverridden)
|
505 |
amazonItemInfo = __AmazonItemInfo(None, wanlc,cc, sku, it.product_group, it.brand, it.model_name, it.model_number, it.color, it.weight, category.parent_category_id, it.risky, None, runType, parent_category.display_name,sourcePercentage,fbaInventoryItem.availability,state_id,d_amazon_listed.otherCost,None,isNlcOverridden)
|
| Line 792... |
Line 818... |
| 792 |
lowestPossibleSp = (item.wanlc+(item.courierCost)*(1+(serviceTax/100))*(1+(newVatRate/100))+(15+item.otherCost)*(1+(newVatRate)/100))/(1-(item.commission/100)*(1+(serviceTax/100))*(1+(newVatRate)/100)-(item.returnProvision/100)*(1+(newVatRate)/100));
|
818 |
lowestPossibleSp = (item.wanlc+(item.courierCost)*(1+(serviceTax/100))*(1+(newVatRate/100))+(15+item.otherCost)*(1+(newVatRate)/100))/(1-(item.commission/100)*(1+(serviceTax/100))*(1+(newVatRate)/100)-(item.returnProvision/100)*(1+(newVatRate)/100));
|
| 793 |
if item.isPromotion:
|
819 |
if item.isPromotion:
|
| 794 |
sku = ''
|
820 |
sku = ''
|
| 795 |
if item.warehouseLocation==1:
|
821 |
if item.warehouseLocation==1:
|
| 796 |
sku='FBA'+str(item.item_id)
|
822 |
sku='FBA'+str(item.item_id)
|
| 797 |
else:
|
823 |
elif item.warehouseLocation==2:
|
| 798 |
sku='FBB'+str(item.item_id)
|
824 |
sku='FBB'+str(item.item_id)
|
| - |
|
825 |
else:
|
| - |
|
826 |
sku='FBG'+str(item.item_id)
|
| 799 |
if amazonLongTermActivePromotions.has_key(sku):
|
827 |
if amazonLongTermActivePromotions.has_key(sku):
|
| 800 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
828 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
| 801 |
else:
|
829 |
else:
|
| 802 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
830 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
| 803 |
print "subsidy ",subsidy
|
831 |
print "subsidy ",subsidy
|
| Line 1294... |
Line 1322... |
| 1294 |
if item[0]>=5:
|
1322 |
if item[0]>=5:
|
| 1295 |
stockList.append(item[1])
|
1323 |
stockList.append(item[1])
|
| 1296 |
|
1324 |
|
| 1297 |
for sku, val in saleMap.iteritems():
|
1325 |
for sku, val in saleMap.iteritems():
|
| 1298 |
totalSale = 0
|
1326 |
totalSale = 0
|
| 1299 |
item_id = sku.replace('FBA','').replace('FBB','')
|
1327 |
item_id = sku.replace('FBA','').replace('FBB','').replace('FBG','')
|
| 1300 |
val =saleMap.get('FBA'+str(item_id))
|
1328 |
val =saleMap.get('FBA'+str(item_id))
|
| 1301 |
if val is not None:
|
1329 |
if val is not None:
|
| 1302 |
for sale in val:
|
1330 |
for sale in val:
|
| 1303 |
totalSale += sale.totalOrderCount
|
1331 |
totalSale += sale.totalOrderCount
|
| 1304 |
val =saleMap.get('FBB'+str(item_id))
|
1332 |
val =saleMap.get('FBB'+str(item_id))
|
| 1305 |
if val is not None:
|
1333 |
if val is not None:
|
| 1306 |
for sale in val:
|
1334 |
for sale in val:
|
| 1307 |
totalSale += sale.totalOrderCount
|
1335 |
totalSale += sale.totalOrderCount
|
| - |
|
1336 |
val =saleMap.get('FBG'+str(item_id))
|
| - |
|
1337 |
if val is not None:
|
| - |
|
1338 |
for sale in val:
|
| - |
|
1339 |
totalSale += sale.totalOrderCount
|
| 1308 |
if totalSale > 0:
|
1340 |
if totalSale > 0:
|
| 1309 |
saleList.append(item_id)
|
1341 |
saleList.append(item_id)
|
| 1310 |
|
1342 |
|
| 1311 |
for aItem in allItems:
|
1343 |
for aItem in allItems:
|
| 1312 |
reason = ""
|
1344 |
reason = ""
|
| Line 1417... |
Line 1449... |
| 1417 |
def getMsp(item_id,location):
|
1449 |
def getMsp(item_id,location):
|
| 1418 |
if location==1:
|
1450 |
if location==1:
|
| 1419 |
sku='FBA'+str(item_id)
|
1451 |
sku='FBA'+str(item_id)
|
| 1420 |
elif location==2:
|
1452 |
elif location==2:
|
| 1421 |
sku='FBB'+str(item_id)
|
1453 |
sku='FBB'+str(item_id)
|
| - |
|
1454 |
elif location==3:
|
| - |
|
1455 |
sku='FBG'+str(item_id)
|
| 1422 |
else:
|
1456 |
else:
|
| 1423 |
return 0.0
|
1457 |
return 0.0
|
| 1424 |
if amazonLongTermActivePromotions.has_key(sku):
|
1458 |
if amazonLongTermActivePromotions.has_key(sku):
|
| 1425 |
msp = (amazonLongTermActivePromotions.get(sku)).promoPrice
|
1459 |
msp = (amazonLongTermActivePromotions.get(sku)).promoPrice
|
| 1426 |
elif amazonShortTermActivePromotions.has_key(sku):
|
1460 |
elif amazonShortTermActivePromotions.has_key(sku):
|
| Line 1556... |
Line 1590... |
| 1556 |
item = cantCompeteItem[1]
|
1590 |
item = cantCompeteItem[1]
|
| 1557 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
1591 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 1558 |
if amScraping.warehouseLocation == 1:
|
1592 |
if amScraping.warehouseLocation == 1:
|
| 1559 |
sku = 'FBA'+str(amScraping.item_id)
|
1593 |
sku = 'FBA'+str(amScraping.item_id)
|
| 1560 |
loc = 'MUMBAI'
|
1594 |
loc = 'MUMBAI'
|
| 1561 |
else:
|
1595 |
elif amScraping.warehouseLocation == 2:
|
| 1562 |
sku = 'FBB'+str(amScraping.item_id)
|
1596 |
sku = 'FBB'+str(amScraping.item_id)
|
| 1563 |
loc = 'BANGLORE'
|
1597 |
loc = 'BANGLORE'
|
| - |
|
1598 |
else:
|
| - |
|
1599 |
sku = 'FBG'+str(amScraping.item_id)
|
| - |
|
1600 |
loc = 'GURGAON'
|
| 1564 |
sheet.write(sheet_iterator, 1, sku)
|
1601 |
sheet.write(sheet_iterator, 1, sku)
|
| 1565 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
1602 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 1566 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
1603 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 1567 |
sheet.write(sheet_iterator, 4, loc)
|
1604 |
sheet.write(sheet_iterator, 4, loc)
|
| 1568 |
sheet.write(sheet_iterator, 5, item.brand)
|
1605 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 1631... |
Line 1668... |
| 1631 |
item = competitiveItem[1]
|
1668 |
item = competitiveItem[1]
|
| 1632 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
1669 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 1633 |
if amScraping.warehouseLocation == 1:
|
1670 |
if amScraping.warehouseLocation == 1:
|
| 1634 |
sku = 'FBA'+str(amScraping.item_id)
|
1671 |
sku = 'FBA'+str(amScraping.item_id)
|
| 1635 |
loc = 'MUMBAI'
|
1672 |
loc = 'MUMBAI'
|
| 1636 |
else:
|
1673 |
elif amScraping.warehouseLocation == 2:
|
| 1637 |
sku = 'FBB'+str(amScraping.item_id)
|
1674 |
sku = 'FBB'+str(amScraping.item_id)
|
| 1638 |
loc = 'BANGLORE'
|
1675 |
loc = 'BANGLORE'
|
| - |
|
1676 |
else:
|
| - |
|
1677 |
sku='FBG'+str(amScraping.item_id)
|
| - |
|
1678 |
loc = 'GURGAON'
|
| 1639 |
sheet.write(sheet_iterator, 1, sku)
|
1679 |
sheet.write(sheet_iterator, 1, sku)
|
| 1640 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
1680 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 1641 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
1681 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 1642 |
sheet.write(sheet_iterator, 4, loc)
|
1682 |
sheet.write(sheet_iterator, 4, loc)
|
| 1643 |
sheet.write(sheet_iterator, 5, item.brand)
|
1683 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 1718... |
Line 1758... |
| 1718 |
item = almostCompetitiveItem[1]
|
1758 |
item = almostCompetitiveItem[1]
|
| 1719 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
1759 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 1720 |
if amScraping.warehouseLocation == 1:
|
1760 |
if amScraping.warehouseLocation == 1:
|
| 1721 |
sku = 'FBA'+str(amScraping.item_id)
|
1761 |
sku = 'FBA'+str(amScraping.item_id)
|
| 1722 |
loc = 'MUMBAI'
|
1762 |
loc = 'MUMBAI'
|
| 1723 |
else:
|
1763 |
elif amScraping.warehouseLocation == 2:
|
| 1724 |
sku = 'FBB'+str(amScraping.item_id)
|
1764 |
sku = 'FBB'+str(amScraping.item_id)
|
| 1725 |
loc = 'BANGLORE'
|
1765 |
loc = 'BANGLORE'
|
| - |
|
1766 |
else:
|
| - |
|
1767 |
sku = 'FBG'+str(amScraping.item_id)
|
| - |
|
1768 |
loc = 'GURGAON'
|
| 1726 |
sheet.write(sheet_iterator, 1, sku)
|
1769 |
sheet.write(sheet_iterator, 1, sku)
|
| 1727 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
1770 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 1728 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
1771 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 1729 |
sheet.write(sheet_iterator, 4, loc)
|
1772 |
sheet.write(sheet_iterator, 4, loc)
|
| 1730 |
sheet.write(sheet_iterator, 5, item.brand)
|
1773 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 1805... |
Line 1848... |
| 1805 |
item = amongCheapestItem[1]
|
1848 |
item = amongCheapestItem[1]
|
| 1806 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
1849 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 1807 |
if amScraping.warehouseLocation == 1:
|
1850 |
if amScraping.warehouseLocation == 1:
|
| 1808 |
sku = 'FBA'+str(amScraping.item_id)
|
1851 |
sku = 'FBA'+str(amScraping.item_id)
|
| 1809 |
loc = 'MUMBAI'
|
1852 |
loc = 'MUMBAI'
|
| 1810 |
else:
|
1853 |
elif amScraping.warehouseLocation == 2:
|
| 1811 |
sku = 'FBB'+str(amScraping.item_id)
|
1854 |
sku = 'FBB'+str(amScraping.item_id)
|
| 1812 |
loc = 'BANGLORE'
|
1855 |
loc = 'BANGLORE'
|
| - |
|
1856 |
else:
|
| - |
|
1857 |
sku = 'FBG'+str(amScraping.item_id)
|
| - |
|
1858 |
loc = 'GURGAON'
|
| 1813 |
sheet.write(sheet_iterator, 1, sku)
|
1859 |
sheet.write(sheet_iterator, 1, sku)
|
| 1814 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
1860 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 1815 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
1861 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 1816 |
sheet.write(sheet_iterator, 4, loc)
|
1862 |
sheet.write(sheet_iterator, 4, loc)
|
| 1817 |
sheet.write(sheet_iterator, 5, item.brand)
|
1863 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 1938... |
Line 1984... |
| 1938 |
item = cheapestItem[1]
|
1984 |
item = cheapestItem[1]
|
| 1939 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
1985 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 1940 |
if amScraping.warehouseLocation == 1:
|
1986 |
if amScraping.warehouseLocation == 1:
|
| 1941 |
sku = 'FBA'+str(amScraping.item_id)
|
1987 |
sku = 'FBA'+str(amScraping.item_id)
|
| 1942 |
loc = 'MUMBAI'
|
1988 |
loc = 'MUMBAI'
|
| 1943 |
else:
|
1989 |
elif amScraping.warehouseLocation == 2:
|
| 1944 |
sku = 'FBB'+str(amScraping.item_id)
|
1990 |
sku = 'FBB'+str(amScraping.item_id)
|
| 1945 |
loc = 'BANGLORE'
|
1991 |
loc = 'BANGLORE'
|
| - |
|
1992 |
else:
|
| - |
|
1993 |
sku = 'FBG'+str(amScraping.item_id)
|
| - |
|
1994 |
loc = 'GURGAON'
|
| 1946 |
sheet.write(sheet_iterator, 1, sku)
|
1995 |
sheet.write(sheet_iterator, 1, sku)
|
| 1947 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
1996 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 1948 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
1997 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 1949 |
sheet.write(sheet_iterator, 4, loc)
|
1998 |
sheet.write(sheet_iterator, 4, loc)
|
| 1950 |
sheet.write(sheet_iterator, 5, item.brand)
|
1999 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 2027... |
Line 2076... |
| 2027 |
item = exceptionCheapItem[1]
|
2076 |
item = exceptionCheapItem[1]
|
| 2028 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
2077 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 2029 |
if amScraping.warehouseLocation == 1:
|
2078 |
if amScraping.warehouseLocation == 1:
|
| 2030 |
sku = 'FBA'+str(amScraping.item_id)
|
2079 |
sku = 'FBA'+str(amScraping.item_id)
|
| 2031 |
loc = 'MUMBAI'
|
2080 |
loc = 'MUMBAI'
|
| 2032 |
else:
|
2081 |
elif amScraping.warehouseLocation == 2:
|
| 2033 |
sku = 'FBB'+str(amScraping.item_id)
|
2082 |
sku = 'FBB'+str(amScraping.item_id)
|
| 2034 |
loc = 'BANGLORE'
|
2083 |
loc = 'BANGLORE'
|
| - |
|
2084 |
else:
|
| - |
|
2085 |
sku = 'FBG'+str(amScraping.item_id)
|
| - |
|
2086 |
loc = 'GURGAON'
|
| 2035 |
sheet.write(sheet_iterator, 1, sku)
|
2087 |
sheet.write(sheet_iterator, 1, sku)
|
| 2036 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
2088 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 2037 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
2089 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 2038 |
sheet.write(sheet_iterator, 4, loc)
|
2090 |
sheet.write(sheet_iterator, 4, loc)
|
| 2039 |
sheet.write(sheet_iterator, 5, item.brand)
|
2091 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 2150... |
Line 2202... |
| 2150 |
item = negativeMarginItem[1]
|
2202 |
item = negativeMarginItem[1]
|
| 2151 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
2203 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 2152 |
if amScraping.warehouseLocation == 1:
|
2204 |
if amScraping.warehouseLocation == 1:
|
| 2153 |
sku = 'FBA'+str(amScraping.item_id)
|
2205 |
sku = 'FBA'+str(amScraping.item_id)
|
| 2154 |
loc = 'MUMBAI'
|
2206 |
loc = 'MUMBAI'
|
| 2155 |
else:
|
2207 |
elif amScraping.warehouseLocation == 2:
|
| 2156 |
sku = 'FBB'+str(amScraping.item_id)
|
2208 |
sku = 'FBB'+str(amScraping.item_id)
|
| 2157 |
loc = 'BANGLORE'
|
2209 |
loc = 'BANGLORE'
|
| - |
|
2210 |
else:
|
| - |
|
2211 |
sku = 'FBG'+str(amScraping.item_id)
|
| - |
|
2212 |
loc = 'GURGAON'
|
| 2158 |
sheet.write(sheet_iterator, 1, sku)
|
2213 |
sheet.write(sheet_iterator, 1, sku)
|
| 2159 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
2214 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 2160 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
2215 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 2161 |
sheet.write(sheet_iterator, 4, loc)
|
2216 |
sheet.write(sheet_iterator, 4, loc)
|
| 2162 |
sheet.write(sheet_iterator, 5, item.brand)
|
2217 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 2252... |
Line 2307... |
| 2252 |
item = exceptionListItem[1]
|
2307 |
item = exceptionListItem[1]
|
| 2253 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
2308 |
sheet.write(sheet_iterator, 0, amScraping.item_id)
|
| 2254 |
if amScraping.warehouseLocation == 1:
|
2309 |
if amScraping.warehouseLocation == 1:
|
| 2255 |
sku = 'FBA'+str(amScraping.item_id)
|
2310 |
sku = 'FBA'+str(amScraping.item_id)
|
| 2256 |
loc = 'MUMBAI'
|
2311 |
loc = 'MUMBAI'
|
| 2257 |
else:
|
2312 |
elif amScraping.warehouseLocation == 2:
|
| 2258 |
sku = 'FBB'+str(amScraping.item_id)
|
2313 |
sku = 'FBB'+str(amScraping.item_id)
|
| 2259 |
loc = 'BANGLORE'
|
2314 |
loc = 'BANGLORE'
|
| - |
|
2315 |
else:
|
| - |
|
2316 |
sku = 'FBG'+str(amScraping.item_id)
|
| - |
|
2317 |
loc = 'GURGAON'
|
| 2260 |
sheet.write(sheet_iterator, 1, sku)
|
2318 |
sheet.write(sheet_iterator, 1, sku)
|
| 2261 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
2319 |
sheet.write(sheet_iterator, 2, amScraping.asin)
|
| 2262 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
2320 |
sheet.write(sheet_iterator, 3, 'http://www.amazon.in/dp/'+amScraping.asin)
|
| 2263 |
sheet.write(sheet_iterator, 4, loc)
|
2321 |
sheet.write(sheet_iterator, 4, loc)
|
| 2264 |
sheet.write(sheet_iterator, 5, item.brand)
|
2322 |
sheet.write(sheet_iterator, 5, item.brand)
|
| Line 2409... |
Line 2467... |
| 2409 |
isListed = "No"
|
2467 |
isListed = "No"
|
| 2410 |
if amItem.suppressFbbPriceUpdate:
|
2468 |
if amItem.suppressFbbPriceUpdate:
|
| 2411 |
priceSuppress = "Yes"
|
2469 |
priceSuppress = "Yes"
|
| 2412 |
else:
|
2470 |
else:
|
| 2413 |
priceSuppress = "No"
|
2471 |
priceSuppress = "No"
|
| - |
|
2472 |
elif item.warehouseLocation==3:
|
| - |
|
2473 |
if amItem.isFbg:
|
| - |
|
2474 |
isListed = "Yes"
|
| - |
|
2475 |
else:
|
| - |
|
2476 |
isListed = "No"
|
| - |
|
2477 |
if amItem.suppressFbgPriceUpdate:
|
| - |
|
2478 |
priceSuppress = "Yes"
|
| - |
|
2479 |
else:
|
| - |
|
2480 |
priceSuppress = "No"
|
| 2414 |
else:
|
2481 |
else:
|
| 2415 |
pass
|
2482 |
continue
|
| 2416 |
#vatRate = getNewVatRate(item.item_id,item.warehouseLocation,item.proposedSp)
|
2483 |
#vatRate = getNewVatRate(item.item_id,item.warehouseLocation,item.proposedSp)
|
| 2417 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
2484 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
| 2418 |
oldMargin = getMargin(item)
|
2485 |
oldMargin = getMargin(item)
|
| 2419 |
#newMargin = round(item.proposedSp - getNewLowestPossibleSp(item,12.36,vatRate))
|
2486 |
#newMargin = round(item.proposedSp - getNewLowestPossibleSp(item,12.36,vatRate))
|
| 2420 |
newMargin = getNewMargin(item,item.proposedSp)
|
2487 |
newMargin = getNewMargin(item,item.proposedSp)
|
| 2421 |
sku = ''
|
2488 |
sku = ''
|
| 2422 |
if item.warehouseLocation==1:
|
2489 |
if item.warehouseLocation==1:
|
| 2423 |
sku='FBA'+str(item.item_id)
|
2490 |
sku='FBA'+str(item.item_id)
|
| - |
|
2491 |
elif item.warehouseLocation==2:
|
| - |
|
2492 |
sku='FBB'+str(item.item_id)
|
| 2424 |
else:
|
2493 |
else:
|
| 2425 |
sku='FBB'+str(item.item_id)
|
2494 |
sku='FBG'+str(item.item_id)
|
| 2426 |
if amazonLongTermActivePromotions.has_key(sku):
|
2495 |
if amazonLongTermActivePromotions.has_key(sku):
|
| 2427 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
2496 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
| 2428 |
elif amazonShortTermActivePromotions.has_key(sku):
|
2497 |
elif amazonShortTermActivePromotions.has_key(sku):
|
| 2429 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
2498 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
| 2430 |
else:
|
2499 |
else:
|
| Line 2486... |
Line 2555... |
| 2486 |
isListed = "No"
|
2555 |
isListed = "No"
|
| 2487 |
if amItem.suppressFbbPriceUpdate:
|
2556 |
if amItem.suppressFbbPriceUpdate:
|
| 2488 |
priceSuppress = "Yes"
|
2557 |
priceSuppress = "Yes"
|
| 2489 |
else:
|
2558 |
else:
|
| 2490 |
priceSuppress = "No"
|
2559 |
priceSuppress = "No"
|
| - |
|
2560 |
elif item.warehouseLocation==3:
|
| - |
|
2561 |
if amItem.isFbg:
|
| - |
|
2562 |
isListed = "Yes"
|
| - |
|
2563 |
else:
|
| - |
|
2564 |
isListed = "No"
|
| - |
|
2565 |
if amItem.suppressFbgPriceUpdate:
|
| - |
|
2566 |
priceSuppress = "Yes"
|
| - |
|
2567 |
else:
|
| - |
|
2568 |
priceSuppress = "No"
|
| 2491 |
else:
|
2569 |
else:
|
| 2492 |
pass
|
2570 |
continue
|
| 2493 |
#vatRate = getNewVatRate(item.item_id,item.warehouseLocation,math.ceil(item.promoPrice+max(10,.01*item.promoPrice)))
|
2571 |
#vatRate = getNewVatRate(item.item_id,item.warehouseLocation,math.ceil(item.promoPrice+max(10,.01*item.promoPrice)))
|
| 2494 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
2572 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
| 2495 |
oldMargin = getMargin(item)
|
2573 |
oldMargin = getMargin(item)
|
| 2496 |
#newMargin = round(math.ceil(item.promoPrice+max(10,.01*item.promoPrice)) - getNewLowestPossibleSp(item,12.36,vatRate))
|
2574 |
#newMargin = round(math.ceil(item.promoPrice+max(10,.01*item.promoPrice)) - getNewLowestPossibleSp(item,12.36,vatRate))
|
| 2497 |
newMargin = getNewMargin(item,math.ceil(item.promoPrice+max(10,.01*item.promoPrice)))
|
2575 |
newMargin = getNewMargin(item,math.ceil(item.promoPrice+max(10,.01*item.promoPrice)))
|
| 2498 |
sku = ''
|
2576 |
sku = ''
|
| 2499 |
if item.warehouseLocation==1:
|
2577 |
if item.warehouseLocation==1:
|
| 2500 |
sku='FBA'+str(item.item_id)
|
2578 |
sku='FBA'+str(item.item_id)
|
| - |
|
2579 |
elif item.warehouseLocation==2:
|
| - |
|
2580 |
sku='FBB'+str(item.item_id)
|
| 2501 |
else:
|
2581 |
else:
|
| 2502 |
sku='FBB'+str(item.item_id)
|
2582 |
sku='FBG'+str(item.item_id)
|
| 2503 |
if amazonLongTermActivePromotions.has_key(sku):
|
2583 |
if amazonLongTermActivePromotions.has_key(sku):
|
| 2504 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
2584 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
| 2505 |
elif amazonShortTermActivePromotions.has_key(sku):
|
2585 |
elif amazonShortTermActivePromotions.has_key(sku):
|
| 2506 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
2586 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
| 2507 |
else:
|
2587 |
else:
|
| Line 2608... |
Line 2688... |
| 2608 |
for negativeMarginItems in negativeMargins:
|
2688 |
for negativeMarginItems in negativeMargins:
|
| 2609 |
amScraping = negativeMarginItems[0]
|
2689 |
amScraping = negativeMarginItems[0]
|
| 2610 |
item = negativeMarginItems[1]
|
2690 |
item = negativeMarginItems[1]
|
| 2611 |
if amScraping.warehouseLocation==1:
|
2691 |
if amScraping.warehouseLocation==1:
|
| 2612 |
sku='FBA'+str(amScraping.item_id)
|
2692 |
sku='FBA'+str(amScraping.item_id)
|
| - |
|
2693 |
elif amScraping.warehouseLocation==2:
|
| - |
|
2694 |
sku='FBB'+str(amScraping.item_id)
|
| 2613 |
else:
|
2695 |
else:
|
| 2614 |
sku='FBB'+str(amScraping.item_id)
|
2696 |
sku='FBG'+str(amScraping.item_id)
|
| 2615 |
if amazonLongTermActivePromotions.has_key(sku):
|
2697 |
if amazonLongTermActivePromotions.has_key(sku):
|
| 2616 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
2698 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
| 2617 |
elif amazonShortTermActivePromotions.has_key(sku):
|
2699 |
elif amazonShortTermActivePromotions.has_key(sku):
|
| 2618 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
2700 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
| 2619 |
else:
|
2701 |
else:
|
| Line 2696... |
Line 2778... |
| 2696 |
for cantCompeteItem in cantCompeteItems:
|
2778 |
for cantCompeteItem in cantCompeteItems:
|
| 2697 |
amScraping = cantCompeteItem
|
2779 |
amScraping = cantCompeteItem
|
| 2698 |
item = Item.query.filter_by(id=amScraping.item_id).one()
|
2780 |
item = Item.query.filter_by(id=amScraping.item_id).one()
|
| 2699 |
if amScraping.warehouseLocation==1:
|
2781 |
if amScraping.warehouseLocation==1:
|
| 2700 |
sku='FBA'+str(amScraping.item_id)
|
2782 |
sku='FBA'+str(amScraping.item_id)
|
| - |
|
2783 |
elif amScraping.warehouseLocation==2:
|
| - |
|
2784 |
sku='FBB'+str(amScraping.item_id)
|
| 2701 |
else:
|
2785 |
else:
|
| 2702 |
sku='FBB'+str(amScraping.item_id)
|
2786 |
sku='FBG'+str(amScraping.item_id)
|
| 2703 |
if amazonLongTermActivePromotions.has_key(sku):
|
2787 |
if amazonLongTermActivePromotions.has_key(sku):
|
| 2704 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
2788 |
subsidy = (amazonLongTermActivePromotions.get(sku)).subsidy
|
| 2705 |
elif amazonShortTermActivePromotions.has_key(sku):
|
2789 |
elif amazonShortTermActivePromotions.has_key(sku):
|
| 2706 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
2790 |
subsidy = (amazonShortTermActivePromotions.get(sku)).subsidy
|
| 2707 |
else:
|
2791 |
else:
|
| Line 2753... |
Line 2837... |
| 2753 |
print "Successfully sent email"
|
2837 |
print "Successfully sent email"
|
| 2754 |
except:
|
2838 |
except:
|
| 2755 |
print "Error: unable to send email."
|
2839 |
print "Error: unable to send email."
|
| 2756 |
|
2840 |
|
| 2757 |
def commitPricing(successfulAutoDecrease,successfulAutoIncrease):
|
2841 |
def commitPricing(successfulAutoDecrease,successfulAutoIncrease):
|
| 2758 |
print "inside commit pricing"
|
- |
|
| 2759 |
if len(successfulAutoDecrease)==0 and len(successfulAutoIncrease)==0 :
|
2842 |
if len(successfulAutoDecrease)==0 and len(successfulAutoIncrease)==0 :
|
| 2760 |
return
|
2843 |
return
|
| 2761 |
for item in successfulAutoDecrease:
|
2844 |
for item in successfulAutoDecrease:
|
| 2762 |
amItem = Amazonlisted.get_by(itemId=item.item_id)
|
2845 |
amItem = Amazonlisted.get_by(itemId=item.item_id)
|
| 2763 |
if item.warehouseLocation==1:
|
2846 |
if item.warehouseLocation==1:
|
| Line 2770... |
Line 2853... |
| 2770 |
if item.isPromotion:
|
2853 |
if item.isPromotion:
|
| 2771 |
amItem.fbbPromoPrice = math.ceil(item.proposedSp)
|
2854 |
amItem.fbbPromoPrice = math.ceil(item.proposedSp)
|
| 2772 |
else:
|
2855 |
else:
|
| 2773 |
amItem.fbbPrice = math.ceil(item.proposedSp)
|
2856 |
amItem.fbbPrice = math.ceil(item.proposedSp)
|
| 2774 |
amItem.fbbPriceLastUpdatedOn = datetime.now()
|
2857 |
amItem.fbbPriceLastUpdatedOn = datetime.now()
|
| - |
|
2858 |
elif item.warehouseLocation==3:
|
| - |
|
2859 |
if item.isPromotion:
|
| - |
|
2860 |
amItem.fbgPromoPrice = math.ceil(item.proposedSp)
|
| - |
|
2861 |
else:
|
| - |
|
2862 |
amItem.fbgPrice = math.ceil(item.proposedSp)
|
| - |
|
2863 |
amItem.fbgPriceLastUpdatedOn = datetime.now()
|
| 2775 |
else:
|
2864 |
else:
|
| 2776 |
pass
|
2865 |
continue
|
| 2777 |
session.commit()
|
2866 |
session.commit()
|
| 2778 |
for item in successfulAutoIncrease:
|
2867 |
for item in successfulAutoIncrease:
|
| 2779 |
amItem = Amazonlisted.get_by(itemId=item.item_id)
|
2868 |
amItem = Amazonlisted.get_by(itemId=item.item_id)
|
| 2780 |
if item.warehouseLocation==1:
|
2869 |
if item.warehouseLocation==1:
|
| 2781 |
if item.isPromotion:
|
2870 |
if item.isPromotion:
|
| Line 2787... |
Line 2876... |
| 2787 |
if item.isPromotion:
|
2876 |
if item.isPromotion:
|
| 2788 |
amItem.fbbPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
2877 |
amItem.fbbPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
| 2789 |
else:
|
2878 |
else:
|
| 2790 |
amItem.fbbPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
2879 |
amItem.fbbPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
| 2791 |
amItem.fbbPriceLastUpdatedOn = datetime.now()
|
2880 |
amItem.fbbPriceLastUpdatedOn = datetime.now()
|
| - |
|
2881 |
elif item.warehouseLocation==3:
|
| - |
|
2882 |
if item.isPromotion:
|
| - |
|
2883 |
amItem.fbgPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
| - |
|
2884 |
else:
|
| - |
|
2885 |
amItem.fbgPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
| - |
|
2886 |
amItem.fbgPriceLastUpdatedOn = datetime.now()
|
| 2792 |
else:
|
2887 |
else:
|
| 2793 |
pass
|
2888 |
continue
|
| 2794 |
session.commit()
|
2889 |
session.commit()
|
| 2795 |
|
2890 |
|
| 2796 |
|
2891 |
|
| 2797 |
def main():
|
2892 |
def main():
|
| 2798 |
parser = optparse.OptionParser()
|
2893 |
parser = optparse.OptionParser()
|