DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_TFL_API_BUSINESS_RULES3

Source


1 Package Body ota_tfl_api_business_rules3 as
2 /* $Header: ottfl04t.pkb 115.2 99/07/16 00:55:49 porting ship $ */
3 --
4 --
5 -- Global package name
6 --
7 g_package		varchar2(33)	:= '  ota_tfl_api_business_rules3.';
8 g_standard		varchar2(40)    := 'STANDARD';
9 g_pre_payment		varchar2(40)    := 'PRE-PAYMENT';
10 g_pre_purchase_payment	varchar2(40)    := 'PRE-PURCHASE PAYMENT';
11 g_pre_purchase_use	varchar2(40)    := 'PRE-PURCHASE USE';
12 --
13 -- Global api dml status
14 --
15 g_api_dml		boolean;
16 --
17 -- ----------------------------------------------------------------------------
18 -- |--------------------< check_customer_booking_deal>-----------------------|
19 -- ----------------------------------------------------------------------------
20 --
21 -- Description:
22 -- This procedure check that:
23 --   	- The customer_id defined on the booking deal must be the same
24 --   	customer_id as defined on the header, unless the customer_id is null
25 --   	on the booking deal.
26 --
27 procedure check_customer_booking_deal (
28 	 p_finance_header_id		in number
29 	,p_booking_deal_id		in number
30    ) is
31 ---------------
32   v_proc                 varchar2(72) := g_package||'check_customer_booking_deal';
33   v_book_deal_customer_id       OTA_BOOKING_DEALS.CUSTOMER_ID%type;
34   v_finance_customer_id         OTA_FINANCE_HEADERS.CUSTOMER_ID%type;
35   v_receivable_type		OTA_FINANCE_HEADERS.RECEIVABLE_TYPE%type;
36   v_deal_type                   OTA_BOOKING_DEALS.TYPE%type;
37   v_number_of_places            number;
38   v_limit_each_event_flag       varchar2(1);
39   --
40   --
41   cursor csr_tfh is
42     select customer_id,receivable_type
43       from ota_finance_headers
44      where finance_header_id     =    p_finance_header_id;
45   --
46   --
47   cursor csr_tbd is
48     select customer_id,type,number_of_places,limit_each_event_flag
49       from ota_booking_deals
50      where booking_deal_id       =    p_booking_deal_id;
51 ---------------
52 Begin
53   --
54   hr_utility.set_location('Entering:'|| v_proc, 5);
55   --
56   Open  csr_tbd;
57   Fetch csr_tbd into v_book_deal_customer_id
58                     ,v_deal_type
59                     ,v_number_of_places
60                     ,v_limit_each_event_flag;
61   Close csr_tbd;
62   --
63   --
64   If v_book_deal_customer_id is NOT null  Then
65         Open  csr_tfh;
66         Fetch csr_tfh into v_finance_customer_id,v_receivable_type;
67         Close csr_tfh;
68         If v_book_deal_customer_id <>  v_finance_customer_id  OR
69            v_finance_customer_id  is  null                   Then
70                 fnd_message.set_name('OTA','OTA_13344_TFL_WRONG_DEAL_CUST');
71                 fnd_message.raise_error;
72         End if;
73   End if;
74   --
75   hr_utility.set_location(' Leaving:'|| v_proc, 10);
76   --
77 end check_customer_booking_deal;
78 --
79 --
80 end ota_tfl_api_business_rules3;