Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-hr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-hr
Commits
ca9a465c
Commit
ca9a465c
authored
Sep 20, 2004
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- commit from 20.9.2004
parent
d2f1066b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
151 deletions
+79
-151
intranet-hr-procs.tcl
tcl/intranet-hr-procs.tcl
+1
-1
new.tcl
www/new.tcl
+78
-150
No files found.
tcl/intranet-hr-procs.tcl
View file @
ca9a465c
...
...
@@ -83,7 +83,7 @@ ad_proc im_employee_info_component { employee_id return_url {view_name ""} } {
where
pe.person_id = u.user_id
and p.party_id = u.user_id
and u.user_id = rc.cost_id(+)
and u.user_id = rc.
rep_
cost_id(+)
and u.user_id = :employee_id
and u.user_id = e.employee_id(+)
and e.department_id = cc.cost_center_id(+)
...
...
www/new.tcl
View file @
ca9a465c
...
...
@@ -26,6 +26,7 @@ ad_page_contract {
set
user_id
[
ad_maybe_redirect_for_registration
]
set
today
[
db_string birthday_today
"select sysdate from dual"
]
set
internal_id
[
im_customer_internal
]
if
{
!
[
im_permission
$user
_id view_users
]}
{
ad_return_complaint 1
"You have insufficient privileges to use this page"
...
...
@@ -163,122 +164,66 @@ ad_form -extend -name cost -on_request {
select
e.*,
rc.*
rc.start_date,
rc.end_date,
ci.*
from parties p,
im_employees e,
im_repeating_costs rc
im_repeating_costs rc,
im_costs ci
where
p.party_id = :employee_id
and p.party_id = rc.cost_id
(
+
)
and p.party_id = rc.rep_cost_id
(
+
)
and p.party_id = ci.cost_id
(
+
)
and p.party_id = e.employee_id
(
+
)
}
-
new_data
{
}
-
after_submit
{
if
{
0 ==
$supervisor
_id
}
{
set supervisor_id
""
}
if
{
""
==
$salary
_payments_per_year
}
{
set salary_payments_per_year 12
}
db_dml employee_insert
"
insert into im_employees (
employee_id,
department_id,
job_title,
job_description,
availability,
supervisor_id,
ss_number,
salary,
social_security,
insurance,
other_costs,
currency,
salary_payments_per_year,
dependant_p,
only_job_p,
married_p,
dependants,
head_of_household_p,
birthdate,
skills,
first_experience,
years_experience,
employee_status_id,
termination_reason,
voluntary_termination_p,
signed_nda_p,
referred_by,
experience_id,
source_id,
original_job_id,
current_job_id,
qualification_id
) values (
:employee_id,
:department_id,
:job_title,
:job_description,
:availability,
:supervisor_id,
:ss_number,
:salary,
:social_security,
:insurance,
:other_costs,
:currency,
:salary_payments_per_year,
:dependant_p,
:only_job_p,
:married_p,
:dependants,
:head_of_household_p,
:birthdate,
:skills,
:first_experience,
:years_experience,
:employee_status_id,
:termination_reason,
:voluntary_termination_p,
:signed_nda_p,
:referred_by,
:experience_id,
:source_id,
:original_job_id,
:current_job_id,
:qualification_id
)"
if
{
""
==
$salary
}
{
set salary 0
}
if
{
""
==
$social
_security
}
{
set social_security 0
}
if
{
""
==
$insurance
}
{
set insurance 0
}
if
{
""
==
$other
_costs
}
{
set other_costs 0
}
set rep_costs_exist
[
db_string rep_costs_exist
"select count(*) from im_repeating_costs where cost_id=:employee_id"
]
set cost_name
$employee
_name
if
{
""
==
$end
_date
}
{
set end_date
"2099-12-31"
}
if
{
""
==
$start
_date
}
{
set start_date
$today
}
# im_repeating_costs
(
and it's im_costs superclass
)
superclass
# im_costs contains a
"cause_object_id"
field pointing to employee_id.
# The join between im_costs and im_repeating_costs is necessary
# in order to elimiate all the non-repeating cost items.
set rep_costs_exist
[
db_string rep_costs_exist
"
select count(*)
from im_repeating_costs rc,
im_costs ci
where rc.rep_cost_id = ci.cost_id
and ci.cause_object_id = :employee_id
"
]
if
{
!$rep_costs_exist
}
{
if
[
catch
{
set rep_cost_id
[
im_cost::new -cost_name
$cost
_name -cost_type_id
[
im_cost_type_repeating
]]
db_dml insert_repeating_costs
"
insert into im_repeating_costs (
cost_id,
cost_name,
cost_center_id,
start_date,
end_date,
amount,
currency
) values (
:employee_id,
:employee_name,
:department_id,
:start_date,
:end_date,
(:salary + :social_security + :insurance + :other_costs) * :salary_payments_per_year / 12,
:currency
)"
insert into im_repeating_costs (
rep_cost_id,
start_date,
end_date
) values (
:rep_cost_id,
:start_date,
:end_date
)
"
}
err_msg
]
{
ad_return_complaint 1
"<li>Error inserting employee cost information:<BR>
<pre>
$err
_msg</pre>"
ad_return_complaint 1
"<li>Error creating a new repeating cost
item for employee
\#
$employee
_id:<br>
<pre>
$err
_msg</pre>"
}
}
}
-edit_data
{
set emp_count
[
db_string emp_count
"select count(*) from im_employees where employee_id=:employee_id"
]
# Check if the im_employees entry already exists for the user
# and create it in case of necessity.
set emp_count
[
db_string emp_count
"
select count(*)
from im_employees
where employee_id=:employee_id
"
]
if
{
0 ==
$emp
_count
}
{
db_dml insert_emp_record
"
insert into im_employees (
...
...
@@ -289,8 +234,16 @@ ad_form -extend -name cost -on_request {
"
}
if
{
""
==
$salary
}
{
set salary 0
}
if
{
""
==
$social
_security
}
{
set social_security 0
}
if
{
""
==
$other
_costs
}
{
set other_costs 0
}
if
{
""
==
$salary
}
{
set salary 0
}
if
{
""
==
$insurance
}
{
set insurance 0
}
if
{
0 ==
$supervisor
_id
}
{
set supervisor_id
""
}
if
{
""
==
$salary
_payments_per_year
}
{
set salary_payments_per_year 12
}
if
{
!
[
exists_and_not_null tax
]}
{
set tax 0
}
if
{
!
[
exists_and_not_null vat
]}
{
set vat 0
}
db_dml employee_update
"
update im_employees set
employee_id = :employee_id,
...
...
@@ -304,6 +257,7 @@ ad_form -extend -name cost -on_request {
social_security = :social_security,
insurance = :insurance,
other_costs = :other_costs,
currency = :currency,
salary_payments_per_year = :salary_payments_per_year,
dependant_p = :dependant_p,
only_job_p = :only_job_p,
...
...
@@ -328,58 +282,32 @@ ad_form -extend -name cost -on_request {
employee_id = :employee_id
"
if
{
""
==
$end
_date
}
{
set end_date
"2099-12-31"
}
if
{
""
==
$start
_date
}
{
set start_date
$today
}
if
{
""
==
$salary
}
{
set salary 0
}
if
{
""
==
$social
_security
}
{
set social_security 0
}
if
{
""
==
$insurance
}
{
set insurance 0
}
if
{
""
==
$other
_costs
}
{
set other_costs 0
}
set rep_costs_exist
[
db_string rep_costs_exist
"select count(*) from im_repeating_costs where cost_id=:employee_id"
]
if
{
!$rep_costs_exist
}
{
if
[
catch
{
db_dml insert_repeating_costs
"
insert into im_repeating_costs (
cost_id,
cost_name,
cost_center_id,
start_date,
end_date,
amount,
currency
) values (
:employee_id,
:employee_name,
:department_id,
:start_date,
:end_date,
(:salary + :social_security + :insurance + :other_costs) * :salary_payments_per_year / 12,
:currency
)"
}
err_msg
]
{
if
[
catch
{
db_dml update_costs
"
update im_costs set
cost_name = :employee_name,
cost_center_id = :department_id,
customer_id = :internal_id,
provider_id = :internal_id,
cost_type_id =
[
im_cost_type_employee
]
,
cost_status_id =
[
im_cost_status_created
]
,
amount = (:salary + :social_security + :insurance + :other_costs) * :salary_payments_per_year / 12,
currency = :currency
where
cost_id = :rep_cost_id
"
db_dml insert_repeating_costs
"
update im_repeating_costs set
start_date = :start_date,
end_date = :end_date
where
rep_cost_id = :rep_cost_id
"
}
err_msg
]
{
ad_return_complaint 1
"<li>Error inserting employee cost information:<BR>
<pre>
$err
_msg</pre>"
}
}
db_dml update_repeating_costs
"
update im_repeating_costs set
cost_name = :employee_name,
cost_center_id = :department_id,
start_date = :start_date,
end_date = :end_date,
amount = (:salary + :social_security + :insurance + :other_costs) * :salary_payments_per_year / 12,
currency = :currency
where
cost_id = :employee_id"
}
-on_submit
{
ns_log Notice
"new: on_submit"
}
-after_submit
{
ad_returnredirect
$return
_url
ad_script_abort
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment