5615: SELECT nvl(sum(nvl(AIDF.amount,0)),0)
5616: INTO l_freight_total
5617: FROM ap_invoice_distributions AIDF,
5618: ap_invoice_distributions AIDI,
5619: po_distributions_all POD
5620: WHERE AIDF.charge_applicable_to_dist_id = AIDI.invoice_distribution_id
5621: AND AIDF.line_type_lookup_code = 'FREIGHT'
5622: AND AIDI.line_type_lookup_code = 'ITEM'
5623: AND AIDI.po_distribution_id = POD.po_distribution_id
6551: l_return_status VARCHAR2(1);
6552: l_msg_count NUMBER;
6553: l_msg_data varchar2(2000);
6554:
6555: l_distribution_type PO_DISTRIBUTIONS_ALL.destination_type_code%TYPE ;
6556: l_accrue_on_receipt_flag PO_DISTRIBUTIONS_ALL.accrue_on_receipt_flag%TYPE ;
6557: l_code_combination_id PO_DISTRIBUTIONS_ALL.code_combination_id%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6552: l_msg_count NUMBER;
6553: l_msg_data varchar2(2000);
6554:
6555: l_distribution_type PO_DISTRIBUTIONS_ALL.destination_type_code%TYPE ;
6556: l_accrue_on_receipt_flag PO_DISTRIBUTIONS_ALL.accrue_on_receipt_flag%TYPE ;
6557: l_code_combination_id PO_DISTRIBUTIONS_ALL.code_combination_id%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6553: l_msg_data varchar2(2000);
6554:
6555: l_distribution_type PO_DISTRIBUTIONS_ALL.destination_type_code%TYPE ;
6556: l_accrue_on_receipt_flag PO_DISTRIBUTIONS_ALL.accrue_on_receipt_flag%TYPE ;
6557: l_code_combination_id PO_DISTRIBUTIONS_ALL.code_combination_id%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6554:
6555: l_distribution_type PO_DISTRIBUTIONS_ALL.destination_type_code%TYPE ;
6556: l_accrue_on_receipt_flag PO_DISTRIBUTIONS_ALL.accrue_on_receipt_flag%TYPE ;
6557: l_code_combination_id PO_DISTRIBUTIONS_ALL.code_combination_id%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6555: l_distribution_type PO_DISTRIBUTIONS_ALL.destination_type_code%TYPE ;
6556: l_accrue_on_receipt_flag PO_DISTRIBUTIONS_ALL.accrue_on_receipt_flag%TYPE ;
6557: l_code_combination_id PO_DISTRIBUTIONS_ALL.code_combination_id%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6556: l_accrue_on_receipt_flag PO_DISTRIBUTIONS_ALL.accrue_on_receipt_flag%TYPE ;
6557: l_code_combination_id PO_DISTRIBUTIONS_ALL.code_combination_id%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6564: l_amount_delivered PO_DISTRIBUTIONS_ALL.amount_delivered%TYPE ;
6557: l_code_combination_id PO_DISTRIBUTIONS_ALL.code_combination_id%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6564: l_amount_delivered PO_DISTRIBUTIONS_ALL.amount_delivered%TYPE ;
6565: l_quantity_billed PO_DISTRIBUTIONS_ALL.quantity_billed%TYPE ;
6558: l_budget_account_id PO_DISTRIBUTIONS_ALL.budget_account_id%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6564: l_amount_delivered PO_DISTRIBUTIONS_ALL.amount_delivered%TYPE ;
6565: l_quantity_billed PO_DISTRIBUTIONS_ALL.quantity_billed%TYPE ;
6566: l_amount_billed PO_DISTRIBUTIONS_ALL.amount_billed%TYPE ;
6559: l_partial_funded_flag PO_DISTRIBUTIONS_ALL.partial_funded_flag%TYPE ;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6564: l_amount_delivered PO_DISTRIBUTIONS_ALL.amount_delivered%TYPE ;
6565: l_quantity_billed PO_DISTRIBUTIONS_ALL.quantity_billed%TYPE ;
6566: l_amount_billed PO_DISTRIBUTIONS_ALL.amount_billed%TYPE ;
6567: l_matching_basis PO_LINE_LOCATIONS.matching_basis%TYPE;
6560: l_funded_value PO_DISTRIBUTIONS_ALL.funded_value%TYPE ;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6564: l_amount_delivered PO_DISTRIBUTIONS_ALL.amount_delivered%TYPE ;
6565: l_quantity_billed PO_DISTRIBUTIONS_ALL.quantity_billed%TYPE ;
6566: l_amount_billed PO_DISTRIBUTIONS_ALL.amount_billed%TYPE ;
6567: l_matching_basis PO_LINE_LOCATIONS.matching_basis%TYPE;
6568: l_quantity_received PO_LINE_LOCATIONS.quantity_received%TYPE;
6561: l_quantity_funded PO_DISTRIBUTIONS_ALL.quantity_funded%TYPE ;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6564: l_amount_delivered PO_DISTRIBUTIONS_ALL.amount_delivered%TYPE ;
6565: l_quantity_billed PO_DISTRIBUTIONS_ALL.quantity_billed%TYPE ;
6566: l_amount_billed PO_DISTRIBUTIONS_ALL.amount_billed%TYPE ;
6567: l_matching_basis PO_LINE_LOCATIONS.matching_basis%TYPE;
6568: l_quantity_received PO_LINE_LOCATIONS.quantity_received%TYPE;
6569: l_amount_received PO_LINE_LOCATIONS.amount_received%TYPE;
6562: l_amount_funded PO_DISTRIBUTIONS_ALL.amount_funded%TYPE ;
6563: l_quantity_delivered PO_DISTRIBUTIONS_ALL.quantity_delivered%TYPE ;
6564: l_amount_delivered PO_DISTRIBUTIONS_ALL.amount_delivered%TYPE ;
6565: l_quantity_billed PO_DISTRIBUTIONS_ALL.quantity_billed%TYPE ;
6566: l_amount_billed PO_DISTRIBUTIONS_ALL.amount_billed%TYPE ;
6567: l_matching_basis PO_LINE_LOCATIONS.matching_basis%TYPE;
6568: l_quantity_received PO_LINE_LOCATIONS.quantity_received%TYPE;
6569: l_amount_received PO_LINE_LOCATIONS.amount_received%TYPE;
6570: l_hold_name VARCHAR2(30);
6568: l_quantity_received PO_LINE_LOCATIONS.quantity_received%TYPE;
6569: l_amount_received PO_LINE_LOCATIONS.amount_received%TYPE;
6570: l_hold_name VARCHAR2(30);
6571: l_unit_meas_lookup_code PO_LINE_LOCATIONS_ALL.unit_meas_lookup_code%TYPE;
6572: l_quantity_cancelled PO_DISTRIBUTIONS_ALL.quantity_cancelled%TYPE ;
6573: l_amount_cancelled PO_DISTRIBUTIONS_ALL.amount_cancelled%TYPE ;
6574: l_po_header_id ap_invoice_lines_all.po_header_id%TYPE;
6575:
6576:
6569: l_amount_received PO_LINE_LOCATIONS.amount_received%TYPE;
6570: l_hold_name VARCHAR2(30);
6571: l_unit_meas_lookup_code PO_LINE_LOCATIONS_ALL.unit_meas_lookup_code%TYPE;
6572: l_quantity_cancelled PO_DISTRIBUTIONS_ALL.quantity_cancelled%TYPE ;
6573: l_amount_cancelled PO_DISTRIBUTIONS_ALL.amount_cancelled%TYPE ;
6574: l_po_header_id ap_invoice_lines_all.po_header_id%TYPE;
6575:
6576:
6577: BEGIN