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
3b8adb35
Commit
3b8adb35
authored
Sep 21, 2004
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Repeating Costs running
parent
ca9a465c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
29 deletions
+40
-29
intranet-hr-procs.tcl
tcl/intranet-hr-procs.tcl
+17
-13
new.tcl
www/new.tcl
+23
-16
No files found.
tcl/intranet-hr-procs.tcl
View file @
3b8adb35
...
...
@@ -64,7 +64,7 @@ ad_proc im_employee_info_component { employee_id return_url {view_name ""} } {
# --------------- Security --------------------------
db_
1row employee_info
"
set employee_info_exists
[
db_0or
1row employee_info
"
select
pe.first_names||' '||pe.last_name as user_name,
p.email,
...
...
@@ -77,17 +77,19 @@ ad_proc im_employee_info_component { employee_id return_url {view_name ""} } {
users u,
im_employees e,
im_repeating_costs rc,
im_costs ci,
parties p,
persons pe,
im_cost_centers cc
where
pe.person_id = u.user_id
and p.party_id = u.user_id
and u.user_id = rc.rep_cost_id(+)
and u.user_id = ci.cause_object_id(+)
and ci.cost_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(+)
"
"
]
set view_id
[
db_string get_view
"select view_id from im_views where view_name=:view_name"
-default 0
]
ns_log Notice
"im_employee_info_component: view_id=
$view
_id"
...
...
@@ -110,18 +112,20 @@ ad_proc im_employee_info_component { employee_id return_url {view_name ""} } {
</tr>
\n
"
set ctr 1
# if the row makes references to
"private Note"
and the user isn't
# adminstrator, this row don't appear in the browser.
db_foreach column_list_sql
$column
_sql
{
if
{
1 ||
[
eval
$visible
_for
]}
{
append employee_html
"
if
{
$employee
_info_exists
}
{
# if the row makes references to
"private Note"
and the user isn't
# adminstrator, this row don't appear in the browser.
db_foreach column_list_sql
$column
_sql
{
if
{
1 ||
[
eval
$visible
_for
]}
{
append employee_html
"
<tr
$td
_class(
[
expr
$ctr
% 2
]
)>
<td>
$column
_name </td><td>"
set cmd
"append employee_html
$column
_render_tcl"
eval
$cmd
append employee_html
"</td></tr>
\n
"
incr ctr
}
set cmd
"append employee_html
$column
_render_tcl"
eval
$cmd
append employee_html
"</td></tr>
\n
"
incr ctr
}
}
}
if
{
$admin
}
{
...
...
www/new.tcl
View file @
3b8adb35
...
...
@@ -25,7 +25,8 @@ ad_page_contract {
# ------------------------------------------------------------------
set
user_id
[
ad_maybe_redirect_for_registration
]
set
today
[
db_string birthday_today
"select sysdate from dual"
]
set
today
[
db_string birthday_today
"select to_char(sysdate,'YYYY-MM-DD') from dual"
]
set
end_century
"2099-12-31"
set
internal_id
[
im_customer_internal
]
if
{
!
[
im_permission
$user
_id view_users
]}
{
...
...
@@ -135,7 +136,8 @@ ad_form \
{
job_description:text
(
textarea
)
,nospell,optional
{
label
"Job Description"
}
{
html
{
rows 5 cols 40
}}}
{
start_date:text
(
text
)
,optional
{
label
"Start date"
}
{
html
{
size 10
}}
}
{
end_date:text
(
text
)
,optional
{
label
"End date date"
}
{
html
{
size 10
}}
}
{
end_date:text
(
text
)
,optional
{
label
"End date"
}
{
html
{
size 10
}}
}
{
voluntary_termination_p:text
(
radio
)
,optional
{
label
"Voluntary Termination"
}
{
options
$voluntary
_termination_options
}
}
{
termination_reason:text
(
textarea
)
,nospell,optional
{
label
"Termination Reason"
}
{
html
{
rows 5 cols 40
}}}
{
signed_nda_p:text
(
radio
)
,optional
{
label
"NDA Signed?"
}
{
options
$voluntary
_termination_options
}
}
...
...
@@ -164,8 +166,14 @@ ad_form -extend -name cost -on_request {
select
e.*,
rc.start_date,
rc.end_date,
CASE WHEN rc.start_date is null
THEN to_date
(
:today,'YYYY-MM-DD'
)
ELSE to_date
(
rc.start_date
)
END as start_date,
CASE WHEN rc.end_date is null
THEN to_date
(
:end_century,'YYYY-MM-DD'
)
ELSE to_date
(
rc.end_date
)
END as end_date,
ci.*
from parties p,
im_employees e,
...
...
@@ -173,30 +181,26 @@ ad_form -extend -name cost -on_request {
im_costs ci
where
p.party_id = :employee_id
and p.party_id =
rc.rep_cost_id
(
+
)
and p.party_id = ci.c
os
t_id
(
+
)
and
p.party_id = e.employee
_id
(
+
)
and p.party_id =
e.employee_id
and p.party_id = ci.c
ause_objec
t_id
(
+
)
and
ci.cost_id = rc.rep_cost
_id
(
+
)
}
-after_submit
{
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_cost
s_exist
[
db_string rep_costs_exist
"
select
count(*)
set rep_cost
_id
[
db_string rep_costs_exist
"
select
rc.rep_cost_id
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_cost
s_exist
}
{
"
-default 0
]
if
{
!$rep_cost
_id
}
{
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
"
...
...
@@ -291,8 +295,11 @@ ad_form -extend -name cost -on_request {
provider_id = :internal_id,
cost_type_id =
[
im_cost_type_employee
]
,
cost_status_id =
[
im_cost_status_created
]
,
cause_object_id = :employee_id,
amount = (:salary + :social_security + :insurance + :other_costs) * :salary_payments_per_year / 12,
currency = :currency
currency = :currency,
tax = :tax,
vat = :vat
where
cost_id = :rep_cost_id
"
...
...
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