| 220 |
# cur.execute("select store_id store,sum(amount_paid) amount,count(store_id) quantity ,count(distinct order_id) from allorder group by store_id order by store_id ASC;")
|
220 |
# cur.execute("select store_id store,sum(amount_paid) amount,count(store_id) quantity ,count(distinct order_id) from allorder group by store_id order by store_id ASC;")
|
| 221 |
cur.execute("select name, c.* from store left join (select a.*, b.mtdamount,b.mtdquantity, b.mtdorders from (select store_id, sum(amount_paid), count(*), count(distinct order_id) from allorder where date(created_on)=curdate()-interval 1 day group by store_id) a join (select store_id, sum(amount_paid) mtdamount, count(*) mtdquantity, count(distinct order_id) mtdorders from allorder where created_on >= CURDATE() - interval DAY(CURDATE()-INTERVAL 1 day) day group by store_id) b on a.store_id=b.store_id) as c on name = c.store_id")
|
221 |
cur.execute("select name, c.* from store left join (select b.store_id, a.amount, a.quantity, a.orders, b.mtdamount,b.mtdquantity, b.mtdorders from (select store_id, sum(amount_paid) mtdamount, count(*) mtdquantity, count(distinct order_id) mtdorders from allorder where created_on >= CURDATE() - interval DAY(CURDATE()-INTERVAL 1 day) day group by store_id) b left join (select store_id, sum(amount_paid) amount, count(*) quantity, count(distinct order_id) orders from allorder where date(created_on)=curdate()-interval 1 day group by store_id) a on a.store_id=b.store_id) as c on name = c.store_id")
|
| 226 |
tbody.append(rowtemplate.format(data[0],data[2] if data[2] else "-",data[3] if data[3] else "-",data[4] if data[4] else "-",
|
226 |
tbody.append(rowtemplate.format(data[0],data[2] if data[2] else "-",data[3] if data[3] else "-",data[4] if data[4] else "-",
|