Subversion Repositories SmartDukaan

Rev

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

Rev 15948 Rev 15949
Line 100... Line 100...
100
        orderStatus = self.OrderStatusConfirmationMap.get(orderObj['0']['status'])
100
        orderStatus = self.OrderStatusConfirmationMap.get(orderObj['0']['status'])
101
        statusTime= soup.findAll(attrs={'class' : 'sts no_mobile'})[1].contents[2].strip()
101
        statusTime= soup.findAll(attrs={'class' : 'sts no_mobile'})[1].contents[2].strip()
102
        productDetailsMap = {}
102
        productDetailsMap = {}
103
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
103
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
104
        firstRow = orderTable.pop(0)
104
        firstRow = orderTable.pop(0)
105
        totalColumns = len(firstRow.find_all('td'))
105
        totalColumns = len(firstRow.find_all('th'))
106
        jsonSubOrdersMap = {}
106
        jsonSubOrdersMap = {}
107
        count = 1
107
        count = 1
108
        
108
        
109
        for val in orderObj['0']['items'].values():
109
        for val in orderObj['0']['items'].values():
110
            newCount = 0
110
            newCount = 0
Line 135... Line 135...
135
            quantity = int(cols[1].text.strip())
135
            quantity = int(cols[1].text.strip())
136
            sellingPrice = long(cols[2].text.strip().replace("Rs.",""))
136
            sellingPrice = long(cols[2].text.strip().replace("Rs.",""))
137
            discount = 0
137
            discount = 0
138
            subtotal = 0
138
            subtotal = 0
139
            if totalColumns == 5:
139
            if totalColumns == 5:
140
                if cols[3].text.strip()!='-' or 'Rs.' in cols[3].text.strip():
140
                if cols[3].text.strip()!='-' and 'Rs.' in cols[3].text.strip():
141
                    discount = long(cols[3].text.strip().replace("Rs.",""))
141
                    discount = long(cols[3].text.strip().replace("Rs.",""))
142
                else:
142
                else:
143
                    discount = 0
143
                    discount = 0
144
                subtotal = long(cols[4].text.strip().replace("Rs.",""))
144
                subtotal = long(cols[4].text.strip().replace("Rs.",""))
145
            else:
145
            else:
Line 373... Line 373...
373
        subOrderStatus = orderStatusList[0].contents[0].strip()
373
        subOrderStatus = orderStatusList[0].contents[0].strip()
374
        orderDateList = soup.findAll(attrs={'class':'price ord_date'})
374
        orderDateList = soup.findAll(attrs={'class':'price ord_date'})
375
        placedOn= orderDateList[0].text.strip().replace("\t","").replace("\n","").replace("\r","").replace("  ","")    
375
        placedOn= orderDateList[0].text.strip().replace("\t","").replace("\n","").replace("\r","").replace("  ","")    
376
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
376
        orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
377
        firstRow = orderTable.pop(0)
377
        firstRow = orderTable.pop(0)
378
        totalColumns = len(firstRow.find_all('td'))
378
        totalColumns = len(firstRow.find_all('th'))
379
        subOrders =[]
379
        subOrders =[]
380
        count =1   
380
        count =1   
381
        for orderTr in orderTable:
381
        for orderTr in orderTable:
382
            cols = orderTr.find_all('td')
382
            cols = orderTr.find_all('td')
383
            product_details = cols[0].find_all('a')
383
            product_details = cols[0].find_all('a')
Line 387... Line 387...
387
            quantity = int(cols[1].text.strip())
387
            quantity = int(cols[1].text.strip())
388
            sellingPrice = long(cols[2].text.strip().replace("Rs.",""))
388
            sellingPrice = long(cols[2].text.strip().replace("Rs.",""))
389
            discount = 0
389
            discount = 0
390
            subtotal = 0
390
            subtotal = 0
391
            if totalColumns == 5:
391
            if totalColumns == 5:
392
                if cols[3].text.strip()!='-' or 'Rs.' in cols[3].text.strip():
392
                if cols[3].text.strip()!='-' and 'Rs.' in cols[3].text.strip():
393
                    discount = long(cols[3].text.strip().replace("Rs.",""))
393
                    discount = long(cols[3].text.strip().replace("Rs.",""))
394
                else:
394
                else:
395
                    discount = 0
395
                    discount = 0
396
                subtotal = long(cols[4].text.strip().replace("Rs.",""))
396
                subtotal = long(cols[4].text.strip().replace("Rs.",""))
397
            else:
397
            else: