| Line 55... |
Line 55... |
| 55 |
" JOIN warehouse.purchaseorder po ON po.id = p.purchaseOrder_id" +
|
55 |
" JOIN warehouse.purchaseorder po ON po.id = p.purchaseOrder_id" +
|
| 56 |
" JOIN warehouse.invoice inv ON p.invoice_id = inv.id AND po.supplierId = inv.supplierId AND po.warehouseId = ii2.physicalWarehouseId" +
|
56 |
" JOIN warehouse.invoice inv ON p.invoice_id = inv.id AND po.supplierId = inv.supplierId AND po.warehouseId = ii2.physicalWarehouseId" +
|
| 57 |
" JOIN warehouse.supplier su ON su.id = inv.supplierId AND su.internal = 0" +
|
57 |
" JOIN warehouse.supplier su ON su.id = inv.supplierId AND su.internal = 0" +
|
| 58 |
"" +
|
58 |
"" +
|
| 59 |
" where ((o.created_timestamp >= :startDate AND o.created_timestamp < :endDate) AND (o.billing_timestamp >= :startDate AND o.billing_timestamp < :endDate) AND o.refund_timestamp IS NULL)" +
|
59 |
" where ((o.created_timestamp >= :startDate AND o.created_timestamp < :endDate) AND (o.billing_timestamp >= :startDate AND o.billing_timestamp < :endDate) AND o.refund_timestamp IS NULL)" +
|
| 60 |
" and DATEDIFF(NOW(), inv.invoiceDate) > 15) b on b.customer_id = a.fofo_id" +
|
60 |
" and inv.invoiceDate < DATE_SUB(CURDATE(), INTERVAL 15 DAY)) b on b.customer_id = a.fofo_id" +
|
| 61 |
" GROUP BY a.auth_id, a.Rbm_Name",
|
61 |
" GROUP BY a.auth_id, a.Rbm_Name",
|
| 62 |
resultSetMapping = "SoldAgingModel"),
|
62 |
resultSetMapping = "SoldAgingModel"),
|
| 63 |
|
63 |
|
| 64 |
})
|
64 |
})
|
| 65 |
|
65 |
|
| Line 67... |
Line 67... |
| 67 |
|
67 |
|
| 68 |
@SqlResultSetMapping(name = "SoldAgingModel",
|
68 |
@SqlResultSetMapping(name = "SoldAgingModel",
|
| 69 |
classes = {@ConstructorResult(targetClass = Sold15daysOldAgingModel.class,
|
69 |
classes = {@ConstructorResult(targetClass = Sold15daysOldAgingModel.class,
|
| 70 |
columns = {
|
70 |
columns = {
|
| 71 |
@ColumnResult(name = "Rbm_Name", type = String.class),
|
71 |
@ColumnResult(name = "Rbm_Name", type = String.class),
|
| 72 |
@ColumnResult(name = "SLOWMOVING_Billed ", type = Long.class),
|
72 |
@ColumnResult(name = "SLOWMOVING_Billed", type = Long.class),
|
| 73 |
@ColumnResult(name = "RUNNING_Billed ", type = Long.class),
|
73 |
@ColumnResult(name = "RUNNING_Billed", type = Long.class),
|
| 74 |
@ColumnResult(name = "FASTMOVING_Billed ", type = Long.class),
|
74 |
@ColumnResult(name = "FASTMOVING_Billed", type = Long.class),
|
| 75 |
@ColumnResult(name = "HID_Billed ", type = Long.class),
|
75 |
@ColumnResult(name = "HID_Billed", type = Long.class),
|
| 76 |
@ColumnResult(name = "Other_Billed ", type = Long.class),
|
76 |
@ColumnResult(name = "Other_Billed", type = Long.class),
|
| 77 |
@ColumnResult(name = "Total_Amount ", type = Long.class),
|
77 |
@ColumnResult(name = "Total_Amount", type = Long.class),
|
| 78 |
}
|
78 |
}
|
| 79 |
)}
|
79 |
)}
|
| 80 |
)
|
80 |
)
|
| 81 |
|
81 |
|
| 82 |
})
|
82 |
})
|