28: SELECT distinct contracts.po_header_id,
29: contracts.amount_limit ,
30: NVL(contracts.rate, 1), -- Bug# 4685260
31: contracts.currency_code --Bug# 4685260
32: FROM po_lines_gt pol, --
34: WHERE contracts.po_header_id = pol.contract_id
35: AND NVL(contracts.global_agreement_flag, 'N') = 'N' --
36: AND pol.po_header_id = X_po_header_id
110: AND pol.po_header_id <> X_po_header_id
111: AND poh2.currency_code <> x_currency_code
112: UNION ALL
113: SELECT 'Exists'
114: FROM po_lines_gt pol, --
116: po_headers_gt potoapp --
117: WHERE pol.contract_id = X_contract_id --
118: AND pol.po_line_id = pll.po_line_id
191: 'Y', nvl(POTOAPP.rate, 1),1) --Bug4685260
192: )
193: )
194: INTO X_current_amount
195: FROM po_lines_gt pol, --
197: po_headers_gt potoapp --
198: WHERE pol.contract_id = X_contract_id --
199: AND pol.po_line_id = pll.po_line_id