Subversion Repositories SmartDukaan

Rev

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

Rev 33917 Rev 33939
Line 10... Line 10...
10
                        "       a.first_name," +
10
                        "       a.first_name," +
11
                        "       a.warehouse_id," +
11
                        "       a.warehouse_id," +
12
                        "       SUM(a.target)  AS monthly_target" +
12
                        "       SUM(a.target)  AS monthly_target" +
13
                        " FROM (" +
13
                        " FROM (" +
14
                        "         SELECT au.id AS auth_id," +
14
                        "         SELECT au.id AS auth_id," +
15
                        "                au.first_name," +
15
                        "                CONCAT(au.first_name, ' ', au.last_name) AS first_name," +
16
                        "                fs.id AS fofo_id," +
16
                        "                fs.id AS fofo_id," +
17
                        "                fs.target," +
17
                        "                fs.target," +
18
                        "                fs.warehouse_id" +
18
                        "                fs.warehouse_id" +
19
                        "         FROM auth.auth_user au" +
19
                        "         FROM auth.auth_user au" +
20
                        "                  JOIN cs.position p ON p.auth_user_id = au.id" +
20
                        "                  JOIN cs.position p ON p.auth_user_id = au.id" +
Line 23... Line 23...
23
                        "         WHERE pp.partner_id != 0" +
23
                        "         WHERE pp.partner_id != 0" +
24
                        "           AND p.category_id = 18" +
24
                        "           AND p.category_id = 18" +
25
                        "           AND p.escalation_type = 'L1'" +
25
                        "           AND p.escalation_type = 'L1'" +
26
                        "         UNION ALL" +
26
                        "         UNION ALL" +
27
                        "         SELECT au.id AS auth_id," +
27
                        "         SELECT au.id AS auth_id," +
28
                        "                au.first_name," +
28
                        "                CONCAT(au.first_name, ' ', au.last_name) AS first_name," +
29
                        "                fs.id AS fofo_id," +
29
                        "                fs.id AS fofo_id," +
30
                        "                fs.target," +
30
                        "                fs.target," +
31
                        "                fs.warehouse_id" +
31
                        "                fs.warehouse_id" +
32
                        "         FROM auth.auth_user au" +
32
                        "         FROM auth.auth_user au" +
33
                        "                  JOIN cs.position p ON p.auth_user_id = au.id" +
33
                        "                  JOIN cs.position p ON p.auth_user_id = au.id" +