DBA Data[Home] [Help]

VIEW: APPS.PO_ALERT_SCHEDULED_VIEW

Source

View Text - Preformatted

SELECT poh.po_header_id, NVL( SUM( DECODE(c.minimum_accountable_unit, NULL, ROUND ( (pll.quantity - NVL(pll.quantity_cancelled, 0)) * NVL(pll.price_override, 0), c.precision ), ROUND ( (pll.quantity - NVL(pll.quantity_cancelled, 0)) * NVL(pll.price_override, 0) / c.minimum_accountable_unit * c.minimum_accountable_unit) ) ), 0), POH.ORG_ID FROM PO_LINE_LOCATIONS_ALL PLL, FND_CURRENCIES C, PO_HEADERS POH WHERE poh.currency_code = c.currency_code AND NVL(poh.cancel_flag, 'N') = 'N' AND NVL(poh.closed_code, 'OPEN') NOT IN ('CLOSED', 'FINALLY CLOSED') AND poh.type_lookup_code = 'PLANNED' AND poh.approved_date is not null AND pll.po_header_id = poh.po_header_id AND pll.shipment_type = 'SCHEDULED' GROUP BY poh.po_header_id, POH.ORG_ID
View Text - HTML Formatted

SELECT POH.PO_HEADER_ID
, NVL( SUM( DECODE(C.MINIMUM_ACCOUNTABLE_UNIT
, NULL
, ROUND ( (PLL.QUANTITY - NVL(PLL.QUANTITY_CANCELLED
, 0)) * NVL(PLL.PRICE_OVERRIDE
, 0)
, C.PRECISION )
, ROUND ( (PLL.QUANTITY - NVL(PLL.QUANTITY_CANCELLED
, 0)) * NVL(PLL.PRICE_OVERRIDE
, 0) / C.MINIMUM_ACCOUNTABLE_UNIT * C.MINIMUM_ACCOUNTABLE_UNIT) ) )
, 0)
, POH.ORG_ID
FROM PO_LINE_LOCATIONS_ALL PLL
, FND_CURRENCIES C
, PO_HEADERS POH
WHERE POH.CURRENCY_CODE = C.CURRENCY_CODE
AND NVL(POH.CANCEL_FLAG
, 'N') = 'N'
AND NVL(POH.CLOSED_CODE
, 'OPEN') NOT IN ('CLOSED'
, 'FINALLY CLOSED')
AND POH.TYPE_LOOKUP_CODE = 'PLANNED'
AND POH.APPROVED_DATE IS NOT NULL
AND PLL.PO_HEADER_ID = POH.PO_HEADER_ID
AND PLL.SHIPMENT_TYPE = 'SCHEDULED' GROUP BY POH.PO_HEADER_ID
, POH.ORG_ID