55: BEGIN
56:
57: select MIN(aid.accounting_date)
58: into invoice_date
59: from po_distributions_all pod,
60: ap_invoice_distributions_all aid
61: where p_line_location_id = pod.line_location_id
62: AND aid.po_distribution_id = pod.po_distribution_id
63: AND nvl(pod.distribution_type,'-99') <> 'AGREEMENT';
86: BEGIN
87:
88: select MIN(aid.accounting_date - pod.creation_date)
89: into v_days
90: from po_distributions_all pod,
91: ap_invoice_distributions_all aid
92: where p_line_location_id = pod.line_location_id
93: AND aid.po_distribution_id = pod.po_distribution_id
94: AND nvl(pod.distribution_type,'-99') <> 'AGREEMENT';
118: BEGIN
119:
120: select SUM(aid.base_invoice_price_variance / nvl(pod.rate,nvl(poh.rate,1)))
121: into v_ipv
122: from po_distributions_all pod,
123: ap_invoice_distributions_all aid,
124: po_headers_all poh
125: where p_line_location_id = pod.line_location_id
126: AND aid.po_distribution_id = pod.po_distribution_id
299: -- Get quantity delivered
300: --
301: SELECT SUM(pod.quantity_delivered)
302: INTO v_qty_delivered
303: FROM po_distributions_all pod
304: WHERE pod.line_location_id = p_line_location_id
305: AND nvl(pod.distribution_type,'-99') <> 'AGREEMENT';
306:
307: RETURN(v_qty_delivered);