DBA Data[Home] [Help]

PACKAGE BODY: APPS.AR_ARATAPPM_PKG

Source


1 PACKAGE BODY AR_ARATAPPM_PKG AS
2 /*$Header: ARATAPPMB.pls 120.1.12010000.2 2009/03/30 12:12:48 vsanka noship $*/
3 
4 /*
5 *  Automatic Cash Application Execution Report
6 *
7 *  Created by		: 	vsanka
8 *  Creation Date	:	03-24-09
9 *  Description		:	Utilities of ARATAPPM XML Pub Report.
10 */
11 
12 function BeforeReport return boolean is
13 
14 flag VARCHAR2(10);
15 begin
16 
17    flag := 'N';
18 
19    select name
20    into l_org_name
21    from hr_operating_units
22    where organization_id = p_org_id;
23 
24    select count(distinct cash_receipt_id)
25    into l_no_receipts_processed
26    from ar_cash_remit_refs_interim;
27 
28    select count(*)
29    into l_no_remit_lines_processed
30    from ar_cash_remit_refs_interim;
31 
32    select count(*)
33    into l_no_remit_lines_autoapply
34    FROM  ar_cash_remit_refs_interim interim, ar_cash_remit_refs refs
35    where interim.remit_reference_id = refs.remit_reference_id
36    and refs.auto_applied = 'Y';
37 
38    if l_no_remit_lines_processed = 0 then
39       l_no_remit_lines_processed := 1;
40       flag := 'Y';
41    end if;
42 
43    l_hit_ratio := (l_no_remit_lines_autoapply/l_no_remit_lines_processed)*100;
44 
45    select count(*)
46    into l_no_remit_lines_suggested
47    from ar_cash_remit_refs_interim interim, ar_cash_remit_refs refs
48    where interim.remit_reference_id = refs.remit_reference_id
49    and refs.auto_applied = 'N'
50    and exists ( select 'Suggestion_Created'
51              from ar_cash_recos recos
52              where recos.remit_reference_id = interim.remit_reference_id);
53 
54    if ( flag = 'Y' and l_no_remit_lines_processed = 1 ) THEN
55     l_no_remit_lines_processed := 0;
56     flag := 'N';
57   end if;
58 
59   return (TRUE);
60 end;
61 
62 function GetMessage (token VARCHAR2) return varchar2 is
63 mesg VARCHAR2(100);
64 begin
65   fnd_message.set_name('AR', token);
66   mesg := fnd_message.get;
67   return mesg;
68 end;
69 
70 END AR_ARATAPPM_PKG;