1 PACKAGE PO_DOCUMENT_REVISION_GRP AUTHID CURRENT_USER AS
2 /* $Header: POXDOCRS.pls 120.0.12020000.2 2013/02/11 02:02:46 vegajula ship $ */
3
4 /*===========================================================================
5 PACKAGE NAME: PO_DOCUMENT_REVISION_GRP
6
7 DESCRIPTION: This package contains the server side Line level
8 Application Program Interfaces (APIs).
9
10 CLIENT/SERVER: Server
11
12 OWNER: pparthas
13
14 FUNCTION/PROCEDURE: MassUpdate_Releases()
15 ===========================================================================*/
16
17 /*******************************************************************
18 PROCEDURE NAME: Check_New_Revision
19
20 DESCRIPTION : Returns the new revsion number of the document if there
21 a need to increment.
22
23 Algr: Check if the the document revision_num is the same as the
24 revision_num of the latest archived version.
25
26 If this is not the case exit the routine since the revision
27 number is already incremented or the document was never
28 archived before.
29
30 For the different document types and subtypes the following
31 tables will be compared with the archived versions. The latest
32 archived version is recognizable by having the column
33 LATEST_EXTERNAL_FLAG = 'Y'. When 'table' is specified only
34 this table (when applicable) will be checked. The others are
35 assumed equal (this to improve performance).
36
37 Comparison regime:
38
39 For PO/PA STANDARD PLANNED BLANKET CONTRACT
40 =====================================================================
41 PO_HEADERS X X X X
42 PO_LINES X X X
43 PO_LINE_LOCATIONS X X X(PriceBreaks)
44 PO_DISTRIBUTIONS X X
45
46 For RELEASES SCHEDULED BLANKET
47 =====================================================================
48 PO_RELEASES X X
49 PO_LINE_LOCATIONS X X
50 PO_DISTRIBUTIONS X X
51
52 Note: This routine checks the same columns as the archiving routine
53 /src/xit/porar.lpc. Whenever you make changes to this routine
54 check if you have to do the same in the archiving routine.
55
56
57 Referenced by :
58 parameters : p_doc_type IN VARCHAR2 - PO,PA, RELEASE
59 p_doc_subtype IN VARCHAR2 - Document Sub-type Lookup Code.
60 PO - STANDARD / BLANKET etc.,
61 for RELEASE - SCHEDULED, BLANKET.
62 p_doc_id IN NUMBER - Document Header id or Release id.
63 p_table_name IN VARCHAR2 - Table you want to check.
64 p_doc_revision_num IN OUT NOCOPY NUMBER - The revision_number field.
65
66 Valid options for TABLE are:
67
68 ALL Checks all tables in the document type/subtype.
69 HEADER Checks only the PO_HEADER or RELEASE_HEADER.
70 LINES Checks only the PO_LINES.
71 SHIPMENTS Checks only the PO_LINE_LOCATIONS.
72 DISTRIBUTIONS Checks only the PO_DISTRIBUTIONS.
73
74
75 CHANGE History: Created 30-Sep-2002 pparthas
76 *******************************************************************/
77 Procedure Check_New_Revision (p_api_version IN NUMBER,
78 p_doc_type IN Varchar2,
79 p_doc_subtype IN Varchar2,
80 p_doc_id IN Number,
81 p_table_name IN Varchar2,
82 x_return_status OUT NOCOPY VARCHAR2,
83 x_doc_revision_num IN OUT NOCOPY Number,
84 x_message IN OUT NOCOPY VARCHAR2);
85
86
87
88 /*******************************************************************
89 FUNCTION NAME: Check_PO_PA_Revision
90
91 DESCRIPTION : This procedure builds the item cursor statement.
92 This statement needs to be built at run time
93 (dynamic SQL) because of the dynamic nature of the
94 System Item and Category flexfields.
95 Referenced by :
96 parameters : p_doc_type IN VARCHAR2 - Document Type Code.
97 p_doc_subtype IN VARCHAR2 - Document Sub-type Lookup Code.
98 p_doc_id IN NUMBER - Document Header id or Release id.
99 p_table_name IN VARCHAR2 - Table you want to check.
100 p_doc_revision_num IN OUT NOCOPY NUMBER - The revision_number field.
101
102 CHANGE History: Created 30-Sep-2002 pparthas
103 *******************************************************************/
104
105 FUNCTION Check_PO_PA_Revision (
106 p_doc_type IN Varchar2,
107 p_doc_subtype IN Varchar2,
108 p_doc_id IN Number,
109 p_table_name IN Varchar2,
110 p_line_id IN NUMBER, --<CancelPO FPJ>
111 p_line_location_id IN NUMBER, --<CancelPO FPJ>
112 p_chk_cancel_flag IN VARCHAR2, --<CancelPO FPJ>
113 x_different OUT NOCOPY Varchar2) --<CancelPO FPJ>
114 RETURN BOOLEAN;
115
116 /*******************************************************************
117 FUNCTION NAME: Check_Release_Revision
118
119 DESCRIPTION : This API is called from the main procedure
120 MassUpdate_Releases to wrap up the releases
121 If the Release had any shipment price updated,
122 then document revision had to incremented and
123 approval had to initiated if necessary.
124 Referenced by :
125 parameters : p_doc_type IN VARCHAR2 - Document Type Code.
126 p_doc_subtype IN VARCHAR2 - Document Sub-type Lookup Code.
127 p_doc_id IN NUMBER - Document Header id or Release id.
128 p_table_name IN VARCHAR2 - Table you want to check.
129 p_doc_revision_num IN OUT NOCOPY NUMBER - The revision_number field.
130
131 CHANGE History: Created 30-Sep-2002 pparthas
132 *******************************************************************/
133 FUNCTION Check_Release_Revision (
134 p_doc_type IN Varchar2,
135 p_doc_subtype IN Varchar2,
136 p_doc_id IN Number,
137 p_table_name IN Varchar2,
138 p_line_location_id IN NUMBER, --<CancelPO FPJ>
139 p_chk_cancel_flag IN VARCHAR2, --<CancelPO FPJ>
140 x_different OUT NOCOPY Varchar2) --<CancelPO FPJ>
141 RETURN BOOLEAN;
142
143
144 --<CancelPO FPJ Start>
145 -- Detailed Comments maintained in Package Body PO_DOCUMENT_REVISION_GRP
146 PROCEDURE Compare(
147 p_api_version IN NUMBER,
148 p_doc_id IN NUMBER,
149 p_doc_type IN VARCHAR2,
150 p_doc_subtype IN VARCHAR2,
151 p_line_id IN NUMBER,
152 p_line_location_id IN NUMBER,
153 x_different OUT NOCOPY Varchar2,
154 x_return_status OUT NOCOPY VARCHAR2
155 );
156 --<CancelPO FPJ End>
157 -------------------------------------------------------------------------------
158 --<Bug 14254141 :Cancel Refactoring Project >
159 --Start of Comments
160 --Name: CHECK_REV_DIFF
161 --Function:
162 -- Checks if there are any non-approved changes in the base tables
163 -- The below columns of base tables are compared against archive :
164 -- Need_By_Data /Promised Date
165 -- Quantity
166 -- Price
167 -- Amount
168 --Notes:
169 -- See the package body for more comments.
170 --End of Comments
171 -------------------------------------------------------------------------------
172
173 PROCEDURE CHECK_REV_DIFF(
174 p_api_version IN NUMBER,
175 p_doc_id IN NUMBER,
176 p_doc_type IN VARCHAR2,
177 p_doc_subtype IN VARCHAR2,
178 p_line_id IN NUMBER,
179 p_line_location_id IN NUMBER,
180 p_action_level IN VARCHAR2,
181 x_msg_name OUT NOCOPY Varchar2,
182 x_msg_type OUT NOCOPY VARCHAR2,
183 x_token_name_tbl OUT NOCOPY PO_TBL_VARCHAR30,
184 x_token_value_tbl OUT NOCOPY PO_TBL_VARCHAR2000,
185 x_return_status OUT NOCOPY VARCHAR2
186 );
187
188
189
190 END PO_DOCUMENT_REVISION_GRP;