DBA Data[Home] [Help]

PACKAGE: APPS.PO_DOCUMENT_CANCEL_PVT

Source


1 PACKAGE PO_Document_Cancel_PVT AUTHID CURRENT_USER AS
2 /* $Header: POXVDCAS.pls 120.2.12020000.2 2013/02/10 14:43:44 vegajula ship $ */
3 
4 g_pkg_name CONSTANT VARCHAR2(30) := 'PO_Document_Cancel_PVT';
5 
6 --<Bug 14207546 :Cancel Refactoring Project Starts>
7   c_entity_level_HEADER       CONSTANT VARCHAR2(30) := 'HEADER';
8   c_entity_level_LINE         CONSTANT VARCHAR2(30) := 'LINE';
9   c_entity_level_SHIPMENT     CONSTANT VARCHAR2(30) := 'LINE_LOCATION';
10   c_entity_level_DISTRIBUTION CONSTANT VARCHAR2(30) := 'DISTRIBUTION';
11 
12   c_doc_type_PO          CONSTANT VARCHAR2(30) := 'PO';
13   c_doc_type_PA          CONSTANT VARCHAR2(30) := 'PA';
14   c_doc_type_RELEASE     CONSTANT VARCHAR2(30) := 'RELEASE';
15   c_doc_type_QUOTATION   CONSTANT VARCHAR2(30) := 'QUOTATION';
16   c_doc_type_REQUISITION CONSTANT VARCHAR2(30) := 'REQUISITION';
17 
18   c_doc_subtype_STANDARD  CONSTANT VARCHAR2(30) := 'STANDARD';
19   c_doc_subtype_CONTRACT  CONSTANT VARCHAR2(30) := 'CONTRACT';
20   c_doc_subtype_PLANNED   CONSTANT VARCHAR2(30) := 'PLANNED';
21   c_doc_subtype_SCHEDULED CONSTANT VARCHAR2(30) := 'SCHEDULED';
22   c_doc_subtype_BLANKET   CONSTANT VARCHAR2(30) := 'BLANKET';
23   c_before_FC             CONSTANT VARCHAR2(9)  := 'BEFORE_FC';
24   c_after_FC              CONSTANT VARCHAR2(9)  := 'AFTER_FC';
25 
26 
27 
28   c_CANCEL_API  CONSTANT VARCHAR2(30) :='CANCEL API';
29   c_HTML_CONTROL_ACTION  CONSTANT VARCHAR2(30) :='HTML_CONTROL_ACTION';
30   c_FORM_CONTROL_ACTION  CONSTANT VARCHAR2(30) :='FORM_CONTROL_ACTION';
31 
32 
33 --<Bug 14207546 :Cancel Refactoring Project Ends>
34 
35 --<Bug 14207546 :Cancel Refactoring Project>
36 --------------------------------------------------------------------------------
37 --Start of Comments
38 --Name: cancel_document
39 
40 --Function:
41 --  Modifies: All cancel columns and who columns for this document at the entity
42 --  level of cancellation.
43 --  Effects: Cancels the document at the header, line, or shipment level
44 --    depending upon the document ID parameters after performing validations.
45 --    Validations include state checks and cancel submission checks. If
46 --    p_cbc_enabled is 'Y', then the CBC accounting date is updated to be
47 --    p_action_date. If p_cancel_reqs_flag is 'Y', then backing requisitions
48 --    will also be cancelled if allowable. Otherwise, they will be recreated.
49 --    Encumbrance is recalculated for cancelled entities if enabled. If the
50 --    cancel action is successful, the document's cancel and who columns will be
51 --    updated at the specified entity level. Otherwise, the document will remain
52 --    unchanged. All changes will be committed upon success if p_commit is
53 --    FND_API.G_TRUE.
54 
55 
56 --Parameters:
57 --IN:
58 --  p_da_call_rec
59 --  p_api_version
60 --  p_init_msg_list
61 
62 --IN OUT :
63 --OUT :
64 -- x_msg_data
65 -- x_return_status
66 --     FND_API.G_RET_STS_SUCCESS if cancel action succeeds
67 --     FND_API.G_RET_STS_ERROR if cancel action fails
68 --     FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
69 --
70 --End of Comments
71 --------------------------------------------------------------------------------
72 PROCEDURE cancel_document(
73             p_da_call_rec IN OUT NOCOPY po_document_action_pvt.DOC_ACTION_CALL_TBL_REC_TYPE,
74             p_api_version   IN  NUMBER,
75     p_init_msg_list    IN   VARCHAR2,
76     x_return_status    OUT  NOCOPY VARCHAR2,
77             x_msg_data      OUT NOCOPY VARCHAR2,
78             x_return_code   OUT NOCOPY VARCHAR2);
79 
80 PROCEDURE val_cancel_backing_reqs
81    (p_api_version    IN   NUMBER,
82     p_init_msg_list  IN   VARCHAR2,
83     x_return_status  OUT  NOCOPY VARCHAR2,
84     p_doc_type       IN   PO_DOCUMENT_TYPES.document_type_code%TYPE,
85     p_doc_id         IN   NUMBER);
86 
87 
88 
89 --<Bug 4571297 START>
90 FUNCTION is_document_cto_order
91 (   p_doc_id   IN po_headers.po_header_id%TYPE,
92     p_doc_type IN PO_DOCUMENT_TYPES_ALL_B.document_type_code%TYPE
93 ) RETURN BOOLEAN;
94 --<Bug 4571297 END>
95 
96 
97 --<Bug 14271696 :Cancel Refactoring Project>
98 --------------------------------------------------------------------------------
99 --Start of Comments
100 --Name: calculate_qty_cancel
101 
102 --Function:
103 --
104 --  Updates the Quanity/Amount Cancelled columns of Po lines/Shipments
105 --  and Distributions
106 --  The routine will be called from "Finally Close action"
107 --
108 --Parameters:
109 --IN:
110 --  p_action_date
111 --  p_doc_header_id
112 --  p_line_id
113 --  p_line_location_id
114 --  p_document_type
115 --  p_doc_subtype
116 
117 --IN OUT:
118 -- OUT:
119 --  x_return_status
120 --    FND_API.G_RET_STS_SUCCESS if procedure succeeds
121 --    FND_API.G_RET_STS_ERROR if procedure fails
122 --    FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
123 
124 --End of Comments
125 -------------------------------------------------------------------------------
126 PROCEDURE calculate_qty_cancel(
127             p_api_version       IN NUMBER,
128             p_init_msg_list     IN VARCHAR2,
129             p_doc_header_id     IN NUMBER,
130             p_line_id           IN NUMBER,
131             p_line_location_id  IN NUMBER,
132             p_document_type     IN VARCHAR2,
133             p_doc_subtype       IN VARCHAR2,
134             p_action_date       IN DATE,
135             x_return_status     OUT NOCOPY VARCHAR2);
136 
137 
138 END PO_Document_Cancel_PVT;