1 PACKAGE OE_SALES_CAN_UTIL AS
2 /* $Header: OEXUCANS.pls 120.0.12010000.2 2008/11/19 10:30:48 vbkapoor ship $ */
3
4 -- Start of Comments
5 -- API name OE_SALES_CAN_UTIL
6 -- Type Private
7 -- Function
8 --
9 -- Pre-reqs
10 --
11 -- Parameters
12 --
13 -- Version Current version = 1.0
14 -- Initial version = 1.0
15 --
16 -- Notes
17 --
18 -- End of Comments
19
20 G_PKG_NAME VARCHAR2(30) := 'OE_SALES_CAN_UTIL';
21 G_LINE_REC OE_ORDER_PUB.Line_Rec_Type;
22 G_REQUIRE_REASON BOOLEAN := FALSE;
23 G_ORDER_CANCEL BOOLEAN := FALSE;
24
25 /* 7576948: IR ISO Change Management project Start */
26
27 -- This global is added to check the header level cancellation
28 -- in IR ISO change management project. If this global is TRUE
29 -- then no line level IR ISO OE_GLOBALS.G_UPDATE_REQUISITION
30 -- delayed request will be logged for Schedule Ship Date change.
31 -- However, for ordered quantity change, if this global is TRUE,
32 -- delayed request will be logged but just to track the count of
33 -- lines cancelled under that header, which will be useful to
34 -- determine the total count of lines cancellaed for partial
35 -- order cancellation case.
36 G_IR_ISO_HDR_CANCEL BOOLEAN := FALSE;
37
38 -- Since with IR ISO change management project, it is feasible
39 -- that if requisition header is cancelled, which is partially
40 -- shipped/received, corresponding internal sales order will
41 -- also be triggered for partial cancellation. If that is true
42 -- then for existing shipped but unfulfilled lines, which are
43 -- part of fulfillment set and waiting for fulfillment, may get
44 -- stuck, being existsing open line get cancelled from this
45 -- partial order cancellation flow. Thus, so as to push those
46 -- lines for fulfillment, we need to trigger their Fulfill-Line
47 -- workflow activity, which happens via below procdure. Earlier
48 -- this procedure was limited with usage in the current package
49 -- only, but with IR ISO CMS project, it is needed to be called
50 -- from OE_Internal_Requisition_Pvt.Process_Line_Entity. So
51 -- now exposing it publically.
52 PROCEDURE Call_Process_Fulfillment(p_header_id IN NUMBER);
53
54 -- For details on IR ISO CMS project, please refer to FOL >
55 -- OM Development > OM-GM > 12.1.1 > TDD > IR_ISO_CMS_TDD.doc
56
57 /* IR ISO Change Management project End */
58
59 PROCEDURE check_constraints
60 ( p_x_line_rec IN OUT NOCOPY OE_Order_PUB.Line_Rec_Type
61 , p_old_line_rec IN OE_Order_PUB.Line_Rec_Type :=
62 OE_Order_PUB.G_MISS_LINE_REC
63 , x_return_status OUT NOCOPY VARCHAR2
64
65 );
66
67 PROCEDURE check_constraints
68 ( p_header_rec IN OE_Order_PUB.Header_Rec_Type
69 , p_old_header_rec IN OE_Order_PUB.header_Rec_Type:=
70 OE_Order_PUB.G_MISS_header_REC
71 , x_return_status OUT NOCOPY VARCHAR2
72
73 );
74
75 PROCEDURE update_service
76 ( p_line_rec IN OE_Order_PUB.Line_Rec_Type
77 , p_old_line_rec IN OE_Order_PUB.Line_Rec_Type :=
78 OE_Order_PUB.G_MISS_LINE_REC
79 , x_return_status OUT NOCOPY VARCHAR2
80
81 );
82
83
84 FUNCTION Cal_Cancelled_Qty (
85 p_line_rec IN OE_Order_PUB.Line_Rec_Type
86 , p_old_line_rec IN OE_Order_PUB.Line_Rec_Type :=
87 OE_Order_PUB.G_MISS_LINE_REC
88 )Return Number;
89
90 FUNCTION Cal_Cancelled_Qty2 ( -- INVCONV
91 p_line_rec IN OE_Order_PUB.Line_Rec_Type
92 , p_old_line_rec IN OE_Order_PUB.Line_Rec_Type :=
93 OE_Order_PUB.G_MISS_LINE_REC
94 )Return Number;
95
96
97 PROCEDURE perform_line_change
98 ( p_line_rec IN OE_Order_PUB.Line_Rec_Type
99 , p_old_line_rec IN OE_Order_PUB.Line_Rec_Type :=
100 OE_Order_PUB.G_MISS_LINE_REC
101 , x_return_status OUT NOCOPY varchar2
102
103 );
104
105 PROCEDURE perform_cancel_order
106 ( p_header_rec IN OE_Order_PUB.header_Rec_Type
107 , p_old_header_rec IN OE_Order_PUB.header_Rec_Type :=
108 OE_Order_PUB.G_MISS_header_REC
109 , x_return_status OUT NOCOPY varchar2
110
111 );
112
113 PROCEDURE Cancel_Remaining_Order
114 ( p_Header_Rec IN OE_Order_PUB.Header_Rec_Type
115 := OE_Order_PUB.G_MISS_header_REC,
116 p_header_id IN NUMBER := FND_API.G_MISS_NUM
117 , x_return_status OUT NOCOPY varchar2
118
119 );
120
121
122 FUNCTION Query_Rows
123 ( p_line_id IN NUMBER :=
124 FND_API.G_MISS_NUM
125 , p_header_id IN NUMBER :=
126 FND_API.G_MISS_NUM
127 ) RETURN OE_Order_PUB.Line_Tbl_Type;
128
129 PROCEDURE Cancel_Wf
130 (
131 x_return_status OUT NOCOPY varchar2
132 , x_request_rec IN OUT NOCOPY OE_Order_PUB.Request_Rec_Type
133 );
134
135 END OE_SALES_CAN_UTIL;