| Line 208... |
Line 208... |
| 208 |
else:
|
208 |
else:
|
| 209 |
alldata = "'"+data[0]+"'"
|
209 |
alldata = "'"+data[0]+"'"
|
| 210 |
tbody.append(rowtemplate_brand.format(data[0],data[1],data[2],data[3]))
|
210 |
tbody.append(rowtemplate_brand.format(data[0],data[1],data[2],data[3]))
|
| 211 |
|
211 |
|
| 212 |
print alldata
|
212 |
print alldata
|
| 213 |
cur.execute('''select sum(amount_paid) amount,count(*) quantity,count(distinct order_id) from allorder
|
- |
|
| 214 |
where created_on >= CURDATE() - interval 1 day and created_on < CURDATE() and brand not in("+alldata+")
|
213 |
cur.execute("select sum(amount_paid) amount,count(*) quantity,count(distinct order_id) from allorder where created_on >= CURDATE() - interval 1 day and created_on < CURDATE() and brand not in("+alldata+")")
|
| 215 |
''')
|
- |
|
| 216 |
row_other = cur.fetchall()
|
214 |
row_other = cur.fetchall()
|
| 217 |
print row_other
|
215 |
print row_other
|
| 218 |
for data in row_other:
|
216 |
for data in row_other:
|
| 219 |
sheet1.write(row,0,'Other')
|
217 |
sheet1.write(row,0,'Other')
|
| 220 |
sheet1.write(row,1,data[0])
|
218 |
sheet1.write(row,1,data[0])
|
| Line 248... |
Line 246... |
| 248 |
else:
|
246 |
else:
|
| 249 |
alldata = "'"+data[0]+"'"
|
247 |
alldata = "'"+data[0]+"'"
|
| 250 |
tbody.append(rowtemplate_brand.format(data[0],data[1],data[2],data[3]))
|
248 |
tbody.append(rowtemplate_brand.format(data[0],data[1],data[2],data[3]))
|
| 251 |
|
249 |
|
| 252 |
print alldata
|
250 |
print alldata
|
| 253 |
cur.execute(''''select sum(amount_paid) amount,count(*) quantity,count(distinct order_id) from allorder where
|
251 |
cur.execute("select sum(amount_paid) amount,count(*) quantity,count(distinct order_id) from allorder where created_on >= CURDATE() - interval DAY(CURDATE()-INTERVAL 1 day) day and created_on < CURDATE() AND brand not in("+alldata+")")
|
| 254 |
created_on >= CURDATE() - interval DAY(CURDATE()-INTERVAL 1 day) day and
|
- |
|
| 255 |
created_on < CURDATE() AND brand not in("+alldata+")''')
|
- |
|
| 256 |
mtd_row_other = cur.fetchall()
|
252 |
mtd_row_other = cur.fetchall()
|
| 257 |
print row_other
|
253 |
print row_other
|
| 258 |
for data in mtd_row_other:
|
254 |
for data in mtd_row_other:
|
| 259 |
sheet1.write(row,0,'Other')
|
255 |
sheet1.write(row,0,'Other')
|
| 260 |
sheet1.write(row,1,data[0])
|
256 |
sheet1.write(row,1,data[0])
|