Commit b7a1adc0 authored by Frank Bergmann's avatar Frank Bergmann

- Many changes at draco

- Changed im_cost_items to im_costs
- Started with repeating costs index
parent 318eb95c
......@@ -25,6 +25,7 @@
-- fields.
--
prompt *** Creating im_employees
create table im_employees (
employee_id integer
constraint im_employees_pk
......@@ -42,7 +43,13 @@ create table im_employees (
constraint im_employees_supervisor_fk
references parties,
ss_number varchar(20),
salary number(9,2),
salary number(12,3),
social_security number(12,3),
insurance number(12,3),
other_costs number(12,3),
currency char(3)
constraint im_employees_currency_fk
references currency_codes,
salary_period varchar(12) default 'month'
constraint im_employees_salary_period_ck
check (salary_period in ('hour','day','week','month','year')),
......@@ -71,8 +78,6 @@ create table im_employees (
employee_status_id integer
constraint im_employees_rec_state_fk
references im_categories,
start_date date,
termination_date date,
termination_reason varchar(4000),
voluntary_termination_p char(1) default 'f'
constraint im_employees_vol_term_ck
......@@ -115,6 +120,58 @@ create index im_employees_idx1 on im_employees(employee_id, supervisor_id);
create index im_employees_idx2 on im_employees(supervisor_id, employee_id);
-- Employee Pipeline State
insert into im_categories (category_id, category, category_type) values
(450, 'Potential', 'Intranet Employee Pipeline State');
insert into im_categories (category_id, category, category_type) values
(451, 'Received Test', 'Intranet Employee Pipeline State');
insert into im_categories (category_id, category, category_type) values
(452, 'Failed Test', 'Intranet Employee Pipeline State');
insert into im_categories (category_id, category, category_type) values
(453, 'Approved Test', 'Intranet Employee Pipeline State');
insert into im_categories (category_id, category, category_type) values
(454, 'Active', 'Intranet Employee Pipeline State');
insert into im_categories (category_id, category, category_type) values
(455, 'Past', 'Intranet Employee Pipeline State');
insert into im_categories (category_id, category, category_type) values
(456, 'Potential Employee', 'Intranet Employee Pipeline State');
------------------------------------------------------
-- HR Views
--
create or replace view im_prior_experiences as
select category_id as experience_id, category as experience
from im_categories
where category_type = 'Intranet Prior Experience';
create or replace view im_hiring_sources as
select category_id as source_id, category as source
from im_categories
where category_type = 'Intranet Hiring Source';
create or replace view im_job_titles as
select category_id as job_title_id, category as job_title
from im_categories
where category_type = 'Intranet Job Title';
create or replace view im_qualification_processes as
select category_id as qualification_id, category as qualification
from im_categories
where category_type = 'Intranet Qualification Process';
create or replace view im_employee_pipeline_states as
select category_id as state_id, category as state
from im_categories
where category_type = 'Intranet Employee Pipeline State';
prompt *** Creating im_supervises_p
create or replace function im_supervises_p(
v_supervisor_id IN integer,
v_user_id IN integer)
......@@ -138,8 +195,8 @@ show errors
-- must be competed. For example, the employee should receive
-- an offer letter and it should be put in the employee folder
prompt *** Creating im_employee_checkpoints
create sequence im_employee_checkpoint_id_seq;
create table im_employee_checkpoints (
checkpoint_id integer
constraint im_emp_checkp_pk
......@@ -167,13 +224,14 @@ create table im_emp_checkpoint_checkoffs (
prompt *** Creating im_views
insert into im_views (view_id, view_name, visible_for) values (55, 'employees_list', 'view_users');
insert into im_views (view_id, view_name, visible_for) values (56, 'employees_view', 'view_users');
-- Add 'employees_list'
prompt *** Creating im_view_columns for employees_list
delete from im_view_columns where column_id >= 5500 and column_id < 5599;
insert into im_view_columns (column_id, view_id, group_id, column_name,
......@@ -198,24 +256,55 @@ sort_order) values (5502,55,'Supervisor',
-- sort_order)values (5502,55,'Status','$status','','',4,'');
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5504,55,'Work Phone',
'$work_phone',6);
sort_order) values (5504,55,'Work Phone','$work_phone',6);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5505,55,'Cell Phone',
'$cell_phone',7);
sort_order) values (5505,55,'Cell Phone','$cell_phone',7);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5506,55,'Home Phone',
'$home_phone',8);
sort_order) values (5506,55,'Home Phone','$home_phone',8);
--
commit;
-- Add 'user_view_freelance'
prompt *** Creating im_view_columns for employees_view
delete from im_view_columns where column_id >= 5600 and column_id < 5699;
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5600,56,'Department',
'"<a href=${department_url}$department_id>$department_name</a>"',0);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5602,56,'Job Title','$job_title',02);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5604,56,'Job Description','$job_description',04);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5606,56,'Availability %','$availability',06);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5608,56,'Supervisor',
'"<a href=${user_url}$supervisor_id>$supervisor_name</a>"',08);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5610,56,'Social Security #','$ss_number',10);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5612,56,'Salary','$salary',12);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5614,56,'Social Security','$social_security',14);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5616,56,'Insurance','$insurance',16);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5618,56,'Other Costs','$other_costs',18);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5620,56,'Salary Period','$salary_period',20);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5622,56,'Salaries per Year','$salary_payments_per_year',22);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5624,56,'Birthdate','$birthdate',24);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5626,56,'Start Date','$start_date',26);
insert into im_view_columns (column_id, view_id, column_name, column_render_tcl,
sort_order) values (5628,56,'Termination Date','$end_date',28);
commit;
insert into im_view_columns values (5602,56,NULL,'Trans Rate',
'$translation_rate','','',2,
......@@ -255,29 +344,30 @@ commit;
prompt *** Creating User Freelance Component plugin
-- Show the freelance information in users view page
--
declare
v_plugin integer;
begin
v_plugin := im_component_plugin.new (
plugin_name => 'Users Freelance Component',
plugin_name => 'User Employee Component',
package_name => 'intranet-hr',
page_url => '/intranet/users/view',
location => 'bottom',
sort_order => 10,
location => 'left',
sort_order => 60,
component_tcl =>
'im_freelance_info_component \
$current_user_id \
'im_employee_info_component \
$user_id \
$return_url \
[im_opt_val freelance_view_name]'
[im_opt_val employee_view_name]'
);
end;
/
prompt *** Creating OrgChart menu entry
-- Add OrgChart to Users menu
declare
v_user_orgchart_menu integer;
......
......@@ -27,10 +27,17 @@ END;
show errors;
-- Delete the employees_list view so that /intranet/users/ is going
-- to show the regular users_list view again.
delete from im_view_columns where view_id >= 55 and view_id <= 59;
delete from im_views where view_id >= 55 and view_id <= 59;
drop table im_emp_checkpoint_checkoffs;
drop table im_employee_checkpoints;
drop sequence im_employee_checkpoint_id_seq;
drop im_supervises_p;
drop table im_employees;
drop function im_supervises_p;
commit;
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment