DBA Data[Home] [Help]

APPS.AP_HOLDS_PKG dependencies on AP_HOLDS

Line 1: PACKAGE BODY AP_HOLDS_PKG AS

1: PACKAGE BODY AP_HOLDS_PKG AS
2: /* $Header: apiholdb.pls 120.15 2011/07/18 13:52:44 pgayen ship $ */
3:
4:
5: /* */

Line 6: G_PKG_NAME CONSTANT VARCHAR2(30) := 'AP_HOLDS_PKG';

2: /* $Header: apiholdb.pls 120.15 2011/07/18 13:52:44 pgayen ship $ */
3:
4:
5: /* */
6: G_PKG_NAME CONSTANT VARCHAR2(30) := 'AP_HOLDS_PKG';
7: G_MSG_UERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR;
8: G_MSG_ERROR CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR;
9: G_MSG_SUCCESS CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_SUCCESS;
10: G_MSG_HIGH CONSTANT NUMBER := FND_MSG_PUB.G_MSG_LVL_DEBUG_HIGH;

Line 22: G_MODULE_NAME CONSTANT VARCHAR2(100) := 'AP.PLSQL.AP_HOLDS_PKG.';

18: G_LEVEL_EXCEPTION CONSTANT NUMBER := FND_LOG.LEVEL_EXCEPTION;
19: G_LEVEL_EVENT CONSTANT NUMBER := FND_LOG.LEVEL_EVENT;
20: G_LEVEL_PROCEDURE CONSTANT NUMBER := FND_LOG.LEVEL_PROCEDURE;
21: G_LEVEL_STATEMENT CONSTANT NUMBER := FND_LOG.LEVEL_STATEMENT;
22: G_MODULE_NAME CONSTANT VARCHAR2(100) := 'AP.PLSQL.AP_HOLDS_PKG.';
23:
24: PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
25: x_hold_id in out nocopy number, --5128839
26: X_Invoice_Id NUMBER,

Line 60: CURSOR C IS SELECT rowid FROM AP_HOLDS

56: X_Attribute_Category VARCHAR2,
57: X_Org_Id NUMBER,
58: X_calling_sequence IN VARCHAR2
59: ) IS
60: CURSOR C IS SELECT rowid FROM AP_HOLDS
61: WHERE invoice_id = X_Invoice_Id
62: AND ( (line_location_id = X_Line_Location_Id)
63: or (line_location_id is NULL and X_Line_Location_Id is NULL))
64: AND hold_lookup_code = X_Hold_Lookup_Code;

Line 74: current_calling_sequence := 'AP_HOLDS_PKG.INSERT_ROW<-' ||

70: BEGIN
71:
72: -- Update the calling sequence
73: --
74: current_calling_sequence := 'AP_HOLDS_PKG.INSERT_ROW<-' ||
75: X_calling_sequence;
76:
77:
78: select ap_holds_s.nextval

Line 78: select ap_holds_s.nextval

74: current_calling_sequence := 'AP_HOLDS_PKG.INSERT_ROW<-' ||
75: X_calling_sequence;
76:
77:
78: select ap_holds_s.nextval
79: into x_hold_id
80: from dual;
81:
82: debug_info := 'Insert into AP_HOLDS';

Line 82: debug_info := 'Insert into AP_HOLDS';

78: select ap_holds_s.nextval
79: into x_hold_id
80: from dual;
81:
82: debug_info := 'Insert into AP_HOLDS';
83: INSERT INTO AP_HOLDS(
84: hold_id,
85: invoice_id,
86: line_location_id,

Line 83: INSERT INTO AP_HOLDS(

79: into x_hold_id
80: from dual;
81:
82: debug_info := 'Insert into AP_HOLDS';
83: INSERT INTO AP_HOLDS(
84: hold_id,
85: invoice_id,
86: line_location_id,
87: hold_lookup_code,

Line 173: (p_table_name => 'AP_HOLDS',

169: END IF;
170:
171: --Bug 4539462 DBI logging
172: AP_DBI_PKG.Maintain_DBI_Summary
173: (p_table_name => 'AP_HOLDS',
174: p_operation => 'I',
175: p_key_value1 => X_invoice_id,
176: p_calling_sequence => current_calling_sequence);
177:

Line 242: FROM AP_HOLDS

238: X_calling_sequence IN VARCHAR2
239: ) IS
240: CURSOR C IS
241: SELECT *
242: FROM AP_HOLDS
243: WHERE rowid = X_Rowid
244: FOR UPDATE of Invoice_Id NOWAIT;
245: Recinfo C%ROWTYPE;
246: current_calling_sequence VARCHAR2(2000);

Line 253: current_calling_sequence := 'AP_HOLDS_PKG.LOCK_ROW<-' ||

249:
250: BEGIN
251: -- Update the calling sequence
252: --
253: current_calling_sequence := 'AP_HOLDS_PKG.LOCK_ROW<-' ||
254: X_calling_sequence;
255: debug_info := 'Open cursor C';
256: OPEN C;
257: debug_info := 'Fetch cursor C';

Line 416: l_old_wf_status AP_HOLDS_ALL.WF_STATUS%TYPE ; -- Bug 8266290

412: l_success BOOLEAN := TRUE;
413: l_error_code VARCHAR2(4000);
414: current_calling_sequence VARCHAR2(2000);
415: debug_info VARCHAR2(100);
416: l_old_wf_status AP_HOLDS_ALL.WF_STATUS%TYPE ; -- Bug 8266290
417: l_hold_id AP_HOLDS_ALL.HOLD_ID%TYPE ; -- Bug 8266290
418: BEGIN
419: -- Update the calling sequence
420: --

Line 417: l_hold_id AP_HOLDS_ALL.HOLD_ID%TYPE ; -- Bug 8266290

413: l_error_code VARCHAR2(4000);
414: current_calling_sequence VARCHAR2(2000);
415: debug_info VARCHAR2(100);
416: l_old_wf_status AP_HOLDS_ALL.WF_STATUS%TYPE ; -- Bug 8266290
417: l_hold_id AP_HOLDS_ALL.HOLD_ID%TYPE ; -- Bug 8266290
418: BEGIN
419: -- Update the calling sequence
420: --
421: current_calling_sequence := 'AP_HOLDS_PKG.UPDATE_ROW<-' ||

Line 421: current_calling_sequence := 'AP_HOLDS_PKG.UPDATE_ROW<-' ||

417: l_hold_id AP_HOLDS_ALL.HOLD_ID%TYPE ; -- Bug 8266290
418: BEGIN
419: -- Update the calling sequence
420: --
421: current_calling_sequence := 'AP_HOLDS_PKG.UPDATE_ROW<-' ||
422: X_calling_sequence;
423:
424: -- Bug 8266290 : Start
425: SELECT wf_status,

Line 429: FROM ap_holds

425: SELECT wf_status,
426: hold_id
427: INTO l_old_wf_status,
428: l_hold_id
429: FROM ap_holds
430: WHERE rowid = X_Rowid ;
431:
432: /* Bug 9691312 : Changed the IF condition
433: IF l_old_wf_status = 'STARTED' and

Line 440: debug_info := 'Update AP_HOLDS';

436: AP_WORKFLOW_PKG.abort_holds_workflow( l_hold_id ) ;
437: END IF ;
438: -- Bug 8266290 : End
439:
440: debug_info := 'Update AP_HOLDS';
441: UPDATE AP_HOLDS
442: SET
443: invoice_id = X_Invoice_Id,
444: line_location_id = X_Line_Location_Id,

Line 441: UPDATE AP_HOLDS

437: END IF ;
438: -- Bug 8266290 : End
439:
440: debug_info := 'Update AP_HOLDS';
441: UPDATE AP_HOLDS
442: SET
443: invoice_id = X_Invoice_Id,
444: line_location_id = X_Line_Location_Id,
445: hold_lookup_code = X_Hold_Lookup_Code,

Line 481: (p_table_name => 'AP_HOLDS',

477: WHERE rowid = X_Rowid;
478:
479: --Bug 4539462 DBI logging
480: AP_DBI_PKG.Maintain_DBI_Summary
481: (p_table_name => 'AP_HOLDS',
482: p_operation => 'U',
483: p_key_value1 => X_invoice_id,
484: p_calling_sequence => current_calling_sequence);
485:

Line 590: current_calling_sequence := 'AP_HOLDS_PKG.DELETE_ROW<-' ||

586:
587: BEGIN
588: -- Update the calling sequence
589: --
590: current_calling_sequence := 'AP_HOLDS_PKG.DELETE_ROW<-' ||
591: X_calling_sequence;
592:
593: --Bug 4539462 Need the invoice_id
594: Select invoice_id

Line 596: From ap_holds

592:
593: --Bug 4539462 Need the invoice_id
594: Select invoice_id
595: Into l_invoice_id
596: From ap_holds
597: Where rowid = X_Rowid;
598:
599: debug_info := 'Delete from AP_HOLDS';
600: DELETE FROM AP_HOLDS

Line 599: debug_info := 'Delete from AP_HOLDS';

595: Into l_invoice_id
596: From ap_holds
597: Where rowid = X_Rowid;
598:
599: debug_info := 'Delete from AP_HOLDS';
600: DELETE FROM AP_HOLDS
601: WHERE rowid = X_Rowid;
602:
603: if (SQL%NOTFOUND) then

Line 600: DELETE FROM AP_HOLDS

596: From ap_holds
597: Where rowid = X_Rowid;
598:
599: debug_info := 'Delete from AP_HOLDS';
600: DELETE FROM AP_HOLDS
601: WHERE rowid = X_Rowid;
602:
603: if (SQL%NOTFOUND) then
604: Raise NO_DATA_FOUND;

Line 609: (p_table_name => 'AP_HOLDS',

605: end if;
606:
607: --Bug 4539462 DBI logging
608: AP_DBI_PKG.Maintain_DBI_Summary
609: (p_table_name => 'AP_HOLDS',
610: p_operation => 'D',
611: p_key_value1 => l_invoice_id,
612: p_calling_sequence => current_calling_sequence);
613:

Line 629: -- the AP_HOLDS table given a record in ap_invoices.

625: END Delete_Row;
626:
627: -----------------------------------------------------------------------
628: -- PROCEDURE insert_single_hold inserts a single record into
629: -- the AP_HOLDS table given a record in ap_invoices.
630: -----------------------------------------------------------------------
631: PROCEDURE insert_single_hold (X_invoice_id IN number,
632: X_hold_lookup_code IN varchar2,
633: X_hold_type IN varchar2 DEFAULT NULL,

Line 640: l_hold_reason ap_holds.hold_reason%TYPE; --bug 1188566

636: X_calling_sequence IN varchar2 DEFAULT NULL)
637: IS
638: current_calling_sequence VARCHAR2(2000);
639: debug_info VARCHAR2(100);
640: l_hold_reason ap_holds.hold_reason%TYPE; --bug 1188566
641: -- Added for bug 9715670.
642: l_user_releaseable_flag VARCHAR2(1);
643: l_initiate_workflow_flag VARCHAR2(1);
644:

Line 656: l_hold_id ap_holds_all.hold_id%type;

652: where hold_type = nvl(X_hold_type,hold_type)
653: and hold_lookup_code = X_hold_lookup_code;
654:
655: l_api_name varchar2(50);
656: l_hold_id ap_holds_all.hold_id%type;
657:
658: BEGIN
659:
660: -- Update the calling sequence

Line 663: 'AP_HOLDS_PKG.insert_single_hold<-'||

659:
660: -- Update the calling sequence
661: --
662: current_calling_sequence :=
663: 'AP_HOLDS_PKG.insert_single_hold<-'||
664: X_calling_sequence;
665: l_api_name := 'Insert_Single_Hold';
666:
667: -- If no hold_code was passed to the procedure, abort the call

Line 717: debug_info := 'Insert into AP_HOLDS';

713: --else
714: -- l_hold_reason := X_hold_reason;
715: --end if;*/
716:
717: debug_info := 'Insert into AP_HOLDS';
718: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
719: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,debug_info);
720: END IF;
721:

Line 723: SELECT ap_holds_s.nextval

719: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,debug_info);
720: END IF;
721:
722: --bugfix:5523240
723: SELECT ap_holds_s.nextval
724: INTO l_hold_id
725: FROM DUAL;
726:
727: INSERT INTO AP_HOLDS

Line 727: INSERT INTO AP_HOLDS

723: SELECT ap_holds_s.nextval
724: INTO l_hold_id
725: FROM DUAL;
726:
727: INSERT INTO AP_HOLDS
728: (INVOICE_ID, HOLD_LOOKUP_CODE, HOLD_DATE,
729: CREATED_BY, CREATION_DATE, LAST_UPDATE_LOGIN,
730: LAST_UPDATE_DATE, LAST_UPDATED_BY,
731: HELD_BY, HOLD_REASON, ORG_ID, HOLD_ID)

Line 746: FROM ap_holds

742: FROM ap_invoices
743: WHERE invoice_id = X_invoice_id
744: AND not exists
745: (SELECT 'Already on this hold'
746: FROM ap_holds
747: WHERE invoice_id = X_invoice_id
748: AND hold_lookup_code = X_hold_lookup_code
749: AND release_lookup_code IS NULL);
750:

Line 771: (p_table_name => 'AP_HOLDS',

767: END IF;
768:
769: --Bug 4539462 DBI logging
770: AP_DBI_PKG.Maintain_DBI_Summary
771: (p_table_name => 'AP_HOLDS',
772: p_operation => 'I',
773: p_key_value1 => X_invoice_id,
774: p_calling_sequence => current_calling_sequence);
775:

Line 800: -- record in AP_HOLDS with a release_lookup_code

796: END insert_single_hold;
797:
798: -----------------------------------------------------------------------
799: -- PROCEDURE release_single_hold releases a hold by updating a single
800: -- record in AP_HOLDS with a release_lookup_code
801: -----------------------------------------------------------------------
802: PROCEDURE release_single_hold (X_invoice_id IN number,
803: X_hold_lookup_code IN varchar2,
804: X_release_lookup_code IN varchar2,

Line 825: 'AP_HOLDS_PKG.release_single_hold<-'||

821:
822: -- Update the calling sequence
823: --
824: current_calling_sequence :=
825: 'AP_HOLDS_PKG.release_single_hold<-'||
826: X_calling_sequence;
827:
828: debug_info := 'Select from AP_INVOICES';
829:

Line 834: debug_info := 'Update AP_HOLDS';

830: open invoice_who_cursor;
831: fetch invoice_who_cursor into l_last_updated_by, l_last_update_login;
832: close invoice_who_cursor;
833:
834: debug_info := 'Update AP_HOLDS';
835:
836: /* Bug 9691312 Begin */
837: FOR c_wf_status IN ( SELECT hold_id
838: FROM ap_holds

Line 838: FROM ap_holds

834: debug_info := 'Update AP_HOLDS';
835:
836: /* Bug 9691312 Begin */
837: FOR c_wf_status IN ( SELECT hold_id
838: FROM ap_holds
839: WHERE invoice_id = X_invoice_id
840: AND held_by = nvl(X_held_by,held_by)
841: AND release_lookup_code IS NULL
842: AND hold_lookup_code = X_hold_lookup_code

Line 850: UPDATE ap_holds

846: AP_WORKFLOW_PKG.abort_holds_workflow( c_wf_status.hold_id ) ;
847: END LOOP ;
848: /* Bug 9691312 End */
849:
850: UPDATE ap_holds
851: SET release_lookup_code = X_release_lookup_code,
852: release_reason = (SELECT description
853: FROM ap_lookup_codes
854: WHERE lookup_type = 'HOLD CODE'

Line 866: (p_table_name => 'AP_HOLDS',

862: AND hold_lookup_code = X_hold_lookup_code;
863:
864: --Bug 4539462 DBI logging
865: AP_DBI_PKG.Maintain_DBI_Summary
866: (p_table_name => 'AP_HOLDS',
867: p_operation => 'U',
868: p_key_value1 => X_invoice_id,
869: p_calling_sequence => current_calling_sequence);
870:

Line 926: from ap_holds

922: where invoice_id = X_invoice_id;
923:
924: cursor tax_holds_cursor is
925: select hold_lookup_code
926: from ap_holds
927: where invoice_id = x_invoice_id
928: and hold_lookup_code IN ('TAX AMOUNT RANGE','TAX VARIANCE')
929: and release_lookup_code IS NULL;
930:

Line 936: 'AP_HOLDS_PKG.quick_release<-'||

932:
933: -- Update the calling sequence
934: --
935: current_calling_sequence :=
936: 'AP_HOLDS_PKG.quick_release<-'||
937: X_calling_sequence;
938:
939: /*Bug 12747896: commented below initialization as it is not needed for associative arrays*/
940: /*FOR num IN 1..10 LOOP

Line 955: FROM AP_HOLDS H

951: WHERE D.invoice_id = X_invoice_id
952: AND ((X_hold_lookup_code = 'CANT CLOSE PO') OR
953: ((X_hold_lookup_code = 'ALL')
954: AND EXISTS(SELECT 'X'
955: FROM AP_HOLDS H
956: WHERE H.invoice_id = X_invoice_id
957: AND H.hold_lookup_code = 'CANT CLOSE PO'
958: AND H.release_lookup_code IS NULL)));
959:

Line 977: FROM ap_holds H

973: /*Bug 12747896 : END*/
974:
975: -- Bug 8266290 : Start
976: FOR c_wf_status IN ( SELECT hold_id
977: FROM ap_holds H
978: WHERE H.invoice_id = X_invoice_id
979: AND X_hold_lookup_code IN (H.hold_lookup_code, 'ALL')
980: AND H.hold_lookup_code not in ('DIST VARIANCE', 'NO RATE',
981: 'CANT FUNDS CHECK', 'INSUFFICIENT FUNDS',

Line 996: debug_info := 'Update AP_HOLDS';

992: ------------------------------------------------------------------------
993: -- Release single hold if pass hold_lookup_code or all holds if pass 'ALL'
994: -- in hold_lookup_code
995: ------------------------------------------------------------------------
996: debug_info := 'Update AP_HOLDS';
997:
998: UPDATE ap_holds H
999: SET H.release_lookup_code = X_release_lookup_code,
1000: H.release_reason = X_release_reason,

Line 998: UPDATE ap_holds H

994: -- in hold_lookup_code
995: ------------------------------------------------------------------------
996: debug_info := 'Update AP_HOLDS';
997:
998: UPDATE ap_holds H
999: SET H.release_lookup_code = X_release_lookup_code,
1000: H.release_reason = X_release_reason,
1001: H.responsibility_id = X_responsibility_id,
1002: H.last_update_date = X_last_update_date,

Line 1014: (p_table_name => 'AP_HOLDS',

1010: AND H.release_lookup_code is null;
1011:
1012: --Bug 4539462 DBI logging
1013: AP_DBI_PKG.Maintain_DBI_Summary
1014: (p_table_name => 'AP_HOLDS',
1015: p_operation => 'U',
1016: p_key_value1 => X_invoice_id,
1017: p_calling_sequence => current_calling_sequence);
1018:

Line 1117: END AP_HOLDS_PKG;

1113:
1114:
1115:
1116:
1117: END AP_HOLDS_PKG;
1118: