The following lines contain the word 'select', 'insert', 'update' or 'delete':
select SUM(DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_received, 0),
'QUANTITY', NVL(PLL.quantity_received, 0)*NVL(PLL.price_override, 0)))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.payment_type in ('MILESTONE', 'RATE', 'LUMPSUM');
select SUM(DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_billed, 0),
'QUANTITY', NVL(PLL.quantity_billed, 0)*NVL(PLL.price_override, 0)))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.payment_type <> 'ADVANCE'
and PLL.shipment_type = 'STANDARD';
select sum(NVL(PLL.amount_financed, 0))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.payment_type = 'ADVANCE'
and PLL.shipment_type = 'PREPAYMENT';
select SUM(DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_financed,0),
'QUANTITY', NVL(PLL.quantity_financed, 0)*NVL(PLL.price_override, 0)))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.payment_type in ('MILESTONE', 'RATE', 'LUMPSUM')
and PLL.shipment_type = 'PREPAYMENT';
select SUM(DECODE(PLL.shipment_type,
'STANDARD', DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_billed, 0),
'QUANTITY', NVL(PLL.quantity_billed, 0)*NVL(PLL.price_override, 0)),
'PREPAYMENT', DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_financed, 0),
'QUANTITY', NVL(PLL.quantity_financed, 0)*NVL(PLL.price_override, 0))))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.payment_type in ('MILESTONE', 'RATE', 'LUMPSUM')
and PLL.shipment_type in('STANDARD', 'PREPAYMENT'); --???
select SUM(DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_recouped, 0),
'QUANTITY', NVL(PLL.quantity_recouped, 0)*NVL(PLL.price_override, 0)))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.shipment_type = 'PREPAYMENT'; -- could be advance or financing pp
select sum(NVL(PLL.retainage_withheld_amount,0) - NVL(retainage_released_amount,0))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.payment_type in ('MILESTONE', 'RATE', 'LUMPSUM')
and PLL.shipment_type = 'STANDARD';
select sum(NVL(RSL.amount, NVL(RSL.quantity_shipped,0)*NVL(PLL.price_override,0)))
from RCV_SHIPMENT_LINES RSL,
PO_LINE_LOCATIONS_ALL PLL
where PLL.po_header_id = p_po_header_id
and PLL.shipment_type = 'STANDARD'
and PLL.payment_type = 'DELIVERY'
and RSL.PO_line_location_id = PLL.line_location_id;
select sum(NVL(
NVL(RSL.amount,RSL.REQUESTED_AMOUNT), --5488052
NVL(RSL.quantity_shipped,0)*NVL(PLL.price_override,0)
)
)
from RCV_SHIPMENT_LINES RSL,
PO_LINE_LOCATIONS_ALL PLL
where PLL.po_line_id = p_po_line_id
and PLL.shipment_type = 'STANDARD'
--5488052 and PLL.payment_type = 'DELIVERY'
and RSL.PO_line_location_id = PLL.line_location_id
and RSL.approval_status in ('APPROVED', 'PROCESSED');
select SUM(DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_billed, 0),
'QUANTITY', NVL(PLL.quantity_billed, 0)*NVL(PLL.price_override, 0)))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_line_id = p_po_line_id
--5488052 and PLL.payment_type = 'DELIVERY'
and PLL.shipment_type = 'STANDARD';
select PLL.amount
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_line_id = p_po_line_id
and PLL.payment_type = 'ADVANCE'
and PLL.shipment_type = 'PREPAYMENT';
select PLL.amount_financed
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_line_id = p_po_line_id
and PLL.payment_type = 'ADVANCE'
and PLL.shipment_type = 'PREPAYMENT';
select SUM(DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_recouped, 0),
'QUANTITY', NVL(PLL.quantity_recouped, 0)*NVL(PLL.price_override, 0)))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.po_line_id = p_po_line_id
and PLL.shipment_type = 'PREPAYMENT'; -- could be advance or financ pp
select ROUND(DECODE(PLL.matching_basis,
'AMOUNT', (NVL(PLL.amount, 0)/POL.amount)*100,
'QUANTITY', (NVL(PLL.price_override, 0)/POL.unit_price)*100))
from PO_LINE_LOCATIONS_ARCHIVE_ALL PLL,
PO_LINES_ARCHIVE_ALL POL
where PLL.po_line_id = POL.po_line_id
and PLL.line_location_id = p_po_line_location_id
and PLL.payment_type = 'MILESTONE'
and PLL.latest_external_flag ='Y'
and POL.latest_external_flag ='Y';
select DECODE(PLL.matching_basis,
'AMOUNT', NVL(PLL.amount_received, 0),
'QUANTITY', NVL(PLL.quantity_received, 0)*NVL(PLL.price_override, 0))
from PO_LINE_LOCATIONS_ALL PLL
where PLL.line_location_id = p_po_line_location_id;