| Line 90... |
Line 90... |
| 90 |
|
90 |
|
| 91 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
91 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
| 92 |
+ " fs.warehouseId,fs.id,sum(li.quantity )) from FofoStore fs join Order o on fs.id = o.retailerId "
|
92 |
+ " fs.warehouseId,fs.id,sum(li.quantity )) from FofoStore fs join Order o on fs.id = o.retailerId "
|
| 93 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
93 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 94 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
94 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| 95 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
95 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null"
|
| 96 |
+ " and i.catalogItemId in :catalogItemId group by fs.id"),
|
96 |
+ " and i.catalogItemId in :catalogItemId group by fs.id"),
|
| 97 |
|
97 |
|
| 98 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
98 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
|
| 99 |
+ " fs.warehouseId,fs.id,sum(case when li.quantity is null then 0 else li.quantity end))"
|
99 |
+ " fs.warehouseId,fs.id,sum(case when li.quantity is null then 0 else li.quantity end))"
|
| 100 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
100 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
| Line 104... |
Line 104... |
| 104 |
|
104 |
|
| 105 |
@NamedQuery(name = "Order.selectGrnPendingOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
|
105 |
@NamedQuery(name = "Order.selectGrnPendingOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
|
| 106 |
+ " fs.warehouseId,fs.id,i.catalogItemId,sum(li.quantity )) from FofoStore fs join Order o on fs.id = o.retailerId "
|
106 |
+ " fs.warehouseId,fs.id,i.catalogItemId,sum(li.quantity )) from FofoStore fs join Order o on fs.id = o.retailerId "
|
| 107 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
107 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 108 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
108 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| 109 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
109 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null"
|
| 110 |
+ " and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
|
110 |
+ " and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
|
| 111 |
|
111 |
|
| 112 |
@NamedQuery(name = "Order.selectPendingIndentOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
|
112 |
@NamedQuery(name = "Order.selectPendingIndentOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
|
| 113 |
+ " fs.warehouseId,fs.id,i.catalogItemId,sum(case when li.quantity is null then 0 else li.quantity end))"
|
113 |
+ " fs.warehouseId,fs.id,i.catalogItemId,sum(case when li.quantity is null then 0 else li.quantity end))"
|
| 114 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
114 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
| Line 118... |
Line 118... |
| 118 |
|
118 |
|
| 119 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
119 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 120 |
+ " 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 "
|
120 |
+ " 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 "
|
| 121 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
121 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 122 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
122 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| 123 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
123 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null"
|
| 124 |
+ " and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|
124 |
+ " and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
|
| 125 |
|
125 |
|
| 126 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
126 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 127 |
+ " 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)"
|
127 |
+ " 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)"
|
| 128 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
128 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
| Line 132... |
Line 132... |
| 132 |
|
132 |
|
| 133 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
133 |
@NamedQuery(name = "Order.selectAllGrnPendingOrderItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 134 |
+ " 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 "
|
134 |
+ " 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 "
|
| 135 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
135 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 136 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
136 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| 137 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
137 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null"
|
| 138 |
+ " and i.catalogItemId in :catalogItemId and i.categoryId=10006 and fs.id = :fofoId group by i.catalogItemId, i.brand,i.modelName,i.modelNumber"),
|
138 |
+ " and i.catalogItemId in :catalogItemId and i.categoryId=10006 and fs.id = :fofoId group by i.catalogItemId, i.brand,i.modelName,i.modelNumber"),
|
| 139 |
|
139 |
|
| 140 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
140 |
@NamedQuery(name = "Order.selectAllPendingIndentOrderItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
|
| 141 |
+ " fs.warehouseId, fs.id, sum(li.quantity), i.brand, i.modelName, i.modelNumber, i.catalogItemId)"
|
141 |
+ " fs.warehouseId, fs.id, sum(li.quantity), i.brand, i.modelName, i.modelNumber, i.catalogItemId)"
|
| 142 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
142 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
| Line 151... |
Line 151... |
| 151 |
|
151 |
|
| 152 |
@NamedQuery(name = "Order.selectGrnPendingOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else li.quantity end)"
|
152 |
@NamedQuery(name = "Order.selectGrnPendingOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else li.quantity end)"
|
| 153 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId "
|
153 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId "
|
| 154 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
154 |
+ " join LineItem li on o.id = li.orderId join TagListing tl on tl.itemId = li.itemId "
|
| 155 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
155 |
+ " join Item i on (i.id = tl.itemId ) where " + " fs.active = 1 and fs.internal = 0 and"
|
| 156 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.deliveryTimestamp is null"
|
156 |
+ " o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null"
|
| 157 |
+ " and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
|
157 |
+ " and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
|
| 158 |
|
158 |
|
| 159 |
@NamedQuery(name = "Order.selectPendingIndentOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else li.quantity end)"
|
159 |
@NamedQuery(name = "Order.selectPendingIndentOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else li.quantity end)"
|
| 160 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
160 |
+ " from FofoStore fs join Order o on fs.id = o.retailerId"
|
| 161 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|
161 |
+ " join LineItem li on o.id = li.orderId " + " join TagListing tl on tl.itemId = li.itemId "
|