| Line 510... |
Line 510... |
| 510 |
temp.append(snapdealPricing)
|
510 |
temp.append(snapdealPricing)
|
| 511 |
temp.append(mpItem)
|
511 |
temp.append(mpItem)
|
| 512 |
competitive.append(temp)
|
512 |
competitive.append(temp)
|
| 513 |
continue
|
513 |
continue
|
| 514 |
else:
|
514 |
else:
|
| - |
|
515 |
if (snapdealDetails.lowestSp-getSubsidyDiff(snapdealDetails) > lowestPossibleSp) and snapdealDetails.ourInventory!=0:
|
| 515 |
if lowestTp > lowestPossibleTp and snapdealDetails.ourInventory!=0:
|
516 |
#if lowestTp > lowestPossibleTp and snapdealDetails.ourInventory!=0:
|
| 516 |
temp=[]
|
517 |
temp=[]
|
| 517 |
temp.append(snapdealDetails)
|
518 |
temp.append(snapdealDetails)
|
| 518 |
temp.append(val)
|
519 |
temp.append(val)
|
| 519 |
snapdealPricing = __SnapdealPricing(ourSp,ourTp,lowestTp,lowestPossibleTp,'TP',None,lowestPossibleSp)
|
520 |
snapdealPricing = __SnapdealPricing(ourSp,ourTp,lowestTp,lowestPossibleTp,'TP',None,lowestPossibleSp)
|
| 520 |
temp.append(snapdealPricing)
|
521 |
temp.append(snapdealPricing)
|
| Line 531... |
Line 532... |
| 531 |
temp.append(snapdealPricing)
|
532 |
temp.append(snapdealPricing)
|
| 532 |
temp.append(mpItem)
|
533 |
temp.append(mpItem)
|
| 533 |
competitiveNoInventory.append(temp)
|
534 |
competitiveNoInventory.append(temp)
|
| 534 |
continue
|
535 |
continue
|
| 535 |
else:
|
536 |
else:
|
| - |
|
537 |
if (snapdealDetails.lowestSp-getSubsidyDiff(snapdealDetails) > lowestPossibleSp) and snapdealDetails.ourInventory!=0:
|
| 536 |
#lowest sp - subs diff < lowest pos sp
|
538 |
#lowest sp - subs diff < lowest pos sp
|
| 537 |
if lowestTp > lowestPossibleTp and snapdealDetails.ourInventory==0:
|
539 |
#if lowestTp > lowestPossibleTp and snapdealDetails.ourInventory==0:
|
| 538 |
temp=[]
|
540 |
temp=[]
|
| 539 |
temp.append(snapdealDetails)
|
541 |
temp.append(snapdealDetails)
|
| 540 |
temp.append(val)
|
542 |
temp.append(val)
|
| 541 |
snapdealPricing = __SnapdealPricing(ourSp,ourTp,lowestTp,lowestPossibleTp,'TP',None,lowestPossibleSp)
|
543 |
snapdealPricing = __SnapdealPricing(ourSp,ourTp,lowestTp,lowestPossibleTp,'TP',None,lowestPossibleSp)
|
| 542 |
temp.append(snapdealPricing)
|
544 |
temp.append(snapdealPricing)
|
| Line 1810... |
Line 1812... |
| 1810 |
sys.exit(1)
|
1812 |
sys.exit(1)
|
| 1811 |
timestamp = datetime.now()
|
1813 |
timestamp = datetime.now()
|
| 1812 |
itemInfo= populateStuff(options.runType,timestamp)
|
1814 |
itemInfo= populateStuff(options.runType,timestamp)
|
| 1813 |
cantCompete, buyBoxItems, competitive, \
|
1815 |
cantCompete, buyBoxItems, competitive, \
|
| 1814 |
competitiveNoInventory, exceptionList, negativeMargin = decideCategory(itemInfo)
|
1816 |
competitiveNoInventory, exceptionList, negativeMargin = decideCategory(itemInfo)
|
| 1815 |
previousProcessingTimestamp = session.query(func.max(MarketPlaceHistory.timestamp)).filter(MarketPlaceHistory.source==7).one()
|
1817 |
previousProcessingTimestamp = session.query(func.max(MarketPlaceHistory.timestamp)).filter(MarketPlaceHistory.source==OrderSource.SNAPDEAL).one()
|
| 1816 |
exceptionItems = commitExceptionList(exceptionList,timestamp)
|
1818 |
exceptionItems = commitExceptionList(exceptionList,timestamp)
|
| 1817 |
cantComepeteItems = commitCantCompete(cantCompete,timestamp)
|
1819 |
cantComepeteItems = commitCantCompete(cantCompete,timestamp)
|
| 1818 |
buyBoxList = commitBuyBox(buyBoxItems,timestamp)
|
1820 |
buyBoxList = commitBuyBox(buyBoxItems,timestamp)
|
| 1819 |
competitiveItems = commitCompetitive(competitive,timestamp)
|
1821 |
competitiveItems = commitCompetitive(competitive,timestamp)
|
| 1820 |
competitiveNoInventoryItems = commitCompetitiveNoInventory(competitiveNoInventory,timestamp)
|
1822 |
competitiveNoInventoryItems = commitCompetitiveNoInventory(competitiveNoInventory,timestamp)
|
| Line 1831... |
Line 1833... |
| 1831 |
sendAutoPricingMail(successfulAutoDecrease,successfulAutoIncrease)
|
1833 |
sendAutoPricingMail(successfulAutoDecrease,successfulAutoIncrease)
|
| 1832 |
processLostBuyBoxItems(previousProcessingTimestamp[0],timestamp)
|
1834 |
processLostBuyBoxItems(previousProcessingTimestamp[0],timestamp)
|
| 1833 |
updatePricesOnSnapdeal(successfulAutoDecrease,successfulAutoIncrease)
|
1835 |
updatePricesOnSnapdeal(successfulAutoDecrease,successfulAutoIncrease)
|
| 1834 |
|
1836 |
|
| 1835 |
if __name__ == '__main__':
|
1837 |
if __name__ == '__main__':
|
| 1836 |
main()
|
1838 |
main()
|
| 1837 |
|
1839 |
|