| Line 23... |
Line 23... |
| 23 |
+ " sum(case when sn.scannedAt >= :threedays and sn.scannedAt < :endDate then CAST(sn.quantity AS int) else 0 end),"
|
23 |
+ " sum(case when sn.scannedAt >= :threedays and sn.scannedAt < :endDate then CAST(sn.quantity AS int) else 0 end),"
|
| 24 |
+ " sum(case when sn.scannedAt >= :dataDate and sn.scannedAt <= :lmsEndDate then CAST(sn.quantity AS int) else 0 end),"
|
24 |
+ " sum(case when sn.scannedAt >= :dataDate and sn.scannedAt <= :lmsEndDate then CAST(sn.quantity AS int) else 0 end),"
|
| 25 |
+ " sum(case when sn.scannedAt >= :mtd then CAST(sn.quantity AS int) else 0 end)" + " )"
|
25 |
+ " sum(case when sn.scannedAt >= :mtd then CAST(sn.quantity AS int) else 0 end)" + " )"
|
| 26 |
+ " from WarehouseScan sn join WarehouseInventoryItem it on sn.inventoryItemId = it.id join WarehousePurchase p on it.purchaseId = p.id "
|
26 |
+ " from WarehouseScan sn join WarehouseInventoryItem it on sn.inventoryItemId = it.id join WarehousePurchase p on it.purchaseId = p.id "
|
| 27 |
+ " join WarehousePurchaseOrder po on po.id = p.poId join WarehouseLineItem li on li.purchaseOrderId = po.id and li.itemId = it.itemId "
|
27 |
+ " join WarehousePurchaseOrder po on po.id = p.poId join WarehouseLineItem li on li.purchaseOrderId = po.id and li.itemId = it.itemId "
|
| - |
|
28 |
+ " join Supplier s on s.id=po.supplierId "
|
| 28 |
+ " where po.warehouseId in :warehouseId and sn.scannedAt >= :dataDate and sn.type = 'PURCHASE' group by li.brand"),
|
29 |
+ " where po.warehouseId in :warehouseId and sn.scannedAt >= :dataDate and sn.type = 'PURCHASE' and s.internal = false group by li.brand"),
|
| 29 |
|
30 |
|
| 30 |
@NamedQuery(name = "warehouse.selectOurPurchaseItemByBrand", query = "select new com.spice.profitmandi.dao.model.OurPurchaseItemModel(po.warehouseId,li.brand,li.modelName, li.modelNumber, li.color,"
|
31 |
@NamedQuery(name = "warehouse.selectOurPurchaseItemByBrand", query = "select new com.spice.profitmandi.dao.model.OurPurchaseItemModel(po.warehouseId,li.brand,li.modelName, li.modelNumber, li.color,"
|
| 31 |
+ " sn.quantity * li.unitPrice , sn.quantity)"
|
32 |
+ " sn.quantity * li.unitPrice , sn.quantity)"
|
| 32 |
+ " from WarehouseScan sn join WarehouseInventoryItem it on sn.inventoryItemId = it.id join WarehousePurchase p on it.purchaseId = p.id "
|
33 |
+ " from WarehouseScan sn join WarehouseInventoryItem it on sn.inventoryItemId = it.id join WarehousePurchase p on it.purchaseId = p.id "
|
| 33 |
+ " join WarehousePurchaseOrder po on po.id = p.poId join WarehouseLineItem li on li.purchaseOrderId = po.id and li.itemId = it.itemId "
|
34 |
+ " join WarehousePurchaseOrder po on po.id = p.poId join WarehouseLineItem li on li.purchaseOrderId = po.id and li.itemId = it.itemId "
|