HOW Released is calculated on Purchase order
HI,
I am trying to bring released in report by below query however for some PO's its bringing correct results and for others its showing null when the item is null
SELECT poh.po_header_id,
SUM ( DECODE (POL.order_type_lookup_code, 'RATE', PLL.amount - NVL(PLL.amount_cancelled, 0), 'FIXED PRICE', PLL.amount - NVL(PLL.amount_cancelled, 0), NVL(PLL.price_override, 0)*(NVL(PLL.quantity, 0) - NVL(PLL.quantity_cancelled, 0)))) AMOUNT_RELEASE
FROM po_line_locations pll ,
po_lines pol ,
po_headers poh
WHERE 1 =1
AND poh.po_header_id = pol.po_header_id
AND pol.po_line_id = pll.po_line_id(+)