| Line 19... |
Line 19... |
| 19 |
" join catalog.item i on i.id = ii.itemId" +
|
19 |
" join catalog.item i on i.id = ii.itemId" +
|
| 20 |
" join catalog.tag_listing tl on tl.item_id = i.id" +
|
20 |
" join catalog.tag_listing tl on tl.item_id = i.id" +
|
| 21 |
" join catalog.catagoriesd_catalog cc on cc.catalog_id = i.catalog_item_id and cc.end_date is null" +
|
21 |
" join catalog.catagoriesd_catalog cc on cc.catalog_id = i.catalog_item_id and cc.end_date is null" +
|
| 22 |
" join (warehouse.inventoryItem ii2 join warehouse.purchase p on p.id = ii2.purchaseId" +
|
22 |
" join (warehouse.inventoryItem ii2 join warehouse.purchase p on p.id = ii2.purchaseId" +
|
| 23 |
" join warehouse.purchaseorder po on po.id = p.purchaseOrder_id" +
|
23 |
" join warehouse.purchaseorder po on po.id = p.purchaseOrder_id" +
|
| 24 |
" join warehouse.invoice inv on (p.invoiceNumber = inv.invoiceNumber and po.supplierId = inv.supplierId and" +
|
24 |
" join warehouse.invoice inv on (p.invoice_id = inv.id and po.supplierId = inv.supplierId and" +
|
| 25 |
" po.warehouseId = ii2.physicalWarehouseId)" +
|
25 |
" po.warehouseId = ii2.physicalWarehouseId)" +
|
| 26 |
" join warehouse.supplier su on su.id = inv.supplierId and su.internal = 0)" +
|
26 |
" join warehouse.supplier su on su.id = inv.supplierId and su.internal = 0)" +
|
| 27 |
" on (ii.serialNumber = ii2.serialNumber and ii2.lastScanType != 'PURCHASE_RETURN')" +
|
27 |
" on (ii.serialNumber = ii2.serialNumber and ii2.lastScanType != 'PURCHASE_RETURN')" +
|
| 28 |
"" +
|
28 |
"" +
|
| 29 |
"where s.type = 'PURCHASE'" +
|
29 |
"where s.type = 'PURCHASE'" +
|