Subversion Repositories SmartDukaan

Rev

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

Rev 6714 Rev 9340
Line 44... Line 44...
44
                          i.color, d.monthname, d.monthnumber, d.dayofmonth, sum(quantity) as quantity 
44
                          i.color, d.monthname, d.monthnumber, d.dayofmonth, sum(quantity) as quantity 
45
                          from sales s 
45
                          from sales s 
46
                          join item i on (i.id = s.item_id) 
46
                          join item i on (i.id = s.item_id) 
47
                          join datedim d on (d.date_id = s.date_id)
47
                          join datedim d on (d.date_id = s.date_id)
48
                          join orderstatus os on (s.status = os.status) 
48
                          join orderstatus os on (s.status = os.status) 
49
                          where d.monthnumber in (month(now()), month(now())-1)
49
                          where d.fulldate <= curdate() and d.fulldate >= date_sub(curdate(), interval 1 month)
50
                          and d.year in (year(now()))
-
 
51
                          and os.statusGroup in ('In process', 'Delivered', 'Cancelled', 'Return in process', 'Reshipped', 'Refunded')
50
                          and os.statusGroup in ('In process', 'Delivered', 'Cancelled', 'Return in process', 'Reshipped', 'Refunded')
52
                          and os.statusSubGroup != 'Cod verification failed'
51
                          and os.statusSubGroup != 'Cod verification failed'
53
                          group by i.parent_category, i.category, i.brand, IFNULL(i.model_name, ''), 
52
                          group by i.parent_category, i.category, i.brand, IFNULL(i.model_name, ''), 
54
                                   IFNULL(i.model_number, ''), i.color, d.monthname, d.monthnumber, d.dayofmonth
53
                                   IFNULL(i.model_number, ''), i.color, d.monthname, d.monthnumber, d.dayofmonth
-
 
54
 
55
                '''
55
                '''
56
    conn = getDbConnection()
56
    conn = getDbConnection()
57
    monthdatesmap = {}
57
    monthdatesmap = {}
58
    prodsalesmap = {}
58
    prodsalesmap = {}
59
    try:
59
    try: