| Line 59... |
Line 59... |
| 59 |
+ " join Item ci on ci.id=foi.itemId join FofoStore fs on fs.id=fo.fofoId left join ActivatedImei ai on fli.serialNumber = ai.serialNumber "
|
59 |
+ " join Item ci on ci.id=foi.itemId join FofoStore fs on fs.id=fo.fofoId left join ActivatedImei ai on fli.serialNumber = ai.serialNumber "
|
| 60 |
+ " where (ai.createTimestamp is null or ai.createTimestamp < :daysBeforeToday) and ci.brand = :brand and ai.activationTimestamp is null and fo.cancelledTimestamp is null and fs.internal = false and fo.createTimestamp > :billingStartDate"
|
60 |
+ " where (ai.createTimestamp is null or ai.createTimestamp < :daysBeforeToday) and ci.brand = :brand and ai.activationTimestamp is null and fo.cancelledTimestamp is null and fs.internal = false and fo.createTimestamp > :billingStartDate"
|
| 61 |
+ " and fo.createTimestamp < :billedBefore"
|
61 |
+ " and fo.createTimestamp < :billedBefore"
|
| 62 |
+ " and fli.serialNumber is not null and fli.serialNumber <> ''"),
|
62 |
+ " and fli.serialNumber is not null and fli.serialNumber <> ''"),
|
| 63 |
|
63 |
|
| 64 |
@NamedQuery(name = "ActivatedImei.selectImeiSoldNotActivatedByBrand", query = "select new com.spice.profitmandi.dao.model.ImeiActivationTimestampModel(fli.serialNumber, ai.activationTimestamp) "
|
- |
|
| 65 |
+ " from FofoOrder fo join FofoOrderItem foi on fo.id=foi.orderId join FofoLineItem fli on fli.fofoOrderItemId=foi.id "
|
- |
|
| 66 |
+ " join Item ci on ci.id=foi.itemId join FofoStore fs on fs.id=fo.fofoId left join ActivatedImei ai on fli.serialNumber = ai.serialNumber "
|
- |
|
| 67 |
+ " where ai.createTimestamp is null and ci.brand = :brand and ai.activationTimestamp is null and fo.cancelledTimestamp is null and fs.internal = false and fo.createTimestamp > :billingStartDate"),
|
- |
|
| 68 |
|
- |
|
| 69 |
@NamedQuery(name = "ActivatedImei.selectActivatedImeisByOrders", query = "select new com.spice.profitmandi.dao.model.ImeiActivationTimestampModel(o.id, o.lineItem.unitPrice, limei.serialNumber, ai.activationTimestamp) "
|
64 |
@NamedQuery(name = "ActivatedImei.selectActivatedImeisByOrders", query = "select new com.spice.profitmandi.dao.model.ImeiActivationTimestampModel(o.id, o.lineItem.unitPrice, limei.serialNumber, ai.activationTimestamp) "
|
| 70 |
+ " from Order o join LineItem li on o.id=li.orderId join LineItemImei limei on li.id=limei.lineItemId join FofoStore fs on fs.id=o.retailerId left join ActivatedImei ai on limei.serialNumber = ai.serialNumber "
|
65 |
+ " from Order o join LineItem li on o.id=li.orderId join LineItemImei limei on li.id=limei.lineItemId join FofoStore fs on fs.id=o.retailerId left join ActivatedImei ai on limei.serialNumber = ai.serialNumber "
|
| 71 |
+ " where o.id in :orderIds and ai.activationTimestamp is not null"),
|
66 |
+ " where o.id in :orderIds and ai.activationTimestamp is not null"),
|
| 72 |
|
67 |
|
| 73 |
@NamedQuery(name = "ActivatedImei.selectActivatedGrnPendingAmount", query = "select cast(sum(o.lineItem.unitPrice) as float )"
|
68 |
@NamedQuery(name = "ActivatedImei.selectActivatedGrnPendingAmount", query = "select cast(sum(o.lineItem.unitPrice) as float )"
|