Subversion Repositories SmartDukaan

Rev

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

Rev 36901 Rev 37055
Line 22... Line 22...
22
                        "    c.brand," +
22
                        "    c.brand," +
23
                        "    COALESCE(SUM(os.current_qty), 0) AS available_stock," +
23
                        "    COALESCE(SUM(os.current_qty), 0) AS available_stock," +
24
                        "    COALESCE(sale1.last2daysSale, 0) AS last2DaysSoldQtySum," +
24
                        "    COALESCE(sale1.last2daysSale, 0) AS last2DaysSoldQtySum," +
25
                        "   (CASE" +
25
                        "   (CASE" +
26
                        "         WHEN ((COALESCE(sale1.last2daysSale, 0) * :allocationConst) = 0)" +
26
                        "         WHEN ((COALESCE(sale1.last2daysSale, 0) * :allocationConst) = 0)" +
27
                        "             OR (COALESCE(SUM(os.current_qty), 0) = 0) THEN 2" +
27
                        "             OR (COALESCE(SUM(os.current_qty), 0) = 0) THEN :tierFallback" +
28
                        "         ELSE ROUND((COALESCE(sale1.last2daysSale, 0) * :allocationConst))" +
28
                        "         ELSE ROUND((COALESCE(sale1.last2daysSale, 0) * :allocationConst))" +
29
                        "        END) AS allocation" +
29
                        "        END) AS allocation" +
30
                        " FROM catalog.catagoriesd_catalog cc" +
30
                        " FROM catalog.catagoriesd_catalog cc" +
31
                        "         LEFT JOIN fofo.fofo_opening_stock os ON os.catalog_id = cc.catalog_id AND os.fofo_id = :fofoId" +
31
                        "         LEFT JOIN fofo.fofo_opening_stock os ON os.catalog_id = cc.catalog_id AND os.fofo_id = :fofoId" +
32
                        "         LEFT JOIN (" +
32
                        "         LEFT JOIN (" +