Subversion Repositories SmartDukaan

Rev

Rev 15799 | Rev 15801 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15799 Rev 15800
Line 79... Line 79...
79
                product = None
79
                product = None
80
                if storeId in (1,2,4,5):
80
                if storeId in (1,2,4,5):
81
                    product = list(masterDataCollection.find({'identifier':subOrder['productCode'].strip(), 'source_id':storeId}))
81
                    product = list(masterDataCollection.find({'identifier':subOrder['productCode'].strip(), 'source_id':storeId}))
82
                elif storeId == 3:
82
                elif storeId == 3:
83
                    product = list(masterDataCollection.find({'secondaryIdentifier':subOrder['productCode'].strip(), 'source_id':storeId}))
83
                    product = list(masterDataCollection.find({'secondaryIdentifier':subOrder['productCode'].strip(), 'source_id':storeId}))
84
                if product is not None:
84
                if product is not None and len(product)>0:
85
                    merchantSubOrder.brand = product[0]["brand"]
85
                    merchantSubOrder.brand = product[0]["brand"]
86
                else:
86
                else:
87
                    merchantSubOrder.brand = 'NA'
87
                    merchantSubOrder.brand = 'NA'
88
                
88
                
89
                existingMerchantSubOrder = MerchantSubOrders.query.filter(MerchantSubOrders.orderId == orderId).filter(MerchantSubOrders.merchantOrderId == merchantOrderId).filter(MerchantSubOrders.merchantSubOrderId == merchantSubOrder.merchantSubOrderId).first()
89
                existingMerchantSubOrder = MerchantSubOrders.query.filter(MerchantSubOrders.orderId == orderId).filter(MerchantSubOrders.merchantOrderId == merchantOrderId).filter(MerchantSubOrders.merchantSubOrderId == merchantSubOrder.merchantSubOrderId).first()