| Line 56... |
Line 56... |
| 56 |
|
56 |
|
| 57 |
class __SkuInfo:
|
57 |
class __SkuInfo:
|
| 58 |
|
58 |
|
| 59 |
def __init__(self, _id, skuBundleId, category_id, mrp, available_price, source_id, rank, maxNlc, minNlc, schemeAmount, minDiscount, \
|
59 |
def __init__(self, _id, skuBundleId, category_id, mrp, available_price, source_id, rank, maxNlc, minNlc, schemeAmount, minDiscount, \
|
| 60 |
maxDiscount, discountType, dp, nlcPoints, status, in_stock, maxprice, brand, dealType, brand_id, manualDealThresholdPrice,\
|
60 |
maxDiscount, discountType, dp, nlcPoints, status, in_stock, maxprice, brand, dealType, brand_id, manualDealThresholdPrice,\
|
| 61 |
codAvailable,showDp,gross_price, subCategoryId,subCategory,shippingCost,netPriceAfterCashBack, exclusive):
|
61 |
codAvailable,showDp,gross_price, subCategoryId,subCategory,shippingCost,netPriceAfterCashBack):
|
| 62 |
self._id = _id
|
62 |
self._id = _id
|
| 63 |
self.skuBundleId = skuBundleId
|
63 |
self.skuBundleId = skuBundleId
|
| 64 |
self.category_id = category_id
|
64 |
self.category_id = category_id
|
| 65 |
self.mrp = mrp
|
65 |
self.mrp = mrp
|
| 66 |
self.available_price = available_price
|
66 |
self.available_price = available_price
|
| Line 86... |
Line 86... |
| 86 |
self.gross_price = gross_price
|
86 |
self.gross_price = gross_price
|
| 87 |
self.subCategoryId = subCategoryId
|
87 |
self.subCategoryId = subCategoryId
|
| 88 |
self.subCategory = subCategory
|
88 |
self.subCategory = subCategory
|
| 89 |
self.shippingCost = shippingCost
|
89 |
self.shippingCost = shippingCost
|
| 90 |
self.netPriceAfterCashBack = netPriceAfterCashBack
|
90 |
self.netPriceAfterCashBack = netPriceAfterCashBack
|
| 91 |
self.exclusive = exclusive
|
- |
|
| 92 |
|
91 |
|
| 93 |
|
92 |
|
| 94 |
def get_mongo_connection(host=options.mongoHost, port=27017):
|
93 |
def get_mongo_connection(host=options.mongoHost, port=27017):
|
| 95 |
global con
|
94 |
global con
|
| 96 |
if con is None:
|
95 |
if con is None:
|
| Line 125... |
Line 124... |
| 125 |
else:
|
124 |
else:
|
| 126 |
netPriceAfterCashBack = getNetPriceForItem(sku['_id'], sku['source_id'], sku['category_id'], sku['available_price'])
|
125 |
netPriceAfterCashBack = getNetPriceForItem(sku['_id'], sku['source_id'], sku['category_id'], sku['available_price'])
|
| 127 |
|
126 |
|
| 128 |
info = __SkuInfo(sku['_id'], sku['skuBundleId'], sku['category_id'], sku['mrp'], sku['available_price'], sku['source_id'], sku['rank'], None, None, 0.0, None, \
|
127 |
info = __SkuInfo(sku['_id'], sku['skuBundleId'], sku['category_id'], sku['mrp'], sku['available_price'], sku['source_id'], sku['rank'], None, None, 0.0, None, \
|
| 129 |
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'], sku['subCategoryId'], \
|
128 |
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'], sku['subCategoryId'], \
|
| 130 |
sku['subCategory'],sku['shippingCost'],netPriceAfterCashBack, sku['exclusive'])
|
129 |
sku['subCategory'],sku['shippingCost'],netPriceAfterCashBack)
|
| 131 |
exceptionalNlc = list(get_mongo_connection().Catalog.ExceptionalNlc.find( {"$and" : [ {'skuBundleId':info.skuBundleId}, {'overrideNlc':1} ]} ))
|
130 |
exceptionalNlc = list(get_mongo_connection().Catalog.ExceptionalNlc.find( {"$and" : [ {'skuBundleId':info.skuBundleId}, {'overrideNlc':1} ]} ))
|
| 132 |
if len(exceptionalNlc) > 0:
|
131 |
if len(exceptionalNlc) > 0:
|
| 133 |
"""Exceptional nlc found, no need to calculate max and min R-nlc"""
|
132 |
"""Exceptional nlc found, no need to calculate max and min R-nlc"""
|
| 134 |
info.maxNlc = exceptionalNlc[0]['maxNlc']
|
133 |
info.maxNlc = exceptionalNlc[0]['maxNlc']
|
| 135 |
info.minNlc = exceptionalNlc[0]['minNlc']
|
134 |
info.minNlc = exceptionalNlc[0]['minNlc']
|