Subversion Repositories SmartDukaan

Rev

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

Rev 17218 Rev 17219
Line 221... Line 221...
221
            select name, c.* from store left join (select b.store_id, a.amount, a.quantity, a.orders, b.mtdamount,b.mtdquantity, b.mtdorders from   
221
            select name, c.* from store left join (select b.store_id, a.amount, a.quantity, a.orders, b.mtdamount,b.mtdquantity, b.mtdorders from   
222
            (select ifnull(store_id, 'total') as store_id, sum(amount_paid) mtdamount, count(*) mtdquantity,  count(distinct order_id) mtdorders  from allorder 
222
            (select ifnull(store_id, 'total') as store_id, sum(amount_paid) mtdamount, count(*) mtdquantity,  count(distinct order_id) mtdorders  from allorder 
223
                where created_on >= CURDATE() -  interval DAY(CURDATE()-INTERVAL 1 day) day and created_on < CURDATE() group by store_id with rollup) b 
223
                where created_on >= CURDATE() -  interval DAY(CURDATE()-INTERVAL 1 day) day and created_on < CURDATE() group by store_id with rollup) b 
224
            left join  
224
            left join  
225
            (select ifnull(store_id, 'total') as store_id, sum(amount_paid) amount, count(*) quantity,  count(distinct order_id) orders  from allorder 
225
            (select ifnull(store_id, 'total') as store_id, sum(amount_paid) amount, count(*) quantity,  count(distinct order_id) orders  from allorder 
226
                where date(created_on)=curdate() day group by store_id with rollup) a   
226
                where date(created_on)=curdate()-interval 1 day group by store_id with rollup) a   
227
            on a.store_id=b.store_id) as c on name = c.store_id''')
227
            on a.store_id=b.store_id) as c on name = c.store_id''')
228
        rows = cur.fetchall()
228
        rows = cur.fetchall()
229
        tbody =[]
229
        tbody =[]
230
        rowtemplate="<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td>{5}</td><td>{6}</td></tr>"
230
        rowtemplate="<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td>{5}</td><td>{6}</td></tr>"
231
        for data in rows:
231
        for data in rows: