DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_NOTIF_CONTROLS_SV

Source


1 PACKAGE BODY PO_NOTIF_CONTROLS_SV AS
2 /* $Header: POXPONCB.pls 120.0.12010000.1 2008/09/18 12:21:00 appldev noship $*/
3 /*===========================================================================
4 
5   FUNCTION NAME:	delete_notifs()
6 
7 ===========================================================================*/
8 
9  FUNCTION delete_notifs(X_po_header_id IN number)
10           return boolean is
11           X_deleted boolean;
12 
13           X_progress VARCHAR2(3) := NULL;
14 
15  BEGIN
16         DELETE FROM po_notification_controls
17         WHERE po_header_id = X_po_header_id;
18 
19         X_deleted := TRUE;
20         return(X_deleted);
21 
22   EXCEPTION
23         when no_data_found then
24              null;   /* It is not an error if there are no notification controls */
25 
26         when others then
27              po_message_s.sql_error('delete_notifs', x_progress, sqlcode);
28              raise ;
29 
30 END delete_notifs;
31 
32 /*===========================================================================
33 
34   PROCEDURE NAME:	val_notif_controls()
35 
36 ===========================================================================*/
37 
38 FUNCTION val_notif_controls (X_po_header_id IN number)
39                              RETURN BOOLEAN IS
40 
41    x_progress 		     VARCHAR2(3) := NULL;
42    X_amt_base_notif_cntl_row NUMBER := 0;
43 
44 BEGIN
45 
46    X_progress := '010';
47    SELECT  COUNT(1)
48      INTO  X_amt_base_notif_cntl_row
49      FROM  po_notification_controls
50     WHERE  po_header_id                 = X_po_header_id
51       AND  notification_condition_code <> 'EXPIRATION';
52 
53    IF X_amt_base_notif_cntl_row > 0 THEN
54       RETURN (TRUE);
55    ELSE
56       RETURN (FALSE);
57    END IF;
58 
59    EXCEPTION
60    WHEN OTHERS THEN
61       RETURN (FALSE);
62       po_message_s.sql_error('val_notif_controls', x_progress, sqlcode);
63    RAISE;
64 
65 END val_notif_controls;
66 
67 /*===========================================================================
68 
69   FUNCTION NAME:	val_date_notif()
70 
71 ===========================================================================*/
72 
73 FUNCTION   val_date_notif(X_po_header_id IN number,
74                           X_end_date IN date )
75                 return boolean is
76                 X_valid_date boolean;
77 
78      X_progress  varchar2(3) := '000';
79      cursor c1 is
80             SELECT 'date based notification controls exist'
81             FROM  po_notification_controls
82             WHERE po_header_id                = X_po_header_id
83             AND   notification_condition_code = 'EXPIRATION';
84 
85      Recinfo c1%rowtype;
86 
87 BEGIN
88 
89     X_progress := '010';
90 
91     open c1;
92 
93     X_progress := '020';
94     fetch c1 into Recinfo;
95 
96     X_progress := '030';
97 
98     if (c1%notfound) then
99         close c1;
100         X_valid_date := TRUE;
101         return(X_valid_date);
102      end if;
103      X_progress := '040';
104 
105      X_valid_date := FALSE;
106 
107      -- Bug 509797
108      -- po_message_s.app_error('PO_PO_NFC_DATE_CONTROLS_EXIST');
109      fnd_message.set_name('PO', 'PO_PO_NFC_DATE_CONTROLS_EXIST');
110      return(X_valid_date);
111 
112  EXCEPTION
113      when others then
114           po_message_s.sql_error('val_date_notif', x_progress, sqlcode);
115          raise;
116 
117 END val_date_notif;
118 
119 
120 
121 END PO_NOTIF_CONTROLS_SV;