Subversion Repositories SmartDukaan

Rev

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

Rev 9433 Rev 9830
Line 116... Line 116...
116
        SUM((age >= 3 and age < 4) * currentQuantity) AS threeToFourCount, 
116
        SUM((age >= 3 and age < 4) * currentQuantity) AS threeToFourCount, 
117
        SUM((age >= 4) * currentQuantity) as fourPlusCount,
117
        SUM((age >= 4) * currentQuantity) as fourPlusCount,
118
        SUM((age >= 1) * currentQuantity) as onePlusCount,
118
        SUM((age >= 1) * currentQuantity) as onePlusCount,
119
        SUM((age >= 13) * currentQuantity) as threeMonthPlusCount,
119
        SUM((age >= 13) * currentQuantity) as threeMonthPlusCount,
120
        SUM((age >= 26) * currentQuantity) as sixMonthPlusCount,
120
        SUM((age >= 26) * currentQuantity) as sixMonthPlusCount,
121
        SUM((age >= 1) * unitPrice) as onePlusCost,
121
        SUM((age >= 1) * unitPrice*currentQuantity) as onePlusCost,
122
        SUM(currentQuantity) as zeroPlusCount,
122
        SUM(currentQuantity) as zeroPlusCount,
123
        SUM(l.unitPrice) as zeroPlusCost,
123
        SUM(l.unitPrice*currentQuantity) as zeroPlusCost,
124
        l.productGroup as category
124
        l.productGroup as category
125
    FROM  (SELECT ii.id, ii.itemId, ii.currentQuantity, ii.purchaseId,
125
    FROM  (SELECT ii.id, ii.itemId, ii.currentQuantity, ii.purchaseId,
126
                DATEDIFF(now(), MIN(s.scannedAt)) / 7 as age
126
                DATEDIFF(now(), MIN(s.scannedAt)) / 7 as age
127
           FROM inventoryItem ii 
127
           FROM inventoryItem ii 
128
           JOIN scanNew s 
128
           JOIN scanNew s