Subversion Repositories SmartDukaan

Rev

Rev 37443 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37443 Rev 37943
Line 25... Line 25...
25
                        "                JOIN cs.partner_position pp ON pp.position_id = p.id" +
25
                        "                JOIN cs.partner_position pp ON pp.position_id = p.id" +
26
                        "                JOIN fofo.fofo_store fs ON fs.id = pp.partner_id" +
26
                        "                JOIN fofo.fofo_store fs ON fs.id = pp.partner_id" +
27
                        "       WHERE pp.partner_id != 0" +
27
                        "       WHERE pp.partner_id != 0" +
28
                        "         AND p.category_id = 18" +
28
                        "         AND p.category_id = 18" +
29
                        "         AND p.escalation_type = 'L1'" +
29
                        "         AND p.escalation_type = 'L1'" +
30
                        "         AND fs.active = 1" +
30
                        "         AND fs.store_status in ('ACTIVE','PAUSED')" +
31
                        "         AND fs.internal = false" +
31
                        "         AND fs.internal = false" +
32
                        "       UNION ALL" +
32
                        "       UNION ALL" +
33
                        "       SELECT au.id AS auth_id, fs.id AS fofo_id, fs.warehouse_id" +
33
                        "       SELECT au.id AS auth_id, fs.id AS fofo_id, fs.warehouse_id" +
34
                        "       FROM auth.auth_user au" +
34
                        "       FROM auth.auth_user au" +
35
                        "                JOIN cs.position p ON p.auth_user_id = au.id" +
35
                        "                JOIN cs.position p ON p.auth_user_id = au.id" +
Line 37... Line 37...
37
                        "                JOIN cs.region r ON pp.region_id = r.id" +
37
                        "                JOIN cs.region r ON pp.region_id = r.id" +
38
                        "                JOIN cs.partner_region pr ON pr.region_id = pp.region_id" +
38
                        "                JOIN cs.partner_region pr ON pr.region_id = pp.region_id" +
39
                        "                JOIN fofo.fofo_store fs ON fs.id = pr.fofo_id" +
39
                        "                JOIN fofo.fofo_store fs ON fs.id = pr.fofo_id" +
40
                        "       WHERE pp.partner_id = 0" +
40
                        "       WHERE pp.partner_id = 0" +
41
                        "         AND p.category_id = 18" +
41
                        "         AND p.category_id = 18" +
42
                        "         AND fs.active = 1" +
42
                        "         AND fs.store_status in ('ACTIVE','PAUSED')" +
43
                        "         AND fs.internal = false" +
43
                        "         AND fs.internal = false" +
44
                        "         AND p.escalation_type = 'L1') a" +
44
                        "         AND p.escalation_type = 'L1') a" +
45
                        " JOIN transaction.order odr ON odr.customer_id = a.fofo_id" +
45
                        " JOIN transaction.order odr ON odr.customer_id = a.fofo_id" +
46
                        " JOIN transaction.lineitem li ON li.order_id = odr.id" +
46
                        " JOIN transaction.lineitem li ON li.order_id = odr.id" +
47
                        " JOIN catalog.item i ON i.id = li.item_id" +
47
                        " JOIN catalog.item i ON i.id = li.item_id" +