Subversion Repositories SmartDukaan

Rev

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

Rev 16229 Rev 16230
Line 103... Line 103...
103
        
103
        
104
    def _getSingleSubOrderMap(self, orderId, soup, orderObj):
104
    def _getSingleSubOrderMap(self, orderId, soup, orderObj):
105
        orderStatus = self.OrderStatusConfirmationMap.get(orderObj['0']['status'])
105
        orderStatus = self.OrderStatusConfirmationMap.get(orderObj['0']['status'])
106
        statusTime= soup.findAll(attrs={'class' : 'sts no_mobile'})[1].contents[2].strip()
106
        statusTime= soup.findAll(attrs={'class' : 'sts no_mobile'})[1].contents[2].strip()
107
        productDetailsMap = {}
107
        productDetailsMap = {}
108
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
108
        orderTables = soup.body.findAll("table", {'class':'table product-list'})
-
 
109
        orderTable = orderTables[len(orderTables)-1].findAll('tr', recursive=False)
109
        firstRow = orderTable.pop(0)
110
        firstRow = orderTable.pop(0)
110
        totalColumns = len(firstRow.find_all('th'))
111
        totalColumns = len(firstRow.find_all('th'))
111
        jsonSubOrdersMap = {}
112
        jsonSubOrdersMap = {}
112
        count = 1
113
        count = 1
113
        
114
        
Line 175... Line 176...
175
            productDetailsMap[str(orderId)+'-'+str(count)]=productDetailsSubMap
176
            productDetailsMap[str(orderId)+'-'+str(count)]=productDetailsSubMap
176
            count = count +1
177
            count = count +1
177
        return productDetailsMap
178
        return productDetailsMap
178
    
179
    
179
    def _getMultiSubOrdersMap(self, orderId, soup, orderObj):
180
    def _getMultiSubOrdersMap(self, orderId, soup, orderObj):
180
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
181
        orderTables = soup.body.findAll("table", {'class':'table product-list'})
-
 
182
        orderTable = orderTables[len(orderTables)-1].findAll('tr', recursive=False)
181
        firstRow = orderTable.pop(0)
183
        firstRow = orderTable.pop(0)
182
        #totalColumns = len(firstRow.find_all('td'))
184
        #totalColumns = len(firstRow.find_all('td'))
183
        productDetailsMap = {}
185
        productDetailsMap = {}
184
        '''
186
        '''
185
        jsonSubOrdersMap = {}
187
        jsonSubOrdersMap = {}
Line 412... Line 414...
412
    
414
    
413
    def parseSingleSubOrder(self, soup, emailId, subOrderId):
415
    def parseSingleSubOrder(self, soup, emailId, subOrderId):
414
        orderStatusList = soup.findAll(attrs={'class' : 'price ord_status'})
416
        orderStatusList = soup.findAll(attrs={'class' : 'price ord_status'})
415
        subOrderStatus = orderStatusList[0].contents[0].strip()
417
        subOrderStatus = orderStatusList[0].contents[0].strip()
416
        orderDateList = soup.findAll(attrs={'class':'price ord_date'})
418
        orderDateList = soup.findAll(attrs={'class':'price ord_date'})
417
        placedOn= orderDateList[0].text.strip().replace("\t","").replace("\n","").replace("\r","").replace("  ","")    
419
        placedOn= orderDateList[0].text.strip().replace("\t","").replace("\n","").replace("\r","").replace("  ","")
418
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
420
        orderTables = soup.body.findAll("table", {'class':'table product-list'})
-
 
421
        orderTable = orderTables[len(orderTables)-1].findAll('tr', recursive=False)    
419
        firstRow = orderTable.pop(0)
422
        firstRow = orderTable.pop(0)
420
        totalColumns = len(firstRow.find_all('th'))
423
        totalColumns = len(firstRow.find_all('th'))
421
        subOrders =[]
424
        subOrders =[]
422
        count =1   
425
        count =1   
423
        for orderTr in orderTable:
426
        for orderTr in orderTable:
Line 461... Line 464...
461
            
464
            
462
        subOrders = self.updateCashbackInSubOrders(subOrders)
465
        subOrders = self.updateCashbackInSubOrders(subOrders)
463
        return subOrders
466
        return subOrders
464
    
467
    
465
    def parseMultiSubOrders(self, soup, emailId):
468
    def parseMultiSubOrders(self, soup, emailId):
466
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
469
        orderTables = soup.body.findAll("table", {'class':'table product-list'})
-
 
470
        orderTable = orderTables[len(orderTables)-1].findAll('tr', recursive=False)
467
        firstRow = orderTable.pop(0)
471
        firstRow = orderTable.pop(0)
468
        '''
472
        '''
469
        totalColumns = len(firstRow.find_all('td'))
473
        totalColumns = len(firstRow.find_all('td'))
470
        
474
        
471
        orderDateList = soup.findAll(attrs={'class':'price ord_date'})
475
        orderDateList = soup.findAll(attrs={'class':'price ord_date'})
Line 548... Line 552...
548
            if orderIdSpan is not None:
552
            if orderIdSpan is not None:
549
                orderStatusList = soup.findAll(attrs={'class' : 'price ord_status'})
553
                orderStatusList = soup.findAll(attrs={'class' : 'price ord_status'})
550
                if orderStatusList is not None and len(orderStatusList)>0:
554
                if orderStatusList is not None and len(orderStatusList)>0:
551
                    subOrderId = soup.findAll(attrs={'class':'price ord_no'})[0].text.strip()
555
                    subOrderId = soup.findAll(attrs={'class':'price ord_no'})[0].text.strip()
552
                    orderStatus = orderStatusList[0].contents[0].strip()
556
                    orderStatus = orderStatusList[0].contents[0].strip()
553
                    orderTables = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
557
                    orderTables = soup.body.findAll("table", {'class':'table product-list'})
554
                    orderTable = orderTables[len(orderTables)-1].findAll('tr', recursive=False)
558
                    orderTable = orderTables[len(orderTables)-1].findAll('tr', recursive=False)
555
                    orderTable.pop(0)
559
                    orderTable.pop(0)
556
                    count = 1
560
                    count = 1
557
                    while count <= len(orderTable):
561
                    while count <= len(orderTable):
558
                        subbulk = self.db.merchantOrder.initialize_ordered_bulk_op()
562
                        subbulk = self.db.merchantOrder.initialize_ordered_bulk_op()