DBA Data[Home] [Help]

APPS.AP_PAY_INVOICE_PKG dependencies on AP_INVOICES

Line 47: | Step 3: | Call ap_pay_update_ap_invoices: | PAY |

43: +----------+----------------------------------------------------+-------------+
44: | Step 2: | Call ap_pay_update_payment_schedule: | PAY |
45: | | | |
46: +----------+----------------------------------------------------+-------------+
47: | Step 3: | Call ap_pay_update_ap_invoices: | PAY |
48: | | | |
49: +----------+----------------------------------------------------+-------------+
50: | Step 4: | Call ap_pay_insert_invoice_payments: | PAY/REV |
51: | | | |

Line 219: -- was causing the amount paid in ap_invoices to be updated twice

215: Current_calling_sequence);
216:
217: -- Fix for bug 893626:
218: -- In revision 115.11 of this file, there was an 'end if' here which
219: -- was causing the amount paid in ap_invoices to be updated twice
220: -- which resulted in the bug 893626.
221: -- As mentioned above in the comment, we should not do steps 2 and 3
222: -- for REV.
223: -- Moved the 'end if' after the ap_pay_update_ap_invoices procedure call.

Line 223: -- Moved the 'end if' after the ap_pay_update_ap_invoices procedure call.

219: -- was causing the amount paid in ap_invoices to be updated twice
220: -- which resulted in the bug 893626.
221: -- As mentioned above in the comment, we should not do steps 2 and 3
222: -- for REV.
223: -- Moved the 'end if' after the ap_pay_update_ap_invoices procedure call.
224:
225: /*--------------------------------------------------------------------------
226: * -- Step 3 : case for all: Update AP_INVOICES
227: * Call ap_pay_update_ap_invoices :

Line 226: * -- Step 3 : case for all: Update AP_INVOICES

222: -- for REV.
223: -- Moved the 'end if' after the ap_pay_update_ap_invoices procedure call.
224:
225: /*--------------------------------------------------------------------------
226: * -- Step 3 : case for all: Update AP_INVOICES
227: * Call ap_pay_update_ap_invoices :
228: *
229: *--------------------------------------------------------------------------*/
230: ap_pay_invoice_pkg.ap_pay_update_ap_invoices(

Line 227: * Call ap_pay_update_ap_invoices :

223: -- Moved the 'end if' after the ap_pay_update_ap_invoices procedure call.
224:
225: /*--------------------------------------------------------------------------
226: * -- Step 3 : case for all: Update AP_INVOICES
227: * Call ap_pay_update_ap_invoices :
228: *
229: *--------------------------------------------------------------------------*/
230: ap_pay_invoice_pkg.ap_pay_update_ap_invoices(
231: P_invoice_id,

Line 230: ap_pay_invoice_pkg.ap_pay_update_ap_invoices(

226: * -- Step 3 : case for all: Update AP_INVOICES
227: * Call ap_pay_update_ap_invoices :
228: *
229: *--------------------------------------------------------------------------*/
230: ap_pay_invoice_pkg.ap_pay_update_ap_invoices(
231: P_invoice_id,
232: P_check_id,
233: P_amount,
234: P_discount_taken,

Line 459: FROM ap_payment_schedules PS, ap_invoices AI

455: AI_exchange_rate,
456: AI_exchange_date,
457: AI_exchange_rate_type,
458: c_inv_currency_code
459: FROM ap_payment_schedules PS, ap_invoices AI
460: WHERE PS.invoice_id = P_invoice_id
461: AND PS.payment_num = P_payment_num
462: AND AI.invoice_id = P_invoice_id;
463:

Line 642: * ap_invoices Update AP_INVOICES

638:
639:
640: /*=========================================================================
641: * update amount_paid, discount_amount_taken and payment_status_flag for
642: * ap_invoices Update AP_INVOICES
643: ==========================================================================*/
644: PROCEDURE ap_pay_update_ap_invoices(
645: P_invoice_id IN NUMBER,
646: P_check_id IN NUMBER,

Line 644: PROCEDURE ap_pay_update_ap_invoices(

640: /*=========================================================================
641: * update amount_paid, discount_amount_taken and payment_status_flag for
642: * ap_invoices Update AP_INVOICES
643: ==========================================================================*/
644: PROCEDURE ap_pay_update_ap_invoices(
645: P_invoice_id IN NUMBER,
646: P_check_id IN NUMBER,
647: P_amount IN NUMBER,
648: P_discount_taken IN NUMBER,

Line 662: current_calling_sequence := 'ap_pay_update_ap_invoices<-'||P_calling_sequence;

658:
659: BEGIN
660: -- Update the calling sequence
661: --
662: current_calling_sequence := 'ap_pay_update_ap_invoices<-'||P_calling_sequence;
663:
664: if (P_PAYMENT_MODE = 'PAY') then
665:
666: if (P_REPLACE_FLAG = 'N') then

Line 668: debug_info := 'Update ap_invoices (pay)';

664: if (P_PAYMENT_MODE = 'PAY') then
665:
666: if (P_REPLACE_FLAG = 'N') then
667:
668: debug_info := 'Update ap_invoices (pay)';
669:
670: UPDATE ap_invoices
671: SET amount_paid = NVL(amount_paid, 0) + NVL(P_amount, 0),
672: discount_amount_taken = NVL(discount_amount_taken, 0) +

Line 670: UPDATE ap_invoices

666: if (P_REPLACE_FLAG = 'N') then
667:
668: debug_info := 'Update ap_invoices (pay)';
669:
670: UPDATE ap_invoices
671: SET amount_paid = NVL(amount_paid, 0) + NVL(P_amount, 0),
672: discount_amount_taken = NVL(discount_amount_taken, 0) +
673: NVL(P_discount_taken, 0),
674: payment_status_flag = AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id ),

Line 674: payment_status_flag = AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id ),

670: UPDATE ap_invoices
671: SET amount_paid = NVL(amount_paid, 0) + NVL(P_amount, 0),
672: discount_amount_taken = NVL(discount_amount_taken, 0) +
673: NVL(P_discount_taken, 0),
674: payment_status_flag = AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id ),
675: last_update_date = P_last_update_date,
676: last_updated_by = P_last_updated_by
677: WHERE invoice_id = P_invoice_id;
678:

Line 681: (p_table_name => 'AP_INVOICES',

677: WHERE invoice_id = P_invoice_id;
678:
679: --Bug 4539462 DBI logging
680: AP_DBI_PKG.Maintain_DBI_Summary
681: (p_table_name => 'AP_INVOICES',
682: p_operation => 'U',
683: p_key_value1 => P_invoice_id,
684: p_calling_sequence => current_calling_sequence);
685:

Line 688: debug_info := 'Update ap_invoices (reissue)';

684: p_calling_sequence => current_calling_sequence);
685:
686: elsif (P_REPLACE_FLAG = 'Y') then
687:
688: debug_info := 'Update ap_invoices (reissue)';
689:
690: UPDATE ap_invoices
691: SET last_update_date = P_last_update_date,
692: last_updated_by = P_last_updated_by

Line 690: UPDATE ap_invoices

686: elsif (P_REPLACE_FLAG = 'Y') then
687:
688: debug_info := 'Update ap_invoices (reissue)';
689:
690: UPDATE ap_invoices
691: SET last_update_date = P_last_update_date,
692: last_updated_by = P_last_updated_by
693: WHERE invoice_id = P_invoice_id;
694:

Line 701: debug_info := 'Update ap_invoices (reverse)';

697: elsif (P_PAYMENT_MODE = 'REV') then
698:
699: if (P_REPLACE_FLAG = 'N') then
700:
701: debug_info := 'Update ap_invoices (reverse)';
702:
703: UPDATE ap_invoices AI
704: SET (amount_paid
705: , discount_amount_taken

Line 703: UPDATE ap_invoices AI

699: if (P_REPLACE_FLAG = 'N') then
700:
701: debug_info := 'Update ap_invoices (reverse)';
702:
703: UPDATE ap_invoices AI
704: SET (amount_paid
705: , discount_amount_taken
706: , payment_status_flag
707: , last_update_date

Line 712: , AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id )

708: , last_updated_by)
709: = (SELECT AI.amount_paid - SUM(AIP.amount)
710: , NVL(AI.discount_amount_taken,0) -
711: SUM(NVL(AIP.discount_taken,0))
712: , AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id )
713: , P_last_update_date
714: , P_last_updated_by
715: FROM ap_invoice_payments AIP
716: WHERE AIP.invoice_id = P_invoice_id

Line 726: (p_table_name => 'AP_INVOICES',

722: WHERE AI.invoice_id = P_invoice_id;
723:
724: --Bug 4539462 DBI logging
725: AP_DBI_PKG.Maintain_DBI_Summary
726: (p_table_name => 'AP_INVOICES',
727: p_operation => 'U',
728: p_key_value1 => P_invoice_id,
729: p_calling_sequence => current_calling_sequence);
730:

Line 733: debug_info := 'Update ap_invoices (replace)';

729: p_calling_sequence => current_calling_sequence);
730:
731: elsif (P_REPLACE_FLAG = 'Y') then
732:
733: debug_info := 'Update ap_invoices (replace)';
734:
735: UPDATE ap_invoices
736: SET last_update_date = P_last_update_date,
737: last_updated_by = P_last_updated_by

Line 735: UPDATE ap_invoices

731: elsif (P_REPLACE_FLAG = 'Y') then
732:
733: debug_info := 'Update ap_invoices (replace)';
734:
735: UPDATE ap_invoices
736: SET last_update_date = P_last_update_date,
737: last_updated_by = P_last_updated_by
738: WHERE invoice_id = P_invoice_id;
739:

Line 765: END ap_pay_update_ap_invoices;

761: end if;
762:
763: APP_EXCEPTION.RAISE_EXCEPTION;
764:
765: END ap_pay_update_ap_invoices;
766:
767:
768:
769: /*========================================================================

Line 1091: FROM ap_invoice_payments AIP,ap_invoices AI --bug2182168 added ap_invoices AI

1087: , DECODE(AI.amount_paid,SUM(AIP.amount),'N','P')
1088: -- 2182168 modified the decode statement to compare amount_paid to amount cancelled
1089: , P_last_update_date
1090: , P_last_updated_by
1091: FROM ap_invoice_payments AIP,ap_invoices AI --bug2182168 added ap_invoices AI
1092: WHERE AIP.invoice_id = P_invoice_id
1093: AND AIP.payment_num = P_payment_num
1094: AND AIP.check_id = P_check_id
1095: AND AI.invoice_id=P_invoice_id --bug2182168 added condition

Line 1106: FROM ap_invoices AI

1102: )
1103: WHERE (invoice_id, payment_num) IN
1104: (SELECT P_invoice_id
1105: , P_payment_num
1106: FROM ap_invoices AI
1107: WHERE AI.invoice_id = P_invoice_id
1108: AND AI.invoice_type_lookup_code <> 'PREPAYMENT');
1109:
1110: --

Line 1134: FROM ap_invoices AI

1130: GROUP BY AIP.invoice_id)
1131: WHERE payment_num = P_payment_num -- Bug 4701565
1132: AND (invoice_id) IN
1133: (SELECT P_invoice_id
1134: FROM ap_invoices AI
1135: WHERE AI.invoice_id = P_invoice_id
1136: AND AI.invoice_type_lookup_code = 'PREPAYMENT');
1137:
1138: elsif (P_REPLACE_FLAG = 'Y') then

Line 1206: It is used to update the ap_invoices table and ap_payment_schedules

1202:
1203:
1204: /****************************************************************
1205: The procedure was created due to bugs 467167, 661795 .
1206: It is used to update the ap_invoices table and ap_payment_schedules
1207: table when reversing an invoice payment. It is called from the
1208: payment workbench.
1209: ******************************************************************/
1210:

Line 1238: -- Bug 1544895 - The update statement for AP_INVOICES that appears below the update

1234: FROM ap_invoice_payments
1235: WHERE invoice_payment_id = p_org_invoice_pay_id;
1236:
1237:
1238: -- Bug 1544895 - The update statement for AP_INVOICES that appears below the update
1239: -- statment for ap_pyment_schedules has been moved from here to after the update
1240: -- statment for ap_pyment_schedules in this procedure.
1241:
1242:

Line 1261: -- in AP_INVOICES after ap_payment_schedules is updates. This will cause

1257: WHERE invoice_id = P_invoice_id
1258: AND payment_num = P_payment_line_number;
1259:
1260: -- Bug 1544895 - Moved the following update statement so that it inserts values
1261: -- in AP_INVOICES after ap_payment_schedules is updates. This will cause
1262: -- the payment_status_flag in AP_INVOICES to have the correct value.
1263:
1264: -- Update ap_invoices
1265:

Line 1262: -- the payment_status_flag in AP_INVOICES to have the correct value.

1258: AND payment_num = P_payment_line_number;
1259:
1260: -- Bug 1544895 - Moved the following update statement so that it inserts values
1261: -- in AP_INVOICES after ap_payment_schedules is updates. This will cause
1262: -- the payment_status_flag in AP_INVOICES to have the correct value.
1263:
1264: -- Update ap_invoices
1265:
1266: UPDATE ap_invoices

Line 1264: -- Update ap_invoices

1260: -- Bug 1544895 - Moved the following update statement so that it inserts values
1261: -- in AP_INVOICES after ap_payment_schedules is updates. This will cause
1262: -- the payment_status_flag in AP_INVOICES to have the correct value.
1263:
1264: -- Update ap_invoices
1265:
1266: UPDATE ap_invoices
1267: SET amount_paid = nvl(amount_paid,0) - P_amount ,
1268: discount_amount_taken =

Line 1266: UPDATE ap_invoices

1262: -- the payment_status_flag in AP_INVOICES to have the correct value.
1263:
1264: -- Update ap_invoices
1265:
1266: UPDATE ap_invoices
1267: SET amount_paid = nvl(amount_paid,0) - P_amount ,
1268: discount_amount_taken =
1269: nvl(discount_amount_taken,0) - nvl(P_discount,0) ,
1270: payment_status_flag = AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id ),

Line 1270: payment_status_flag = AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id ),

1266: UPDATE ap_invoices
1267: SET amount_paid = nvl(amount_paid,0) - P_amount ,
1268: discount_amount_taken =
1269: nvl(discount_amount_taken,0) - nvl(P_discount,0) ,
1270: payment_status_flag = AP_INVOICES_UTILITY_PKG.get_payment_status( P_invoice_id ),
1271: last_update_date = P_last_update_date,
1272: last_updated_by = P_last_updated_by
1273: WHERE invoice_id = P_invoice_id;
1274:

Line 1277: (p_table_name => 'AP_INVOICES',

1273: WHERE invoice_id = P_invoice_id;
1274:
1275: --Bug 4539462 DBI logging
1276: AP_DBI_PKG.Maintain_DBI_Summary
1277: (p_table_name => 'AP_INVOICES',
1278: p_operation => 'U',
1279: p_key_value1 => P_invoice_id,
1280: p_calling_sequence => current_calling_sequence);
1281: