Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-cost
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-cost
Commits
d9ca8dec
Commit
d9ca8dec
authored
Nov 23, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Gustaf changes
parent
151c68a6
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
130 additions
and
130 deletions
+130
-130
company-profit-loss.tcl
lib/company-profit-loss.tcl
+3
-3
intranet-cost-center-procs.tcl
tcl/intranet-cost-center-procs.tcl
+5
-5
intranet-cost-procs.tcl
tcl/intranet-cost-procs.tcl
+44
-44
cost-center-action.tcl
www/cost-centers/cost-center-action.tcl
+1
-1
index.adp
www/cost-centers/index.adp
+2
-2
index.tcl
www/cost-centers/index.tcl
+4
-4
new.adp
www/cost-centers/new.adp
+4
-4
new.tcl
www/cost-centers/new.tcl
+1
-1
permissions-user-add.adp
www/cost-centers/permissions-user-add.adp
+2
-2
cost-action.tcl
www/costs/cost-action.tcl
+3
-3
new.adp
www/costs/new.adp
+10
-10
new.tcl
www/costs/new.tcl
+3
-3
index.adp
www/index.adp
+8
-8
index.tcl
www/index.tcl
+1
-1
list.adp
www/list.adp
+4
-4
list.tcl
www/list.tcl
+18
-18
index.adp
www/rep-costs/index.adp
+2
-2
index.tcl
www/rep-costs/index.tcl
+3
-3
new-rep-cost.adp
www/rep-costs/new-rep-cost.adp
+3
-3
new-rep-cost.tcl
www/rep-costs/new-rep-cost.tcl
+4
-4
new.adp
www/rep-costs/new.adp
+3
-3
new.tcl
www/rep-costs/new.tcl
+2
-2
No files found.
lib/company-profit-loss.tcl
View file @
d9ca8dec
...
...
@@ -5,7 +5,7 @@ ad_page_contract {
@date 2012-03-30
}
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
im_company_permissions
$current
_user_id
$company
_id view read write admin
set
default_currency
[
im_parameter -package_id
[
im_package_cost_id
]
"DefaultCurrency"
""
"EUR"
]
set
max_project_name 40
...
...
@@ -47,14 +47,14 @@ foreach project_id [array names project_hash] {
if
{
!
[
info
exists costs
(
$key
)]}
{
set costs
(
$key
)
0
}
}
if
{[
catch
{
set est_profit
[
expr
$costs
(
$project
_id-3702
)
-
$costs
(
$project
_id-3706
)
-
$costs
(
$project
_id-3726
)
-
$costs
(
$project
_id-3728
)
]
set est_profit
[
expr
{
$costs
(
$project
_id-3702
)
-
$costs
(
$project
_id-3706
)
-
$costs
(
$project
_id-3726
)
-
$costs
(
$project
_id-3728
)}
]
}
err_msg
]}
{
ns_log Error
"
$err
_msg"
set est_profit
[
lang::message::lookup
""
intranet-cost.UnableToCalculateEstimatedProfit
"Unable to calculate 'Estimated Profit'"
]
}
if
{[
catch
{
set profit
[
expr
$costs
(
$project
_id-3700
)
-
$costs
(
$project
_id-3704
)
-
$costs
(
$project
_id-3718
)
-
$costs
(
$project
_id-3722
)
]
set profit
[
expr
{
$costs
(
$project
_id-3700
)
-
$costs
(
$project
_id-3704
)
-
$costs
(
$project
_id-3718
)
-
$costs
(
$project
_id-3722
)}
]
set profit_pretty
[
lc_numeric
$profit
"%.2f"
[
lang::user::locale
]]
}
err_msg
]}
{
ns_log Error
"
$err
_msg"
...
...
tcl/intranet-cost-center-procs.tcl
View file @
d9ca8dec
...
...
@@ -54,13 +54,13 @@ ad_proc -public im_cost_center_permissions {user_id cost_center_id view_var read
set user_is_admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
set cc_admin_id
[
util_memoize
[
list
db_string cc_admin
"select manager_id from im_cost_centers where cost_center_id =
$cost
_center_id"
-default
""
]]
set user_is_cc_admin_p
[
expr
$user
_id ==
$cc
_admin_id
]
set user_is_cc_admin_p
[
expr
{
$user
_id ==
$cc
_admin_id
}
]
# -----------------------------------------------------
# Set the permission as the OR-conjunction of provider and customer
set view 1
set read 1
set write
[
expr
$user
_is_admin_p ||
$user
_is_cc_admin_p
]
set write
[
expr
{
$user
_is_admin_p ||
$user
_is_cc_admin_p
}
]
set admin
$write
}
...
...
@@ -250,15 +250,15 @@ ad_proc -public template::widget::im_cost_center_tree {
set include_empty_pos
[
lsearch
$params
include_empty_p
]
if
{
$include
_empty_pos >= 0
}
{
set include_empty_p
[
lindex
$params
[
expr
$include
_empty_pos + 1
]
]
set include_empty_p
[
lindex
$params
$include
_empty_pos+1
]
}
set department_only_p_pos
[
lsearch
$params
department_only_p
]
if
{
$department
_only_p_pos >= 0
}
{
set department_only_p
[
lindex
$params
[
expr
$department
_only_p_pos + 1
]
]
set department_only_p
[
lindex
$params
$department
_only_p_pos+1
]
}
set translate_p_pos
[
lsearch
$params
translate_p
]
if
{
$translate
_p_pos >= 0
}
{
set translate_p
[
lindex
$params
[
expr
$translate
_p_pos + 1
]
]
set translate_p
[
lindex
$params
$translate
_p_pos+1
]
}
}
...
...
tcl/intranet-cost-procs.tcl
View file @
d9ca8dec
This diff is collapsed.
Click to expand it.
www/cost-centers/cost-center-action.tcl
View file @
d9ca8dec
...
...
@@ -17,7 +17,7 @@ ad_page_contract {
{
return_url
"/intranet-cost/cost-centers/index"
}
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
user_is_admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
if
{
!$user_is_admin_p
}
{
ad_return_complaint 1
"You have insufficient privileges to use this page"
...
...
www/cost-centers/index.adp
View file @
d9ca8dec
<master src="/packages/intranet-core/www/admin/master">
<property name="
title">@page_title;noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="main_navbar_label">admin</property>
<property name="admin_navbar_label">admin_cost_centers</property>
<property name="left_navbar">@left_navbar_html;
noquote
@</property>
<property name="left_navbar">@left_navbar_html;
literal
@</property>
<h1>@page_title@</h1>
...
...
www/cost-centers/index.tcl
View file @
d9ca8dec
...
...
@@ -17,7 +17,7 @@ ad_page_contract {
# Defaults & Security
# ------------------------------------------------------
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
user_is_admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
if
{
!$user_is_admin_p
}
{
...
...
@@ -126,7 +126,7 @@ db_foreach cost_centers $main_sql {
}
append table
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td><input type=checkbox name=cost_center_id.
$cost
_center_id></td>
<td><nobr>
$sub
_indent <a href=
$cost
_center_url?cost_center_id=
$cost
_center_id&return_url=
$return
_url>
$cost
_center_name</a></nobr></td>
<td>
$cost
_center_code</td>
...
...
@@ -139,7 +139,7 @@ db_foreach cost_centers $main_sql {
"
if
{{}
!=
$employee
_list
}
{
append table
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)><td colspan=2 align=right> </td><td colspan=6>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)><td colspan=2 align=right> </td><td colspan=6>
[
join
$employee
_list
", "
]
</td></tr>
"
...
...
@@ -156,7 +156,7 @@ append left_navbar_html "
<div class='filter-block'>
<div class='filter-title'>#intranet-cost.AdminCostCenter#</div>
<ul>
<li><a href=
new?
[
export_vars -url
{
return_url
}]
>
[
lang::message::lookup
""
intranet-cost.CreateNewCostCenter
"Create new Cost Center"
]
</a</li>
<li><a href=
[
export_vars -base new
{
return_url
}]
>
[
lang::message::lookup
""
intranet-cost.CreateNewCostCenter
"Create new Cost Center"
]
</a</li>
</ul>
</div>
"
www/cost-centers/new.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</property>
<property name="left_navbar">@left_navbar_html;
noquote
@</property>
<property name="left_navbar">@left_navbar_html;
literal
@</property>
<h2>@page_title@</h2>
...
...
@@ -10,6 +10,6 @@
<div class="general-message">@message@</div>
</if>
<property name="focus">@focus;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<formtemplate id="cost_center"></formtemplate>
www/cost-centers/new.tcl
View file @
d9ca8dec
...
...
@@ -24,7 +24,7 @@ ad_page_contract {
# Default & Security
# ------------------------------------------------------------------
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
user_is_admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
if
{
!$user_is_admin_p
}
{
ad_return_complaint 1
"You have insufficient privileges to use this page"
...
...
www/cost-centers/permissions-user-add.adp
View file @
d9ca8dec
<master>
<property name="
title">@page_title
@</property>
<property name="context">@context@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context
;literal
@</property>
<include src="/packages/acs-subsite/www/permissions/perm-user-add-include">
www/costs/cost-action.tcl
View file @
d9ca8dec
...
...
@@ -22,7 +22,7 @@ ad_page_contract {
{
submit_save
""
}
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
if
{
!
[
im_permission
$user
_id add_costs
]}
{
ad_return_complaint 1
"<li>You have insufficient privileges to see this page"
...
...
@@ -56,9 +56,9 @@ if {"" != $submit_del} {
set otype
$object
_type
(
$cost
_id
)
# ToDo: Security
if
[
catch
{
if
{
[
catch
{
im_exec_dml del_cost_item
"
${otype}
__delete(:cost_id)"
}
errmsg
]
{
}
errmsg
]
}
{
ad_return_complaint 1
"<li>Error deleting cost item #
$cost
_id of type '
$otype
':<br>
<pre>
$errmsg
</pre>"
return
...
...
www/costs/new.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="focus">@focus;
noquote
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="focus">@focus;
literal
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</property>
<if @message@ not nil>
<div class="general-message">@message@</div>
</if>
<table cellspacing=
1 cellpadding=1 border=0
>
<table cellspacing=
"1" cellpadding="1" border="0"
>
<tr>
<td valign=
top
>
<td valign=
"top"
>
<table cellspacing=
1 cellpadding=1 border=0
>
<table cellspacing=
"1" cellpadding="1" border="0"
>
<tr>
<td class=rowtitle align=
center
>@page_title@</td>
<td class=rowtitle align=
"center"
>@page_title@</td>
</tr>
<tr>
<td>
...
...
@@ -24,12 +24,12 @@
</table>
</td>
<td valign=
top
>
<td valign=
"top"
>
<if "" ne @admin_html@>
<table cellspacing=
1 cellpadding=1 border=0
>
<table cellspacing=
"1" cellpadding="1" border="0"
>
<tr>
<td class=rowtitle align=
center
>#intranet-cost.Administration#</td>
<td class=rowtitle align=
"center"
>#intranet-cost.Administration#</td>
</tr>
<tr>
<td>
...
...
www/costs/new.tcl
View file @
d9ca8dec
...
...
@@ -24,7 +24,7 @@ ad_page_contract {
# Default & Security
# ------------------------------------------------------------------
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
page_title
"
[
_ intranet-cost.Edit_Cost
]
"
set
context
[
im_context_bar
$page
_title
]
...
...
@@ -34,7 +34,7 @@ set context [im_context_bar $page_title]
# Redirect to sub-type
# ------------------------------------------------------------------
if
{[
info
exists cost_id
]
&&
$cost
_id
!=
""
&&
$cost
_id != 0 &&
$form
_mode ==
"display"
}
{
if
{[
info
exists cost_id
]
&&
$cost
_id
ne
""
&&
$cost
_id != 0 &&
$form
_mode eq
"display"
}
{
set subtype_sql
"
select bou.*
from acs_objects o,
...
...
@@ -80,7 +80,7 @@ set admin_html ""
# Get everything about the cost
# ------------------------------------------------------------------
if
{
!
[
exists_and_not_null cost_id
]
}
{
if
{
(
!
[
info
exists cost_id
]
||
$cost
_id eq
""
)
}
{
# New variable: setup some reasonable defaults
set page_title
"
[
_ intranet-cost.New_Cost_Item
]
"
...
...
www/index.adp
View file @
d9ca8dec
<master>
<property name="
title">@page_title;noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="main_navbar_label">finance</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="left_navbar">@left_navbar_html;
noquote
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<property name="left_navbar">@left_navbar_html;
literal
@</property>
<table cellpadding=
0 cellspacing=0 border=0
width="100%">
<table cellpadding=
"0" cellspacing="0" border="0"
width="100%">
<tr><td>
<%= [im_component_bay top] %>
</td></tr>
</table>
<table cellpadding=
0 cellspacing=0 border=0
width="100%">
<table cellpadding=
"0" cellspacing="0" border="0"
width="100%">
<tr>
<td valign=
top
>
<td valign=
"top"
>
<%= [im_component_bay left] %>
</td>
<td valign=
top
>
<td valign=
"top"
>
<%= [im_component_bay right] %>
</td>
</tr>
</table>
<table cellpadding=
0 cellspacing=0 border=0
width="100%">
<table cellpadding=
"0" cellspacing="0" border="0"
width="100%">
<tr><td>
<%= [im_component_bay bottom] %>
</td></tr>
...
...
www/index.tcl
View file @
d9ca8dec
...
...
@@ -14,7 +14,7 @@ ad_page_contract {
{
project_id 0
}
{
company_id 0
}
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
page_title
"
[
_ intranet-cost.Finance_Home
]
"
set
context_bar
[
im_context_bar
$page
_title
]
set
return_url
[
im_url_with_query
]
...
...
www/list.adp
View file @
d9ca8dec
<master>
<property name="
title">@page_title;noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="main_navbar_label">finance</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="left_navbar">@left_navbar_html;
noquote
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<property name="left_navbar">@left_navbar_html;
literal
@</property>
<form action="/intranet-cost/costs/cost-action" method="POST">
<%= [export_vars -form {company_id cost_id return_url}] %>
<table width="100%" cellpadding=
2 cellspacing=2 border=0
>
<table width="100%" cellpadding=
"2" cellspacing="2" border="0"
>
@table_header_html;noquote@
@table_body_html;noquote@
@table_continuation_html;noquote@
...
...
www/list.tcl
View file @
d9ca8dec
...
...
@@ -63,7 +63,7 @@ ad_page_contract {
# ---------------------------------------------------------------
# User id already verified by filters
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
page_title
"
[
_ intranet-cost.Cost_Items
]
"
set
context_bar
[
im_context_bar
$page
_title
]
set
page_focus
"im_header_form.keywords"
...
...
@@ -79,10 +79,10 @@ if {![im_permission $user_id view_costs]} {
return
}
if
{
[
empty_string_p
$how
_many
]
||
$how
_many < 1
}
{
if
{
$how
_many eq
""
||
$how
_many < 1
}
{
set how_many
[
im_parameter -package_id
[
im_package_core_id
]
NumberResultsPerPage
""
50
]
}
set
end_idx
[
expr
$start
_idx +
$how
_many - 1
]
set
end_idx
[
expr
{
$start
_idx +
$how
_many - 1
}
]
if
{
0 !=
$project
_id &&
""
!=
$project
_id
}
{
set company_id
[
db_string company_from_project
"select company_id from im_projects where project_id = :project_id"
-default 0
]
...
...
@@ -130,10 +130,10 @@ db_foreach column_list_sql $column_sql {
# ---------------------------------------------------------------
set
criteria
[
list
]
if
{
!
[
empty_string_p
$cost
_status_id
]
&&
$cost
_status_id > 0
}
{
if
{
$cost
_status_id ne
""
&&
$cost
_status_id > 0
}
{
lappend criteria
"c.cost_status_id in (
[
join
[
im_sub_categories
$cost
_status_id
]
","
]
)"
}
if
{
!
[
empty_string_p
$cost
_type_id
]
&&
$cost
_type_id != 0
}
{
if
{
$cost
_type_id ne
""
&&
$cost
_type_id != 0
}
{
lappend criteria
"c.cost_type_id in (
[
join
[
im_sub_categories
$cost
_type_id
]
","
]
)"
}
if
{
$customer
_id
}
{
...
...
@@ -174,7 +174,7 @@ if {"" != $project_id && 0 != $project_id} {
if
{
!
[
empty_string_p
$letter
]
&&
[
string
compare
$letter
"ALL"
]
!= 0 &&
[
string
compare
$letter
"SCROLL"
]
!= 0
}
{
if
{
$letter
ne
""
&&
$letter
ne
"ALL"
&&
$letter
ne
"SCROLL"
}
{
lappend criteria
"im_first_letter_default_to_a(cust.company_name)=:letter"
}
...
...
@@ -217,7 +217,7 @@ switch $order_by {
}
set
where_clause
[
join
$criteria
" and
\n
"
]
if
{
!
[
empty_string_p
$where
_clause
]
}
{
if
{
$where
_clause ne
""
}
{
set where_clause
" and
$where
_clause"
}
...
...
@@ -314,7 +314,7 @@ set filter_html "
# ---------------------------------------------------------------
# Set up colspan to be the number of headers + 1 for the # column
set
colspan
[
expr
[
llength
$column
_headers
]
+ 1
]
set
colspan
[
expr
{[
llength
$column
_headers
]
+ 1
}
]
set
table_header_html
""
#<tr>
...
...
@@ -328,13 +328,13 @@ set table_header_html ""
#
set url "
$local
_url?
"
set query_string
[
export_ns_set_vars url
[
list
order_by
]]
if {
!
[
empty_string_p
$query
_string
]
} {
if {
$query
_string ne ""
} {
append url "
$query
_string&
"
}
append table_header_html "
<tr>
\n
"
foreach col
$column
_headers {
if {
[
string
compare
$order
_by
$col
]
== 0
} {
if {
$order
_by eq
$col
} {
append table_header_html "
<td class=rowtitle>$col</td>
\n
"
} else {
append table_header_html "
<td class=rowtitle><a href=
\"
${url}
order_by=
[
ns_urlencode
$col
]
\"
>$col</a></td>
\n
"
...
...
@@ -354,7 +354,7 @@ set ctr 0
set idx
$start
_idx
db_foreach costs_info_query {} {
set url
[
im_maybe_prepend_http
$url
]
if {
[
empty_string_p
$url
]
} {
if {
$url
eq ""
} {
set url_string "
 
;
"
} else {
set url_string "
<a href=
\"
$url
\"
>$url</a>
"
...
...
@@ -364,7 +364,7 @@ db_foreach costs_info_query {} {
if {"" ==
$amount
} { set currency "" }
# Append together a line of data based on the "
column_vars
" parameter list
append table_body_html "
<tr$bgcolor
([
expr
$ctr
% 2
])
>
\n
"
append table_body_html "
<tr$bgcolor
([
expr
{
$ctr
% 2
}
])
>
\n
"
foreach column_var
$column
_vars {
append table_body_html "
\t
<td valign=top>
"
set cmd "
append table_body_html
$column
_var
"
...
...
@@ -381,7 +381,7 @@ db_foreach costs_info_query {} {
}
# Show a reasonable message when there are no result rows:
if {
[
empty_string_p
$table
_body_html
]
} {
if {
$table
_body_html eq ""
} {
set table_body_html "
<tr><td colspan=$colspan><ul><li><b>
[
_ intranet-cost.lt_There_are_currently_n
]
...
...
@@ -391,7 +391,7 @@ if { [empty_string_p $table_body_html] } {
if {
$ctr
==
$how
_many &&
$end
_idx <
$total
_in_limited } {
# This means that there are rows that we decided not to return
# Include a link to go to the next page
set next_start_idx
[
expr
$end
_idx + 1
]
set next_start_idx
[
expr
{
$end
_idx + 1
}
]
set next_page_url "
$local
_url?start_idx=$next_start_idx&
[
export_ns_set_vars url
[
list
start_idx
]]
"
} else {
set next_page_url ""
...
...
@@ -400,7 +400,7 @@ if { $ctr == $how_many && $end_idx < $total_in_limited } {
if {
$start
_idx > 0 } {
# This means we didn't start with the first row - there is
# at least 1 previous row. add a previous page link
set previous_start_idx
[
expr
$start
_idx -
$how
_many
]
set previous_start_idx
[
expr
{
$start
_idx -
$how
_many
}
]
if {
$previous
_start_idx < 0 } { set previous_start_idx 0 }
set previous_page_url "
$local
_url?start_idx=$previous_start_idx&
[
export_ns_set_vars url
[
list
start_idx
]]
"
} else {
...
...
@@ -415,7 +415,7 @@ if { $start_idx > 0 } {
# => include a link to go to the next page
#
if {
$ctr
==
$how
_many &&
$total
_in_limited > 0 &&
$end
_idx <
$total
_in_limited} {
set next_start_idx
[
expr
$end
_idx + 1
]
set next_start_idx
[
expr
{
$end
_idx + 1
}
]
set next_page "
<a href=$local_url?start_idx=$next_start_idx&
[
export_ns_set_vars url
[
list
start_idx
]]
>
[
_ intranet-cost.Next_Page
]
</a>
"
} else {
set next_page ""
...
...
@@ -426,7 +426,7 @@ if {$ctr==$how_many && $total_in_limited > 0 && $end_idx < $total_in_limited} {
# => add a previous page link
#
if {
$start
_idx > 0 } {
set previous_start_idx
[
expr
$start
_idx -
$how
_many
]
set previous_start_idx
[
expr
{
$start
_idx -
$how
_many
}
]
if {
$previous
_start_idx < 0 } { set previous_start_idx 0 }
set previous_page "
<a href=$local_url?start_idx=$previous_start_idx&
[
export_ns_set_vars url
[
list
start_idx
]]
>
[
_ intranet-cost.Previous_Page
]
</a>
"
} else {
...
...
@@ -442,7 +442,7 @@ set table_continuation_html "
set button_html "
<tr>
<td colspan=
[
expr
$colspan
- 3
]
></td>
<td colspan=
[
expr
{
$colspan
- 3
}
]
></td>
<td align=center>
<input type=submit name=submit_save value='
[
_ intranet-cost.Save
]
'>
</td>
...
...
www/rep-costs/index.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<property name="
title
">#intranet-cost.Absences#</property>
<property name="
doc(title)
">#intranet-cost.Absences#</property>
<property name="context">#intranet-cost.context#</property>
<property name="main_navbar_label">finance</property>
<br>
<%= [im_costs_navbar "none" "/intranet/invoices/index" "" "" [list] "costs_rep"] %>
<table width="100%" cellpadding=
2 cellspacing=2 border=0
>
<table width="100%" cellpadding=
"2" cellspacing="2" border="0"
>
<%= $table_header_html %>
<%= $table_body_html %>
<%= $table_continuation_html %>
...
...
www/rep-costs/index.tcl
View file @
d9ca8dec
...
...
@@ -26,7 +26,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
subsite_id
[
ad_conn subsite_id
]
set
bgcolor
(
0
)
" class=roweven "
set
bgcolor
(
1
)
" class=rowodd "
...
...
@@ -95,7 +95,7 @@ where start_block >= rc.start_date
db_foreach all_start_blocks
$all
_start_blocks_sql
{
set key
"
$rep
_cost_id:
$start
_block"
# Fill the field with a link to create a new cost item
set blocks
(
$key
)
"<a href='
$cost
_create_url?
[
export_vars -
url
{
rep_cost_id start_block return_url
}]
'>(
[
_ intranet-cost.create
]
)</a>"
set blocks
(
$key
)
"<a href='
[
export_vars -base
$cost
_create_
url
{
rep_cost_id start_block return_url
}]
'>(
[
_ intranet-cost.create
]
)</a>"
ns_log Notice
"/intranet-cos/rep-costs/index: key=
$key
"
}
...
...
@@ -145,7 +145,7 @@ foreach cost_tuple $repeating_cost_ids {
set cost_id
[
lindex
$cost
_tuple 0
]
set cost_name
[
lindex
$cost
_tuple 1
]
append table_body_html
"<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
\n
"
append table_body_html
"<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
\n
"
append table_body_html
"<td><a href=new?rep_cost_id=
$rep
_cost_id&form_mode=display>
$cost
_name</a></td>
\n
"
for
{
set
month 1
}
{
$month
<=
$report
_months
}
{
incr
month
}
{
...
...
www/rep-costs/new-rep-cost.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</property>
<h2>@page_title@</h2>
...
...
@@ -9,6 +9,6 @@
<div class="general-message">@message@</div>
</if>
<property name="focus">@focus;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<formtemplate id="cost"></formtemplate>
www/rep-costs/new-rep-cost.tcl
View file @
d9ca8dec
...
...
@@ -20,7 +20,7 @@ ad_page_contract {
# Default & Security
# ------------------------------------------------------------------
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
page_title
[
lang::message::lookup
""
intranet-cost.Create_Repeating_Cost_Item
"Create Repeating Cost Item"
]
set
context
[
im_context_bar
$page
_title
]
set
today
[
db_string birthday_today
"select to_char(sysdate,'YYYY-MM-DD') from dual"
]
...
...
@@ -72,9 +72,9 @@ append cost_name " - $start_block"
set
cost_id
[
im_new_object_id
]
set
cause_object_id
$rep
_cost_id
set
effective_date
$start
_block
if
{
!
[
exists_and_not_null payment_days
]
}
{
set payment_days 0
}
if
{
!
[
exists_and_not_null tax
]
}
{
set tax 0
}
if
{
!
[
exists_and_not_null vat
]
}
{
set vat 0
}
if
{
(
!
[
info
exists payment_days
]
||
$payment
_days eq
""
)
}
{
set payment_days 0
}
if
{
(
!
[
info
exists tax
]
||
$tax
eq
""
)
}
{
set tax 0
}
if
{
(
!
[
info
exists vat
]
||
$vat
eq
""
)
}
{
set vat 0
}
set
project_options
[
im_project_options
]
set
customer_options
[
im_company_options -include_empty_p 0 -status
"Active"
-type
"CustOrIntl"
]
...
...
www/rep-costs/new.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</property>
<h2>@page_title@</h2>
...
...
@@ -9,6 +9,6 @@
<div class="general-message">@message@</div>
</if>
<property name="focus">@focus;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<formtemplate id="cost"></formtemplate>
www/rep-costs/new.tcl
View file @
d9ca8dec
...
...
@@ -24,7 +24,7 @@ ad_page_contract {
# Default & Security
# ------------------------------------------------------------------
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
page_title
"<#_ Edit Repeating Cost#>"
set
context
[
im_context_bar
$page
_title
]
set
today
[
db_string birthday_today
"select sysdate from dual"
]
...
...
@@ -42,7 +42,7 @@ set focus "cost.var_name"
# Get everything about the cost
# ------------------------------------------------------------------
if
{
!
[
exists_and_not_null rep_cost_id
]
}
{
if
{
(
!
[
info
exists rep_cost_id
]
||
$rep
_cost_id eq
""
)
}
{
# New variable: setup some reasonable defaults
set page_title
"<#_ New Repeating Cost Item#>"
...
...
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