| Line 34... |
Line 34... |
| 34 |
now = datetime.now()
|
34 |
now = datetime.now()
|
| 35 |
|
35 |
|
| 36 |
class __SkuInfo:
|
36 |
class __SkuInfo:
|
| 37 |
|
37 |
|
| 38 |
def __init__(self, _id, skuBundleId, category_id, mrp, available_price, source_id, rank, maxNlc, minNlc, schemeAmount, minDiscount, \
|
38 |
def __init__(self, _id, skuBundleId, category_id, mrp, available_price, source_id, rank, maxNlc, minNlc, schemeAmount, minDiscount, \
|
| 39 |
maxDiscount, discountType, dp, nlcPoints, status, in_stock, maxprice, brand, dealType, dealPoints, brand_id, manualDealThresholdPrice,\
|
39 |
maxDiscount, discountType, dp, nlcPoints, status, in_stock, maxprice, brand, dealType, brand_id, manualDealThresholdPrice,\
|
| 40 |
codAvailable,showDp,gross_price):
|
40 |
codAvailable,showDp,gross_price):
|
| 41 |
self._id = _id
|
41 |
self._id = _id
|
| 42 |
self.skuBundleId = skuBundleId
|
42 |
self.skuBundleId = skuBundleId
|
| 43 |
self.category_id = category_id
|
43 |
self.category_id = category_id
|
| 44 |
self.mrp = mrp
|
44 |
self.mrp = mrp
|
| Line 56... |
Line 56... |
| 56 |
self.status = status
|
56 |
self.status = status
|
| 57 |
self.in_stock = in_stock
|
57 |
self.in_stock = in_stock
|
| 58 |
self.maxprice = maxprice
|
58 |
self.maxprice = maxprice
|
| 59 |
self.brand = brand
|
59 |
self.brand = brand
|
| 60 |
self.dealType = dealType
|
60 |
self.dealType = dealType
|
| 61 |
self.dealPoints = dealPoints
|
- |
|
| 62 |
self.brand_id = brand_id
|
61 |
self.brand_id = brand_id
|
| 63 |
self.manualDealThresholdPrice = manualDealThresholdPrice
|
62 |
self.manualDealThresholdPrice = manualDealThresholdPrice
|
| 64 |
self.codAvailable = codAvailable
|
63 |
self.codAvailable = codAvailable
|
| 65 |
self.showDp = showDp
|
64 |
self.showDp = showDp
|
| 66 |
self.gross_price = gross_price
|
65 |
self.gross_price = gross_price
|
| Line 91... |
Line 90... |
| 91 |
#topSkus = collection.find( {'_id':664})
|
90 |
#topSkus = collection.find( {'_id':664})
|
| 92 |
for sku in topSkus:
|
91 |
for sku in topSkus:
|
| 93 |
"""Fix this """
|
92 |
"""Fix this """
|
| 94 |
#TODO Compute deal flags else where.
|
93 |
#TODO Compute deal flags else where.
|
| 95 |
info = __SkuInfo(sku['_id'], sku['skuBundleId'], sku['category_id'], sku['mrp'], sku['available_price'], sku['source_id'], sku['rank'], None, None, 0.0, None, \
|
94 |
info = __SkuInfo(sku['_id'], sku['skuBundleId'], sku['category_id'], sku['mrp'], sku['available_price'], sku['source_id'], sku['rank'], None, None, 0.0, None, \
|
| 96 |
None, None, None, None, sku['status'], sku['in_stock'],sku['maxPrice'],sku['brand'].strip().upper(), 0, 0, sku['brand_id'], None, sku['codAvailable'], 0, sku['gross_price'])
|
95 |
None, None, None, None, sku['status'], sku['in_stock'],sku['maxPrice'],sku['brand'].strip().upper(), 0, sku['brand_id'], None, sku['codAvailable'], 0, sku['gross_price'])
|
| 97 |
exceptionalNlc = list(get_mongo_connection().Catalog.ExceptionalNlc.find( {"$and" : [ {'skuBundleId':info.skuBundleId}, {'overrideNlc':1} ]} ))
|
96 |
exceptionalNlc = list(get_mongo_connection().Catalog.ExceptionalNlc.find( {"$and" : [ {'skuBundleId':info.skuBundleId}, {'overrideNlc':1} ]} ))
|
| 98 |
if len(exceptionalNlc) > 0:
|
97 |
if len(exceptionalNlc) > 0:
|
| 99 |
"""Exceptional nlc found, no need to calculate max and min R-nlc"""
|
98 |
"""Exceptional nlc found, no need to calculate max and min R-nlc"""
|
| 100 |
info.maxNlc = exceptionalNlc[0]['maxNlc']
|
99 |
info.maxNlc = exceptionalNlc[0]['maxNlc']
|
| 101 |
info.minNlc = exceptionalNlc[0]['minNlc']
|
100 |
info.minNlc = exceptionalNlc[0]['minNlc']
|