DBA Data[Home] [Help]

PACKAGE BODY: APPS.ARP_CTL_SUM_PKG

Source


1 PACKAGE BODY ARP_CTL_SUM_PKG AS
2 /* $Header: ARTUCTLB.pls 115.4 2003/10/10 14:29:29 mraymond ship $ */
3 
4 /*===========================================================================+
5  | PROCEDURE                                                                 |
6  |    select_summary                                                         |
7  |                                                                           |
8  | DESCRIPTION                                                               |
9  |    Selects the total trx,tax and freight amount for a given transaction   |
10  |                                                                           |
11  | SCOPE - PUBLIC                                                            |
12  |                                                                           |
13  | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED                                   |
14  |    arp_util.debug                                                         |
15  |                                                                           |
16  | ARGUMENTS  : IN:                                                          |
17  |                    p_customer_trx_id                                      |
18  |                    p_line_type                                            |
19  |              OUT:                                                         |
20  |                    p_amount_total                                         |
21  |                    p_amount_total_rtot_db                                 |
22  |          IN/ OUT:                                                         |
23  |                    None                                                   |
24  |                                                                           |
25  | RETURNS    : NONE                                                         |
26  |                                                                           |
27  |                                                                           |
28  | NOTES                                                                     |
29  |                                                                           |
30  | MODIFICATION HISTORY                                                      |
31  |     28-DEC-95  Vikas  Mahajan  Created                                    |
32  |                                                                           |
33  +===========================================================================*/
34 PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('AFLOG_ENABLED'), 'N');
35 
36 PROCEDURE select_summary(
37    p_customer_trx_id        IN  number,
38    p_line_type              IN  varchar2,
39    p_amount_total          OUT NOCOPY  number,
40    p_amount_total_rtot_db  OUT NOCOPY  number) IS
41 BEGIN
42 --   arp_util.debug('arp_ctl_sum_pkg.select_summary()+');
43    if ( p_line_type = 'ALL')
44    THEN
45      SELECT NVL( SUM( NVL(extended_amount,  0 ) ), 0),
46             NVL( SUM( NVL(extended_amount,  0 ) ), 0)
47      INTO   p_amount_total,
48             p_amount_total_rtot_db
49      FROM   ra_customer_trx_lines
50      WHERE  customer_trx_id = p_customer_trx_id;
51   ELSE
52      SELECT NVL( SUM( NVL(extended_amount,  0 ) ), 0),
53             NVL( SUM( NVL(extended_amount,  0 ) ), 0)
54      INTO   p_amount_total,
55             p_amount_total_rtot_db
56      FROM   ra_customer_trx_lines
57      WHERE  customer_trx_id = p_customer_trx_id
58      AND    line_type       = p_line_type;
59 
60 --     arp_util.debug('arp_ctl_sum_pkg.select_summary()-');
61   END IF;
62 EXCEPTION
63  WHEN OTHERS THEN
64 --   arp_util.debug('EXCEPTION:  arp_ctl_sum_pkg.select_summary()');
65    RAISE;
66 
67 END select_summary;
68 
69 /*===========================================================================+
70  | FUNCTION                                                                  |
71  |    get_summary                                                            |
72  |                                                                           |
73  | DESCRIPTION                                                               |
74  |    Gets the total trx,tax and freight amount for a given transaction      |
75  |                                                                           |
76  | SCOPE - PUBLIC                                                            |
77  |                                                                           |
78  | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED                                   |
79  |    arp_util.debug                                                         |
80  |                                                                           |
81  | ARGUMENTS  : IN:                                                          |
82  |                    p_customer_trx_id                                      |
83  |                    p_line_type                                            |
84  |              IN/ OUT:                                                     |
85  |                    None                                                   |
86  |                                                                           |
87  | RETURNS    :                                                              |
88  |                    p_amount_total                                         |
89  |                                                                           |
90  |                                                                           |
91  | NOTES                                                                     |
92  |                                                                           |
93  | MODIFICATION HISTORY                                                      |
94  |     03-Feb-98  Ramakant Alat   Created                                    |
95  |                                                                           |
96  +===========================================================================*/
97 
98 FUNCTION get_summary(
99         p_customer_trx_id IN ra_customer_trx.customer_trx_id%TYPE,
100         p_line_type              IN  varchar2
101 ) return NUMBER  IS
102 
103         p_amount_total           NUMBER;
104         p_amount_total_rtot      NUMBER;
105 BEGIN
106 
107 --   arp_util.debug('arp_ctl_sum_pkg.geT_summary()+');
108 
109      select_summary( p_customer_trx_id,
110                      p_line_type,
111                      p_amount_total,
112                      p_amount_total_rtot);
113 
114 --   arp_util.debug('arp_ctl_sum_pkg.get_summary()-');
115         return p_amount_total;
116 
117 EXCEPTION
118 
119 WHEN OTHERS THEN
120 --   arp_util.debug('EXCEPTION:  arp_ctl_sum_pkg.get_summary()');
121             RAISE;
122 
123 END get_summary;
124 
125 
126 END ARP_CTL_SUM_PKG;