DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGIGITCH

Source


1 Package Body IGIGITCH AS
2 -- $Header: igiitrob.pls 120.2.12000000.1 2007/09/12 10:32:10 mbremkum ship $
3 
4    PROCEDURE Update_Header_Status(p_it_header_id IN NUMBER) IS
5      l_total_recs    NUMBER;
6      l_total_status  NUMBER;
7 
8    BEGIN
9      -- get total number of services associated with the cross charge
10      SELECT count(*)
11      INTO   l_total_recs
12      FROM   igi_itr_charge_lines
13      WHERE  it_header_id = p_it_header_id;
14 
15      -- get total number of services that are either in canceled L or
16      -- approved A status
17      SELECT count(*)
18      INTO   l_total_status
19      FROM   igi_itr_charge_lines
20      WHERE  it_header_id = p_it_header_id
21      AND    status_flag IN ('L', 'A');
22 
23      -- if all the services are either cancelled or approved then update
24      -- the header status to complete C
25      IF (l_total_recs = l_total_status) THEN
26         UPDATE igi_itr_charge_headers
27         SET    submit_flag = 'C'
28         WHERE  it_header_id = p_it_header_id;
29      END IF;
30 
31    END Update_Header_Status;
32 END;