DBA Data[Home] [Help]

PACKAGE BODY: APPS.SSP_STP_BUS

Source


1 Package Body ssp_stp_bus as
2 /* $Header: spstprhi.pkb 115.3 99/10/13 01:54:40 porting ship  $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ssp_stp_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< chk_permanent_stoppage >---------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure validates that stoppages may not have a withhold_to date if
17 --   they are for withholding reasons said to be 'permanent'.
18 --
19 -- Pre Conditions:
20 --   None.
21 --
22 -- In Parameters:
23 --   A Pl/Sql record structre.
24 --
25 -- Post Success:
26 --   Processing continues.
27 --
28 -- Post Failure:
29 --   Error handled by constraint_error procedure.
30 --
31 -- Developer Implementation Notes:
32 --   None.
33 --
34 -- Access Status:
35 --   Internal Table Handler Use Only.
36 --
37 -- {End Of Comments}
38 -- ----------------------------------------------------------------------------
39 procedure chk_permanent_stoppage (p_rec in ssp_stp_shd.g_rec_type) is
40 --
41   l_proc varchar2 (72) := g_package||'chk_system_does_not_override';
42 --
43 cursor csr_withholding_reason is
44 	--
45 	-- Get the details of the withholding reason for the stoppage
46 	--
47 	select	*
48 	from	ssp_withholding_reasons
49 	where	reason_id = p_rec.reason_id;
50 	--
51 l_withholding_reason	csr_withholding_reason%rowtype;
52 --
53 begin
54   hr_utility.set_location('Entering:'||l_proc, 5);
55   --
56   if p_rec.withhold_to is not null then
57     --
58     -- Check that a withhold_to date is allowed
59     --
60     open csr_withholding_reason;
61     fetch csr_withholding_reason into l_withholding_reason;
62     --
63     if csr_withholding_reason%notfound then
64       --
65       close csr_withholding_reason;
66       ssp_stp_shd.constraint_error
67 		(p_constraint_name => 'SSP_STOPPAGES_FK2');
68       --
69     end if;
70     --
71     close csr_withholding_reason;
72     --
73     if l_withholding_reason.withhold_temporarily = 'N' then
74       --
75       -- The withholding reason is a permanent one. No withhold_to date is
76       -- allowed.
77       --
78       ssp_stp_shd.constraint_error
79 		(p_constraint_name => 'SSP_STP_WITHHOLD_TO_PERMANENT');
80       --
81     end if;
82     --
83   end if;
84 --
85 end chk_permanent_stoppage;
86 -- ----------------------------------------------------------------------------
87 -- |---------------------------< insert_validate >----------------------------|
88 -- ----------------------------------------------------------------------------
89 Procedure insert_validate(p_rec in ssp_stp_shd.g_rec_type) is
90 --
91   l_proc  varchar2(72) := g_package||'insert_validate';
92 --
93 Begin
94   hr_utility.set_location('Entering:'||l_proc, 5);
95   --
96   -- Call all supporting business operations
97   --
98   chk_permanent_stoppage (p_rec);
99   --
100   --
101   hr_utility.set_location(' Leaving:'||l_proc, 10);
102 End insert_validate;
103 --
104 -- ----------------------------------------------------------------------------
105 -- |---------------------------< update_validate >----------------------------|
106 -- ----------------------------------------------------------------------------
107 Procedure update_validate(p_rec in ssp_stp_shd.g_rec_type) is
108 --
109   l_proc  varchar2(72) := g_package||'update_validate';
110 --
111 Begin
112   hr_utility.set_location('Entering:'||l_proc, 5);
113   --
114   -- Call all supporting business operations
115   --
116   chk_permanent_stoppage (p_rec);
117   --
118   --
119   hr_utility.set_location(' Leaving:'||l_proc, 10);
120 End update_validate;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |---------------------------< delete_validate >----------------------------|
124 -- ----------------------------------------------------------------------------
125 Procedure delete_validate(p_rec in ssp_stp_shd.g_rec_type) is
126 --
127   l_proc  varchar2(72) := g_package||'delete_validate';
128 --
129 Begin
130   hr_utility.set_location('Entering:'||l_proc, 5);
131   --
132   -- Call all supporting business operations
133   --
134   hr_utility.set_location(' Leaving:'||l_proc, 10);
135 End delete_validate;
136 --
137 end ssp_stp_bus;