| Line 82... |
Line 82... |
| 82 |
+ " i.brand, i.modelName, i.modelNumber, i.color,Sum(li.quantity), Sum(CAST(o.totalAmount As int)))"
|
82 |
+ " i.brand, i.modelName, i.modelNumber, i.color,Sum(li.quantity), Sum(CAST(o.totalAmount As int)))"
|
| 83 |
+ " from Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId where o.status in (7,9,10,12)"
|
83 |
+ " from Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId where o.status in (7,9,10,12)"
|
| 84 |
+ " and o.billingTimestamp >= :startDate and o.billingTimestamp <= :endDate and o.retailerId = :fofoId group by i.id"),
|
84 |
+ " and o.billingTimestamp >= :startDate and o.billingTimestamp <= :endDate and o.retailerId = :fofoId group by i.id"),
|
| 85 |
|
85 |
|
| 86 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
86 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
| 87 |
+ " fs.id,sum(li.quantity )) from FofoStore fs join Order o on fs.id = o.retailerId "
|
87 |
+ " fs.warehouseId,fs.id,sum(li.quantity )) from FofoStore fs join Order o on fs.id = o.retailerId "
|
| 88 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
88 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 89 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
89 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| 90 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
90 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
| 91 |
+ " and i.catalogItemId = :catalogItemId group by fs.id"),
|
91 |
+ " and i.catalogItemId in :catalogItemId group by fs.id"),
|
| 92 |
|
92 |
|
| 93 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
93 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
| 94 |
+ " fs.id,sum(case when li.quantity is null then 0 else li.quantity end))"
|
94 |
+ " fs.warehouseId,fs.id,sum(case when li.quantity is null then 0 else li.quantity end))"
|
| 95 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
95 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
| 96 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|
96 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|
| 97 |
+ " join Item i on i.id = tl.itemId where "
|
97 |
+ " join Item i on i.id = tl.itemId where "
|
| 98 |
+ " fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId = :catalogItemId group by fs.id"),
|
98 |
+ " fs.active = 1 and fs.internal = 0 and o.status in (3,4) and i.catalogItemId in :catalogItemId group by fs.id"),
|
| 99 |
|
99 |
|
| 100 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
100 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 101 |
+ " fs.id,sum(li.quantity ),i.brand,i.modelName,i.modelNumber,i.catalogItemId) from FofoStore fs join Order o on fs.id = o.retailerId "
|
101 |
+ " fs.warehouseId,fs.id,sum(li.quantity ),i.brand,i.modelName,i.modelNumber,i.catalogItemId) from FofoStore fs join Order o on fs.id = o.retailerId "
|
| 102 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
102 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 103 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
103 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| 104 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
104 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
| 105 |
+ " and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|
105 |
+ " and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|
| 106 |
|
106 |
|
| 107 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
107 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 108 |
+ " fs.id,sum(case when li.quantity is null then 0 else li.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
|
108 |
+ " fs.warehouseId, fs.id,sum(case when li.quantity is null then 0 else li.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
|
| 109 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
109 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
| 110 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|
110 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|
| 111 |
+ " join Item i on i.id = tl.itemId where "
|
111 |
+ " join Item i on i.id = tl.itemId where "
|
| 112 |
+ " fs.active = 1 and fs.internal = 0 and o.status in (3,4) and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|
112 |
+ " fs.active = 1 and fs.internal = 0 and o.status in (3,4) and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|
| 113 |
|
113 |
|