DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_CREDIT_EXPOSURE_PUB

Source


1 PACKAGE BODY OE_Credit_Exposure_PUB AS
2 -- $Header: OEXPCRXB.pls 120.0 2005/06/01 03:05:39 appldev noship $
3 --------------------
4 -- TYPE DECLARATIONS
5 --------------------
6 
7 ------------
8 -- CONSTANTS
9 ------------
10 G_debug_flag  VARCHAR2(1) :=
11  NVL( OE_CREDIT_CHECK_UTIL.check_debug_flag ,'N') ;
12 
13 -------------------
14 -- PUBLIC VARIABLES
15 -------------------
16 
17 ---------------------------
18 -- PROCEDURES AND FUNCTIONS
19 ---------------------------
20 ----------------------------------------------------------------
21 -- This procedure returns the total exposure and also the
22 -- individual balance for OM and AR
23 -- based on the credit check rule
24 -- It is an overloaded Get_customer_exposure API
25 
26 -- This will replace Get_customer_exposure for all new
27 -- references. The original method Get_customer_exposure
28 -- will continue to remain for backward compatibility
29 ----------------------------------------------------------------
30 PROCEDURE Get_customer_exposure
31 ( p_party_id              IN NUMBER
32 , p_customer_id           IN NUMBER
33 , p_site_id               IN NUMBER
34 , p_limit_curr_code       IN VARCHAR2
35 , p_credit_check_rule_id  IN NUMBER
36 , x_total_exposure        OUT NOCOPY /* file.sql.39 change */ NUMBER
37 , x_order_hold_amount     OUT NOCOPY /* file.sql.39 change */ NUMBER
38 , x_order_amount          OUT NOCOPY /* file.sql.39 change */ NUMBER
39 , x_ar_amount             OUT NOCOPY /* file.sql.39 change */ NUMBER
40 , x_external_amount       OUT NOCOPY /* file.sql.39 change */ NUMBER
41 , x_return_status         OUT NOCOPY /* file.sql.39 change */ VARCHAR2
42 )
43 IS
44 
45 BEGIN
46 
47  x_return_status := FND_API.G_RET_STS_SUCCESS;
48 
49  x_total_exposure        := 0 ;
50  x_order_hold_amount     := 0 ;
51  x_order_amount          := 0 ;
52  x_ar_amount             := 0 ;
53  x_external_amount       := 0 ;
54 
55  IF G_debug_flag = 'Y'
56  THEN
57   OE_DEBUG_PUB.ADD( 'IN OEXPCRXB: Get_Customer_Exposure ');
58   OE_DEBUG_PUB.ADD(' Calling OE_Credit_Engine_GRP.Get_customer_exposure',1);
59 
60   OE_DEBUG_PUB.ADD('OEXPCRGB: IN Get_Customer_Exposure ',1);
61   OE_DEBUG_PUB.ADD('p_party_id              => '|| p_party_id );
62   OE_DEBUG_PUB.ADD('p_customer_id           => '|| p_customer_id );
63   OE_DEBUG_PUB.ADD('p_site_id               => '|| p_site_id );
64   OE_DEBUG_PUB.ADD('p_limit_curr_code       => '|| p_limit_curr_code );
65   OE_DEBUG_PUB.ADD('p_credit_check_rule_id  => '|| p_credit_check_rule_id );
66  END IF;
67 
68 
69  OE_Credit_Engine_GRP.Get_customer_exposure
70  ( p_party_id             => p_party_id
71   , p_customer_id           => p_customer_id
72   , p_site_id               => p_site_id
73   , p_limit_curr_code       => p_limit_curr_code
74   , p_credit_check_rule_id  => p_credit_check_rule_id
75   , p_need_exposure_details => 'Y'
76   , x_total_exposure        => x_total_exposure
77   , x_order_hold_amount     => x_order_hold_amount
78   , x_order_amount         => x_order_amount
79   , x_ar_amount            => x_ar_amount
80   , x_external_amount      => x_external_amount
81   , x_return_status        => x_return_status
82   );
83 
84  IF G_debug_flag = 'Y'
85  THEN
86    OE_DEBUG_PUB.ADD(' x_return_status => '||
87            x_return_status );
88    OE_DEBUG_PUB.ADD(' x_external_amount => '||
89           x_external_amount );
90    OE_DEBUG_PUB.ADD(' x_ar_amount => '||
91          x_ar_amount );
92    OE_DEBUG_PUB.ADD(' x_order_amount => '||
93            x_order_amount );
94    OE_DEBUG_PUB.ADD (' x_order_hold_amount => '||
95      x_order_hold_amount );
96   OE_DEBUG_PUB.ADD (' x_total_exposure => '||
97         x_total_exposure );
98    OE_DEBUG_PUB.ADD( 'OUT OEXPCRXB: Get_Customer_Exposure ');
99  END IF;
100 
101 END Get_customer_exposure ;
102 
103 END OE_Credit_Exposure_PUB ;