Subversion Repositories SmartDukaan

Rev

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

Rev 7210 Rev 7216
Line 77... Line 77...
77
        ON (l.itemId = i.itemId AND l.purchaseOrder_id = po.id)
77
        ON (l.itemId = i.itemId AND l.purchaseOrder_id = po.id)
78
    JOIN supplier s
78
    JOIN supplier s
79
        ON (s.id = po.supplierId)
79
        ON (s.id = po.supplierId)
80
    JOIN invoice inv
80
    JOIN invoice inv
81
    	ON (inv.invoiceNumber = p.invoiceNumber)
81
    	ON (inv.invoiceNumber = p.invoiceNumber)
82
    WHERE p.receivedOn BETWEEN #{startDate} AND #{endDate} 
82
    WHERE p.receivedOn BETWEEN #{startDate} AND #{endDate}
-
 
83
    AND inv.date  < #{endDate}
83
    AND lastScanType != 'DOA_REPLACED' 
84
    AND lastScanType != 'DOA_REPLACED' 
84
    GROUP BY p.id, i.itemId
85
    GROUP BY p.id, i.itemId
85
    ORDER BY p.id, i.itemId
86
    ORDER BY p.id, i.itemId
86
  </select>
87
  </select>
87
  
88
  
Line 271... Line 272...
271
 	LEFT JOIN catalog.item c ON i.itemId = c.id 
272
 	LEFT JOIN catalog.item c ON i.itemId = c.id 
272
 	where s.scannedAt between #{startDate} and #{endDate} and c.type = 'NON_SERIALIZED'
273
 	where s.scannedAt between #{startDate} and #{endDate} and c.type = 'NON_SERIALIZED'
273
 	and i.currentWarehouseId not in (1,2,6,9)  
274
 	and i.currentWarehouseId not in (1,2,6,9)  
274
 	group by itemId, s.type
275
 	group by itemId, s.type
275
 </select>
276
 </select>
-
 
277
 
-
 
278
 <select id = "getCompleteMovementSerializedInventoryByScans" resultType = "inventoryMovement" parameterType = "map">
-
 
279
 	select itemId, brand, model_name as modelName, model_number as modelNumber, color, s.type, count(*) as quantity 
-
 
280
 	FROM inventoryItem i JOIN scanNew s ON i.id = s.inventoryItemId 
-
 
281
 	LEFT JOIN catalog.item c ON i.itemId = c.id 
-
 
282
 	where s.scannedAt between #{startDate} and #{endDate} and c.type = 'SERIALIZED'
-
 
283
 	group by itemId, s.type
-
 
284
 </select>
-
 
285
 
-
 
286
 <select id = "getCompleteMovementNonSerializedInventoryByScans" resultType = "inventoryMovement" parameterType = "map">
-
 
287
 	select itemId, brand, model_name as modelName, model_number as modelNumber, color, s.type, sum(quantity) as quantity 
-
 
288
 	FROM inventoryItem i JOIN scanNew s ON i.id = s.inventoryItemId 
-
 
289
 	LEFT JOIN catalog.item c ON i.itemId = c.id 
-
 
290
 	where s.scannedAt between #{startDate} and #{endDate} and c.type = 'NON_SERIALIZED'
-
 
291
 	group by itemId, s.type
-
 
292
 </select>
276
  
293
  
277
</mapper>
294
</mapper>