3:
4:
5: TYPE r_inv_pay_info IS RECORD
6: (Invoice_ID AP_Invoices.Invoice_ID%TYPE
7: ,Invoice_Payment_ID AP_Invoice_Payments.Invoice_Payment_ID%TYPE
8: ,Amount AP_Invoice_Payments.Amount%TYPE
9: ,Discount_Taken AP_Invoice_Payments.Discount_Taken%TYPE
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
4:
5: TYPE r_inv_pay_info IS RECORD
6: (Invoice_ID AP_Invoices.Invoice_ID%TYPE
7: ,Invoice_Payment_ID AP_Invoice_Payments.Invoice_Payment_ID%TYPE
8: ,Amount AP_Invoice_Payments.Amount%TYPE
9: ,Discount_Taken AP_Invoice_Payments.Discount_Taken%TYPE
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
5: TYPE r_inv_pay_info IS RECORD
6: (Invoice_ID AP_Invoices.Invoice_ID%TYPE
7: ,Invoice_Payment_ID AP_Invoice_Payments.Invoice_Payment_ID%TYPE
8: ,Amount AP_Invoice_Payments.Amount%TYPE
9: ,Discount_Taken AP_Invoice_Payments.Discount_Taken%TYPE
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
6: (Invoice_ID AP_Invoices.Invoice_ID%TYPE
7: ,Invoice_Payment_ID AP_Invoice_Payments.Invoice_Payment_ID%TYPE
8: ,Amount AP_Invoice_Payments.Amount%TYPE
9: ,Discount_Taken AP_Invoice_Payments.Discount_Taken%TYPE
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
14: ,Exchange_Rate AP_Invoice_Payments.Exchange_Rate%TYPE
7: ,Invoice_Payment_ID AP_Invoice_Payments.Invoice_Payment_ID%TYPE
8: ,Amount AP_Invoice_Payments.Amount%TYPE
9: ,Discount_Taken AP_Invoice_Payments.Discount_Taken%TYPE
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
14: ,Exchange_Rate AP_Invoice_Payments.Exchange_Rate%TYPE
15: ,Reversal_Flag AP_Invoice_Payments.Reversal_Flag%TYPE
8: ,Amount AP_Invoice_Payments.Amount%TYPE
9: ,Discount_Taken AP_Invoice_Payments.Discount_Taken%TYPE
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
14: ,Exchange_Rate AP_Invoice_Payments.Exchange_Rate%TYPE
15: ,Reversal_Flag AP_Invoice_Payments.Reversal_Flag%TYPE
16: ,Reversal_Inv_Pmt_ID AP_Invoice_Payments.Reversal_Inv_Pmt_ID%TYPE
9: ,Discount_Taken AP_Invoice_Payments.Discount_Taken%TYPE
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
14: ,Exchange_Rate AP_Invoice_Payments.Exchange_Rate%TYPE
15: ,Reversal_Flag AP_Invoice_Payments.Reversal_Flag%TYPE
16: ,Reversal_Inv_Pmt_ID AP_Invoice_Payments.Reversal_Inv_Pmt_ID%TYPE
17: );
10: ,Payment_Base_Amount AP_Invoice_Payments.Payment_Base_Amount%TYPE
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
14: ,Exchange_Rate AP_Invoice_Payments.Exchange_Rate%TYPE
15: ,Reversal_Flag AP_Invoice_Payments.Reversal_Flag%TYPE
16: ,Reversal_Inv_Pmt_ID AP_Invoice_Payments.Reversal_Inv_Pmt_ID%TYPE
17: );
18:
11: ,Invoice_Base_Amount AP_Invoice_Payments.Invoice_Base_Amount%TYPE
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
14: ,Exchange_Rate AP_Invoice_Payments.Exchange_Rate%TYPE
15: ,Reversal_Flag AP_Invoice_Payments.Reversal_Flag%TYPE
16: ,Reversal_Inv_Pmt_ID AP_Invoice_Payments.Reversal_Inv_Pmt_ID%TYPE
17: );
18:
19:
12: ,Exchange_Rate_Type AP_Invoice_Payments.Exchange_Rate_Type%TYPE
13: ,Exchange_Date AP_Invoice_Payments.Exchange_Date%TYPE
14: ,Exchange_Rate AP_Invoice_Payments.Exchange_Rate%TYPE
15: ,Reversal_Flag AP_Invoice_Payments.Reversal_Flag%TYPE
16: ,Reversal_Inv_Pmt_ID AP_Invoice_Payments.Reversal_Inv_Pmt_ID%TYPE
17: );
18:
19:
20: -- Cursor to get invoice payments for the given event id
32: AIP.Exchange_Date,
33: AIP.Exchange_Rate,
34: NVL(AIP.Reversal_Flag,'N'),
35: AIP.Reversal_Inv_Pmt_ID
36: FROM AP_Invoice_Payments_All AIP
37: WHERE Accounting_Event_ID = P_Event_ID
38: AND AIP.Invoice_ID = DECODE(P_Invoice_ID, NULL, AIP.Invoice_ID,
39: P_Invoice_ID);
40:
55: AIP.Exchange_Date,
56: AIP.Exchange_Rate,
57: NVL(AIP.Reversal_Flag,'N'),
58: AIP.Reversal_Inv_Pmt_ID
59: FROM AP_Invoice_Payments_All AIP
60: WHERE AIP.Check_ID = P_Check_ID
61: --AND NVL(AIP.Reversal_Flag, 'N') <> 'Y' --bug 7029334
62: AND AIP.Accounting_Event_ID NOT IN
63: (SELECT APH.Accounting_Event_ID