[Home] [Help]
PACKAGE BODY: APPS.AP_WEB_NOTES_PKG
Source
1 PACKAGE BODY AP_WEB_NOTES_PKG AS
2 /* $Header: apwnoteb.pls 115.1 2004/06/14 23:08:00 rlangi noship $ */
3
4
5 -----------------------------------------------------------------------------
6 /*Written By : Ron Langi
7 Purpose : Creates an Expense Report Preparer to Auditor Note
8 used for Approval Communications.
9 */
10 -----------------------------------------------------------------------------
11 procedure CreateERPrepToAudNote (
12 p_report_header_id IN NUMBER,
13 p_note IN VARCHAR2,
14 p_lang IN VARCHAR2,
15 p_entered_by IN NUMBER := fnd_global.user_id
16 )
17 IS
18
19 l_debug_info VARCHAR2(2000);
20
21 l_return_status varchar2(1);
22 l_msg_data varchar2(2000);
23 l_msg_count number;
24
25 BEGIN
26
27 if (p_report_header_id is not null and p_note is not null) then
28
29 --------------------------------------------------
30 l_debug_info := 'Create Preparer to Auditor Notes for ER';
31 --------------------------------------------------
32 AP_NOTES_PUB.Create_Note (
33 p_api_version => 1.0,
34 p_init_msg_list => FND_API.G_FALSE,
35 p_commit => FND_API.G_FALSE,
36 x_return_status => l_return_status,
37 x_msg_count => l_msg_count,
38 x_msg_data => l_msg_data,
39 p_source_object_code => c_ER_Object_Code,
40 p_source_object_id => p_report_header_id,
41 p_note_type => c_Prep_Aud_Note_Type,
42 p_notes_detail => p_note,
43 p_source_lang => p_lang,
44 p_entered_by => p_entered_by
45 );
46
47
48 end if;
49
50 EXCEPTION
51 WHEN OTHERS THEN
52 Wf_Core.Context('AP_WEB_NOTES_PKG', 'CreateERPrepToAudNote',
53 null, to_char(p_report_header_id), null, l_debug_info);
54 raise;
55
56
57 END CreateERPrepToAudNote;
58
59 -----------------------------------------------------------------------------
60 /*Written By : Ron Langi
61 Purpose : Deletes all Notes for an Expense Report object
62 */
63 -----------------------------------------------------------------------------
64 procedure DeleteERNotes (
65 p_src_report_header_id IN NUMBER
66 )
67 IS
68
69 l_debug_info VARCHAR2(2000);
70
71 l_return_status varchar2(1);
72 l_msg_data varchar2(2000);
73 l_msg_count number;
74
75 BEGIN
76
77 if (p_src_report_header_id is not null) then
78
79 --------------------------------------------------
80 l_debug_info := 'Delete Notes from ER';
81 --------------------------------------------------
82
83 AP_NOTES_PUB.Delete_Notes (
84 p_api_version => 1.0,
85 p_init_msg_list => FND_API.G_FALSE,
86 p_commit => FND_API.G_FALSE,
87 x_return_status => l_return_status,
88 x_msg_count => l_msg_count,
89 x_msg_data => l_msg_data,
90 p_source_object_code => c_ER_Object_Code,
91 p_source_object_id => p_src_report_header_id,
92 p_note_type => AP_NOTES_PUB.G_ALL_NOTE_TYPES
93 );
94
95 end if;
96
97 EXCEPTION
98 WHEN OTHERS THEN
99 Wf_Core.Context('AP_WEB_NOTES_PKG', 'DeleteERNotes',
100 null, to_char(p_src_report_header_id), null, l_debug_info);
101 raise;
102
103
104 END DeleteERNotes;
105
106
107 -----------------------------------------------------------------------------
108 /*Written By : Ron Langi
109 Purpose : Copies all Notes for an Expense Report object
110 */
111 -----------------------------------------------------------------------------
112 procedure CopyERNotes (
113 p_src_report_header_id IN NUMBER,
114 p_tgt_report_header_id IN NUMBER
115 )
116 IS
117
118 l_debug_info VARCHAR2(2000);
119
120 l_return_status varchar2(1);
121 l_msg_data varchar2(2000);
122 l_msg_count number;
123
124 BEGIN
125
126 if (p_src_report_header_id is not null and p_tgt_report_header_id is not null) then
127
128 --------------------------------------------------
129 l_debug_info := 'Copy Notes from original ER';
130 --------------------------------------------------
131
132 AP_NOTES_PUB.Copy_Notes (
133 p_api_version => 1.0,
134 p_init_msg_list => FND_API.G_FALSE,
135 p_commit => FND_API.G_FALSE,
136 x_return_status => l_return_status,
137 x_msg_count => l_msg_count,
138 x_msg_data => l_msg_data,
139 p_old_source_object_code => c_ER_Object_Code,
140 p_old_source_object_id => p_src_report_header_id,
141 p_new_source_object_code => c_ER_Object_Code,
142 p_new_source_object_id => p_tgt_report_header_id
143 );
144
145 end if;
146
147 EXCEPTION
148 WHEN OTHERS THEN
149 Wf_Core.Context('AP_WEB_NOTES_PKG', 'CopyERNotes',
150 null, to_char(p_src_report_header_id), null, l_debug_info);
151 raise;
152
153
154 END CopyERNotes;
155
156
157
158 END AP_WEB_NOTES_PKG;