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
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 {
...
@@ -5,7 +5,7 @@ ad_page_contract {
@date 2012-03-30
@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
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
default_currency
[
im_parameter -package_id
[
im_package_cost_id
]
"DefaultCurrency"
""
"EUR"
]
set
max_project_name 40
set
max_project_name 40
...
@@ -47,14 +47,14 @@ foreach project_id [array names project_hash] {
...
@@ -47,14 +47,14 @@ foreach project_id [array names project_hash] {
if
{
!
[
info
exists costs
(
$key
)]}
{
set costs
(
$key
)
0
}
if
{
!
[
info
exists costs
(
$key
)]}
{
set costs
(
$key
)
0
}
}
}
if
{[
catch
{
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
]}
{
}
err_msg
]}
{
ns_log Error
"
$err
_msg"
ns_log Error
"
$err
_msg"
set est_profit
[
lang::message::lookup
""
intranet-cost.UnableToCalculateEstimatedProfit
"Unable to calculate 'Estimated Profit'"
]
set est_profit
[
lang::message::lookup
""
intranet-cost.UnableToCalculateEstimatedProfit
"Unable to calculate 'Estimated Profit'"
]
}
}
if
{[
catch
{
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
]]
set profit_pretty
[
lc_numeric
$profit
"%.2f"
[
lang::user::locale
]]
}
err_msg
]}
{
}
err_msg
]}
{
ns_log Error
"
$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
...
@@ -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 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 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 the permission as the OR-conjunction of provider and customer
set view 1
set view 1
set read 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
set admin
$write
}
}
...
@@ -250,15 +250,15 @@ ad_proc -public template::widget::im_cost_center_tree {
...
@@ -250,15 +250,15 @@ ad_proc -public template::widget::im_cost_center_tree {
set include_empty_pos
[
lsearch
$params
include_empty_p
]
set include_empty_pos
[
lsearch
$params
include_empty_p
]
if
{
$include
_empty_pos >= 0
}
{
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
]
set department_only_p_pos
[
lsearch
$params
department_only_p
]
if
{
$department
_only_p_pos >= 0
}
{
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
]
set translate_p_pos
[
lsearch
$params
translate_p
]
if
{
$translate
_p_pos >= 0
}
{
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
...
@@ -165,8 +165,8 @@ ad_proc -public im_cost_permissions {user_id cost_id view_var read_var write_var
...
@@ -165,8 +165,8 @@ ad_proc -public im_cost_permissions {user_id cost_id view_var read_var write_var
set cc_read
[
im_cost_center_read_p
$cost
_center_id
$cost
_type_id
$user
_id
]
set cc_read
[
im_cost_center_read_p
$cost
_center_id
$cost
_type_id
$user
_id
]
set cc_write
[
im_cost_center_write_p
$cost
_center_id
$cost
_type_id
$user
_id
]
set cc_write
[
im_cost_center_write_p
$cost
_center_id
$cost
_type_id
$user
_id
]
set can_read
[
expr
[
im_permission
$user
_id view_costs
]
||
[
im_permission
$user
_id view_invoices
]
]
set can_read
[
expr
{[
im_permission
$user
_id view_costs
]
||
[
im_permission
$user
_id view_invoices
]}
]
set can_write
[
expr
[
im_permission
$user
_id add_costs
]
||
[
im_permission
$user
_id add_invoices
]
]
set can_write
[
expr
{[
im_permission
$user
_id add_costs
]
||
[
im_permission
$user
_id add_invoices
]}
]
# AND-connection with add/view - costs/invoices
# AND-connection with add/view - costs/invoices
if
{
!$can_read
}
{
set cc_read 0
}
if
{
!$can_read
}
{
set cc_read 0
}
...
@@ -211,10 +211,10 @@ ad_proc -public im_cost_permissions {user_id cost_id view_var read_var write_var
...
@@ -211,10 +211,10 @@ ad_proc -public im_cost_permissions {user_id cost_id view_var read_var write_var
# -----------------------------------------------------
# -----------------------------------------------------
# Set the permission as the OR-conjunction of provider and customer
# Set the permission as the OR-conjunction of provider and customer
set view
[
expr
$incust
_view ||
$cust
_view ||
$prov
_view ||
$cc
_view
]
set view
[
expr
{
$incust
_view ||
$cust
_view ||
$prov
_view ||
$cc
_view
}
]
set read
[
expr
$incust
_read ||
$cust
_read ||
$prov
_read ||
$cc
_read
]
set read
[
expr
{
$incust
_read ||
$cust
_read ||
$prov
_read ||
$cc
_read
}
]
set write
[
expr
$incust
_write ||
$cust
_write ||
$prov
_write ||
$cc
_write
]
set write
[
expr
{
$incust
_write ||
$cust
_write ||
$prov
_write ||
$cc
_write
}
]
set admin
[
expr
$incust
_admin ||
$cust
_admin ||
$prov
_admin ||
$cc
_admin
]
set admin
[
expr
{
$incust
_admin ||
$cust
_admin ||
$prov
_admin ||
$cc
_admin
}
]
# Limit rights of all users to view & read if they dont
# Limit rights of all users to view & read if they dont
# have the expressive permission to
"add_costs or add_invoices"
.
# have the expressive permission to
"add_costs or add_invoices"
.
...
@@ -235,7 +235,7 @@ ad_proc -public im_cost_type_write_p {
...
@@ -235,7 +235,7 @@ ad_proc -public im_cost_type_write_p {
Returns
"1"
if the user can create costs of type cost_type_id or 0 otherwise
Returns
"1"
if the user can create costs of type cost_type_id or 0 otherwise
}
{
}
{
set create_cost_types
[
im_cost_type_write_permissions
$user
_id
]
set create_cost_types
[
im_cost_type_write_permissions
$user
_id
]
return
[
expr
[
lsearch
-exact
$create
_cost_types
$cost
_type_id
]
!= -1
]
return
[
expr
{
$cost
_type_id in
$create
_cost_types
}
]
}
}
...
@@ -256,7 +256,7 @@ ad_proc -public im_cost_type_write_permissions_helper {
...
@@ -256,7 +256,7 @@ ad_proc -public im_cost_type_write_permissions_helper {
write permissions for atleast one Cost Center.
write permissions for atleast one Cost Center.
}
{
}
{
# Financial Write permissions are required
# Financial Write permissions are required
set can_write
[
expr
[
im_permission
$user
_id add_costs
]
||
[
im_permission
$user
_id add_invoices
]
]
set can_write
[
expr
{[
im_permission
$user
_id add_costs
]
||
[
im_permission
$user
_id add_invoices
]}
]
if
{
!$can_write
}
{
return
[
list
]
}
if
{
!$can_write
}
{
return
[
list
]
}
set result
[
db_list writable_cost_centers
"
set result
[
db_list writable_cost_centers
"
...
@@ -361,7 +361,7 @@ namespace eval im_cost {
...
@@ -361,7 +361,7 @@ namespace eval im_cost {
if
{
""
==
$creation
_ip
}
{
set creation_ip
[
ad_conn peeraddr
]
}
if
{
""
==
$creation
_ip
}
{
set creation_ip
[
ad_conn peeraddr
]
}
set today
[
db_string today
"select sysdate from dual"
]
set today
[
db_string today
"select sysdate from dual"
]
if
[
catch
{
if
{
[
catch
{
db_dml insert_costs
"
db_dml insert_costs
"
insert into acs_objects (
insert into acs_objects (
object_id, object_type, context_id,
object_id, object_type, context_id,
...
@@ -370,7 +370,7 @@ namespace eval im_cost {
...
@@ -370,7 +370,7 @@ namespace eval im_cost {
:cost_id, :object_type, null,
:cost_id, :object_type, null,
:today, :user_id, :creation_ip
:today, :user_id, :creation_ip
)"
)"
}
errmsg
]
{
}
errmsg
]
}
{
ad_return_complaint 1
"<li>Error creating acs_object in im_cost::new<br>
ad_return_complaint 1
"<li>Error creating acs_object in im_cost::new<br>
cost_id=
$cost
_id<br>
cost_id=
$cost
_id<br>
cost_status_id=
$cost
_status_id<br>
cost_status_id=
$cost
_status_id<br>
...
@@ -382,7 +382,7 @@ namespace eval im_cost {
...
@@ -382,7 +382,7 @@ namespace eval im_cost {
return
return
}
}
if
[
catch
{
if
{
[
catch
{
db_dml insert_costs
"
db_dml insert_costs
"
insert into im_costs (
insert into im_costs (
cost_id,
cost_id,
...
@@ -400,7 +400,7 @@ namespace eval im_cost {
...
@@ -400,7 +400,7 @@ namespace eval im_cost {
:provider_id,
:provider_id,
:cost_type_id,
:cost_type_id,
:cost_status_id
:cost_status_id
)"
}
errmsg
]
{
)"
}
errmsg
]
}
{
ad_return_complaint 1
"<li>Error inserting into im_costs as part of im_cost::new<br>
ad_return_complaint 1
"<li>Error inserting into im_costs as part of im_cost::new<br>
cost_id=
$cost
_id<br>
cost_id=
$cost
_id<br>
cost_status_id=
$cost
_status_id<br>
cost_status_id=
$cost
_status_id<br>
...
@@ -550,7 +550,7 @@ ad_proc -public template::widget::im_currencies { element_reference tag_attribut
...
@@ -550,7 +550,7 @@ ad_proc -public template::widget::im_currencies { element_reference tag_attribut
set include_empty_pos
[
lsearch
$params
include_empty_p
]
set include_empty_pos
[
lsearch
$params
include_empty_p
]
if
{
$include
_empty_pos >= 0
}
{
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
]
}
}
}
}
...
@@ -695,7 +695,7 @@ ad_proc im_costs_object_list_component { user_id cost_id return_url } {
...
@@ -695,7 +695,7 @@ ad_proc im_costs_object_list_component { user_id cost_id return_url } {
set object_list_html
""
set object_list_html
""
db_foreach object_list
$object
_list_sql
{
db_foreach object_list
$object
_list_sql
{
append object_list_html
"
append object_list_html
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td>
<td>
<A href=
\"
$url$object
_id
\"
>
$object
_name</A>
<A href=
\"
$url$object
_id
\"
>
$object
_name</A>
</td>
</td>
...
@@ -708,7 +708,7 @@ ad_proc im_costs_object_list_component { user_id cost_id return_url } {
...
@@ -708,7 +708,7 @@ ad_proc im_costs_object_list_component { user_id cost_id return_url } {
if
{
0 ==
$ctr
}
{
if
{
0 ==
$ctr
}
{
append object_list_html
"
append object_list_html
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td><i>No objects found</i></td>
<td><i>No objects found</i></td>
</tr>
\n
"
</tr>
\n
"
}
}
...
@@ -839,7 +839,7 @@ ad_proc im_company_payment_balance_component { company_id } {
...
@@ -839,7 +839,7 @@ ad_proc im_company_payment_balance_component { company_id } {
db_multirow -extend
{
invoice_url
}
list_costs_multirow costs_sql
$costs
_sql
{
db_multirow -extend
{
invoice_url
}
list_costs_multirow costs_sql
$costs
_sql
{
set invoice_url
[
export_vars -base
"/intranet-invoices/view"
{{
invoice_id
$cost
_id
}}]
set invoice_url
[
export_vars -base
"/intranet-invoices/view"
{{
invoice_id
$cost
_id
}}]
if
{
""
==
$total
_converted
}
{
set total_converted 0
}
if
{
""
==
$total
_converted
}
{
set total_converted 0
}
set costs_sum
[
expr
$costs
_sum +
$total
_converted
]
set costs_sum
[
expr
{
$costs
_sum +
$total
_converted
}
]
}
}
eval
[
template::adp_compile -string
"<listtemplate name=list_costs></listtemplate>"
]
eval
[
template::adp_compile -string
"<listtemplate name=list_costs></listtemplate>"
]
...
@@ -891,7 +891,7 @@ ad_proc im_company_payment_balance_component { company_id } {
...
@@ -891,7 +891,7 @@ ad_proc im_company_payment_balance_component { company_id } {
set payments_sum 0
set payments_sum 0
db_multirow -extend
{
invoice_url
}
list_payments_multirow payments_sql
$payments
_sql
{
db_multirow -extend
{
invoice_url
}
list_payments_multirow payments_sql
$payments
_sql
{
set payment_url
[
export_vars -base
"/intranet-payments/view"
{
payment_id
}]
set payment_url
[
export_vars -base
"/intranet-payments/view"
{
payment_id
}]
set payments_sum
[
expr
$payments
_sum +
$amount
_converted
]
set payments_sum
[
expr
{
$payments
_sum +
$amount
_converted
}
]
}
}
eval
[
template::adp_compile -string
"<listtemplate name=list_payments></listtemplate>"
]
eval
[
template::adp_compile -string
"<listtemplate name=list_payments></listtemplate>"
]
...
@@ -1051,7 +1051,7 @@ ad_proc im_costs_base_component {
...
@@ -1051,7 +1051,7 @@ ad_proc im_costs_base_component {
db_foreach recent_costs
$costs
_sql
{
db_foreach recent_costs
$costs
_sql
{
append cost_html
"
append cost_html
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td><a href=
\"
$url$cost
_id
\"
>
[
string
range
$cost
_name 0 20
]
</a></td>
<td><a href=
\"
$url$cost
_id
\"
>
[
string
range
$cost
_name 0 20
]
</a></td>
<td>
$cost
_type</td>
<td>
$cost
_type</td>
<td>
$calculated
_due_date</td>
<td>
$calculated
_due_date</td>
...
@@ -1068,9 +1068,9 @@ ad_proc im_costs_base_component {
...
@@ -1068,9 +1068,9 @@ ad_proc im_costs_base_component {
set company_id
$org
_company_id
set company_id
$org
_company_id
append cost_html
"
append cost_html
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td colspan=
$colspan
>
<td colspan=
$colspan
>
<a href=
\"
/intranet-cost/
list?
[
export_vars -url
{
status_id company_id project_id
}]
\"
>
<a href=
\"
/intranet-cost/
[
export_vars -base list
{
status_id company_id project_id
}]
\"
>
[
_ intranet-cost.more_costs
]
[
_ intranet-cost.more_costs
]
</a>
</a>
</td>
</td>
...
@@ -1080,7 +1080,7 @@ ad_proc im_costs_base_component {
...
@@ -1080,7 +1080,7 @@ ad_proc im_costs_base_component {
# Add a reasonable message if there are no documents
# Add a reasonable message if there are no documents
if
{
$ctr
== 1
}
{
if
{
$ctr
== 1
}
{
append cost_html
"
append cost_html
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td colspan=
$colspan
align=center>
<td colspan=
$colspan
align=center>
<I>
[
_ intranet-cost.lt_No_financial_document
]
</I>
<I>
[
_ intranet-cost.lt_No_financial_document
]
</I>
</td>
</td>
...
@@ -1386,7 +1386,7 @@ ad_proc im_costs_project_finance_component {
...
@@ -1386,7 +1386,7 @@ ad_proc im_costs_project_finance_component {
if
{
!$atleast_one_unreadable_p
}
{
if
{
!$atleast_one_unreadable_p
}
{
append cost_html
"
append cost_html
"
<tr class=rowplain>
<tr class=rowplain>
<td colspan=
[
expr
$colspan-4
]
> </td>
<td colspan=
[
expr
{
$colspan-4
}
]
> </td>
<td align='right' colspan=2>
<td align='right' colspan=2>
<b><nobr>
$subtotals
(
$old
_cost_type_id)
$default
_currency</nobr></b>
<b><nobr>
$subtotals
(
$old
_cost_type_id)
$default
_currency</nobr></b>
</td>
</td>
...
@@ -1434,7 +1434,7 @@ ad_proc im_costs_project_finance_component {
...
@@ -1434,7 +1434,7 @@ ad_proc im_costs_project_finance_component {
set cost_url_end
"</A>"
set cost_url_end
"</A>"
set amount_unconverted
"<nobr>(
[
string
trim
$amount
]
$currency
)</nobr>"
set amount_unconverted
"<nobr>(
[
string
trim
$amount
]
$currency
)</nobr>"
if
{
[
string
equal
$currency
$default
_currency
]
}
{
set amount_unconverted
""
}
if
{
$currency
eq
$default
_currency
}
{
set amount_unconverted
""
}
set amount_paid
"
$payment
_amount
$default
_currency"
set amount_paid
"
$payment
_amount
$default
_currency"
if
{
""
==
$payment
_amount
}
{
set amount_paid
""
}
if
{
""
==
$payment
_amount
}
{
set amount_paid
""
}
...
@@ -1450,7 +1450,7 @@ ad_proc im_costs_project_finance_component {
...
@@ -1450,7 +1450,7 @@ ad_proc im_costs_project_finance_component {
}
}
append cost_html
"
append cost_html
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td><nobr>
$cost
_url
[
string
range
$cost
_name 0 30
]
</A></nobr></td>
<td><nobr>
$cost
_url
[
string
range
$cost
_name 0 30
]
</A></nobr></td>
<td>
$cost
_center_code</td>
<td>
$cost
_center_code</td>
<td>
$company
_name</td>
<td>
$company
_name</td>
...
@@ -1467,7 +1467,7 @@ ad_proc im_costs_project_finance_component {
...
@@ -1467,7 +1467,7 @@ ad_proc im_costs_project_finance_component {
if
{
!$atleast_one_unreadable_p
}
{
if
{
!$atleast_one_unreadable_p
}
{
append cost_html
"
append cost_html
"
<tr class=rowplain>
<tr class=rowplain>
<td colspan=
[
expr
$colspan-3
]
> </td>
<td colspan=
[
expr
{
$colspan-3
}
]
> </td>
<td colspan='99'>
<td colspan='99'>
<b>
$subtotals
(
$old
_cost_type_id)
$default
_currency</b>
<b>
$subtotals
(
$old
_cost_type_id)
$default
_currency</b>
</td>
</td>
...
@@ -1483,7 +1483,7 @@ ad_proc im_costs_project_finance_component {
...
@@ -1483,7 +1483,7 @@ ad_proc im_costs_project_finance_component {
# Add a reasonable message if there are no documents
# Add a reasonable message if there are no documents
if
{
$ctr
== 1
}
{
if
{
$ctr
== 1
}
{
append cost_html
"
append cost_html
"
<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
<td colspan=
$colspan
align=center>
<td colspan=
$colspan
align=center>
<I>
[
_ intranet-cost.lt_No_financial_document
]
</I>
<I>
[
_ intranet-cost.lt_No_financial_document
]
</I>
</td>
</td>
...
@@ -1514,19 +1514,19 @@ ad_proc im_costs_project_finance_component {
...
@@ -1514,19 +1514,19 @@ ad_proc im_costs_project_finance_component {
append hard_cost_html
"</tr>
\n
<tr>
\n
<td>
[
_ intranet-cost.Provider_Bills
]
</td>
\n
"
append hard_cost_html
"</tr>
\n
<tr>
\n
<td>
[
_ intranet-cost.Provider_Bills
]
</td>
\n
"
set subtotal
$subtotals
([
im_cost_type_bill
])
set subtotal
$subtotals
([
im_cost_type_bill
])
append hard_cost_html
"<td align=right>-
$subtotal
$default
_currency</td>
\n
"
append hard_cost_html
"<td align=right>-
$subtotal
$default
_currency</td>
\n
"
set grand_total
[
expr
$grand
_total -
$subtotal
]
set grand_total
[
expr
{
$grand
_total -
$subtotal
}
]
append hard_cost_html
"</tr>
\n
<tr>
\n
<td>
[
_ intranet-cost.Timesheet_Costs
]
</td>
\n
"
append hard_cost_html
"</tr>
\n
<tr>
\n
<td>
[
_ intranet-cost.Timesheet_Costs
]
</td>
\n
"
set subtotal
$subtotals
([
im_cost_type_timesheet
])
set subtotal
$subtotals
([
im_cost_type_timesheet
])
append hard_cost_html
"<td align=right>-
$subtotal
$default
_currency</td>
\n
"
append hard_cost_html
"<td align=right>-
$subtotal
$default
_currency</td>
\n
"
set grand_total
[
expr
$grand
_total -
$subtotal
]
set grand_total
[
expr
{
$grand
_total -
$subtotal
}
]
append hard_cost_html
"</tr>
\n
<tr>
\n
<td>
[
lang::message::lookup
""
intranet-cost.Expenses
"Expenses"
]
</td>
\n
"
append hard_cost_html
"</tr>
\n
<tr>
\n
<td>
[
lang::message::lookup
""
intranet-cost.Expenses
"Expenses"
]
</td>
\n
"
set subtotal
$subtotals
([
im_cost_type_expense_bundle
])
set subtotal
$subtotals
([
im_cost_type_expense_bundle
])
append hard_cost_html
"<td align=right>-
$subtotal
$default
_currency</td>
\n
"
append hard_cost_html
"<td align=right>-
$subtotal
$default
_currency</td>
\n
"
set grand_total
[
expr
$grand
_total -
$subtotal
]
set grand_total
[
expr
{
$grand
_total -
$subtotal
}
]
set grand_total
[
expr
round
(
$rounding
_factor *
$grand
_total
)
/
$rounding
_factor
]
set grand_total
[
expr
{
round
(
$rounding
_factor *
$grand
_total
)
/
$rounding
_factor
}
]
append hard_cost_html
"</tr>
\n
<tr>
\n
<td><b>
[
_ intranet-cost.Grand_Total
]
</b></td>
\n
"
append hard_cost_html
"</tr>
\n
<tr>
\n
<td><b>
[
_ intranet-cost.Grand_Total
]
</b></td>
\n
"
append hard_cost_html
"<td align=right><b>
$grand
_total
$default
_currency</b></td>
\n
"
append hard_cost_html
"<td align=right><b>
$grand
_total
$default
_currency</b></td>
\n
"
...
@@ -1553,19 +1553,19 @@ ad_proc im_costs_project_finance_component {
...
@@ -1553,19 +1553,19 @@ ad_proc im_costs_project_finance_component {
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td>
[
_ intranet-cost.Purchase_Orders
]
</td>
\n
"
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td>
[
_ intranet-cost.Purchase_Orders
]
</td>
\n
"
set subtotal
$subtotals
(
[
im_cost_type_po
]
)
set subtotal
$subtotals
(
[
im_cost_type_po
]
)
append prelim_cost_html "
<td align=right>-
$subtotal
$default
_currency</td>
\n
"
append prelim_cost_html "
<td align=right>-
$subtotal
$default
_currency</td>
\n
"
set grand_total
[
expr
$grand
_total -
$subtotal
]
set grand_total
[
expr
{
$grand
_total -
$subtotal
}
]
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td>
[
lang::message::lookup
""
intranet-cost.Timesheet_Budget
"Timesheet Budget"
]
</td>
\n
"
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td>
[
lang::message::lookup
""
intranet-cost.Timesheet_Budget
"Timesheet Budget"
]
</td>
\n
"
set subtotal
$subtotals
(
[
im_cost_type_timesheet_budget
]
)
set subtotal
$subtotals
(
[
im_cost_type_timesheet_budget
]
)
append prelim_cost_html "
<td align=right>-
$subtotal
$default
_currency</td>
\n
"
append prelim_cost_html "
<td align=right>-
$subtotal
$default
_currency</td>
\n
"
set grand_total
[
expr
$grand
_total -
$subtotal
]
set grand_total
[
expr
{
$grand
_total -
$subtotal
}
]
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td>
[
lang::message::lookup
""
intranet-cost.Expense_Budget
"Expense Budget"
]
</td>
\n
"
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td>
[
lang::message::lookup
""
intranet-cost.Expense_Budget
"Expense Budget"
]
</td>
\n
"
set subtotal
$subtotals
(
[
im_cost_type_expense_planned
]
)
set subtotal
$subtotals
(
[
im_cost_type_expense_planned
]
)
append prelim_cost_html "
<td align=right>-
$subtotal
$default
_currency</td>
\n
"
append prelim_cost_html "
<td align=right>-
$subtotal
$default
_currency</td>
\n
"
set grand_total
[
expr
$grand
_total -
$subtotal
]
set grand_total
[
expr
{
$grand
_total -
$subtotal
}
]
set grand_total
[
expr
round
(
$rounding
_factor *
$grand
_total
)
/
$rounding
_factor
]
set grand_total
[
expr
{
round
(
$rounding
_factor *
$grand
_total
)
/
$rounding
_factor
}
]
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td><b>
[
lang::message::lookup
""
intranet-cost.Preliminary_Total
"Preliminary Total"
]
</b></td>
\n
"
append prelim_cost_html "
</tr>
\n
<tr>
\n
<td><b>
[
lang::message::lookup
""
intranet-cost.Preliminary_Total
"Preliminary Total"
]
</b></td>
\n
"
append prelim_cost_html "
<td align=right><b>$grand_total
$default
_currency</b></td>
\n
"
append prelim_cost_html "
<td align=right><b>$grand_total
$default
_currency</b></td>
\n
"
append prelim_cost_html "
</tr>
\n
</table>
\n
"
append prelim_cost_html "
</tr>
\n
</table>
\n
"
...
@@ -1644,19 +1644,19 @@ ad_proc im_costs_project_finance_component {
...
@@ -1644,19 +1644,19 @@ ad_proc im_costs_project_finance_component {
# set html_provider_links
[
im_menu_ul_list -package_key intranet-invoices
"invoices_providers"
$bind
_vars
]
# set html_provider_links
[
im_menu_ul_list -package_key intranet-invoices
"invoices_providers"
$bind
_vars
]
set html_provider_links
[
im_menu_ul_list
"invoices_providers"
$bind
_vars
]
set html_provider_links
[
im_menu_ul_list
"invoices_providers"
$bind
_vars
]
if {
!
[
empty_string_p
$html
_customer_links
]
|| !
[
empty_string_p
$html
_provider_links
]
} {
if {
$html
_customer_links ne "" ||
$html
_provider_links ne ""
} {
set admin_html "
set admin_html "
<h1>
[
_ intranet-core.Admin_Links
]
</h1>
<h1>
[
_ intranet-core.Admin_Links
]
</h1>
<table>
<table>
<tr class=rowplain>
<tr class=rowplain>
<td>
\n
"
<td>
\n
"
if {
!
[
empty_string_p
$html
_customer_links
]
} {
if {
$html
_customer_links ne ""
} {
append admin_html "
<h2>
"
append admin_html "
<h2>
"
append admin_html
[
lang::message::lookup
""
intranet-cost.Customer_Links
"Customer Actions"
]
append admin_html
[
lang::message::lookup
""
intranet-cost.Customer_Links
"Customer Actions"
]
append admin_html "
</h2>
"
append admin_html "
</h2>
"
append admin_html
$html
_customer_links
append admin_html
$html
_customer_links
}
}
if {
!
[
empty_string_p
$html
_provider_links
]
} {
if {
$html
_provider_links ne ""
} {
append admin_html "
<br><h2>
"
append admin_html "
<br><h2>
"
append admin_html
[
lang::message::lookup
""
intranet-cost.Provider_Links
"Provider Actions"
]
append admin_html
[
lang::message::lookup
""
intranet-cost.Provider_Links
"Provider Actions"
]
append admin_html "
</h2>
"
append admin_html "
</h2>
"
...
@@ -1798,7 +1798,7 @@ ad_proc -public im_cost_status_select {
...
@@ -1798,7 +1798,7 @@ ad_proc -public im_cost_status_select {
set options
[
util_memoize
[
list
im_cost_status_options
$include
_empty
]]
set options
[
util_memoize
[
list
im_cost_status_options
$include
_empty
]]
set result
"
\n
<select name=
\"
$select
_name
\"
>
\n
"
set result
"
\n
<select name=
\"
$select
_name
\"
>
\n
"
if
{
[
string
equal
$default
""
]
}
{
if
{
$default
eq
""
}
{
append result
"<option value=
\"\"
> -- Please select -- </option>"
append result
"<option value=
\"\"
> -- Please select -- </option>"
}
}
...
@@ -1811,10 +1811,10 @@ ad_proc -public im_cost_status_select {
...
@@ -1811,10 +1811,10 @@ ad_proc -public im_cost_status_select {
}
}
set selected
""
set selected
""
if
{
[
string
equal
$default
[
lindex
$option
1
]
]}
{
if
{
$default
eq
[
lindex
$option
1
]}
{
set selected
" selected"
set selected
" selected"
}
}
append result
"
\t
<option value=
\"
[
util_quote_double_quotes
[
lindex
$option
1
]]
\"
$selected
>"
append result
"
\t
<option value=
\"
[
ad_quotehtml
[
lindex
$option
1
]]
\"
$selected
>"
append result
"
$text
</option>
\n
"
append result
"
$text
</option>
\n
"
}
}
...
@@ -1868,12 +1868,12 @@ ad_proc im_costs_select {
...
@@ -1868,12 +1868,12 @@ ad_proc im_costs_select {
1=1
1=1
"
"
if
{
!
[
empty_string_p
$status
]
}
{
if
{
$status
ne
""
}
{
ns_set put
$bind
_vars status
$status
ns_set put
$bind
_vars status
$status
append sql
" and cost_status_id=(select cost_status_id from im_cost_status where cost_status=:status)"
append sql
" and cost_status_id=(select cost_status_id from im_cost_status where cost_status=:status)"
}
}
if
{
!
[
empty_string_p
$exclude
_status
]
}
{
if
{
$exclude
_status ne
""
}
{
set exclude_string
[
im_append_list_to_ns_set
$bind
_vars cost_status_type
$exclude
_status
]
set exclude_string
[
im_append_list_to_ns_set
$bind
_vars cost_status_type
$exclude
_status
]
append sql
" and cost_status_id in (select cost_status_id
append sql
" and cost_status_id in (select cost_status_id
from im_cost_status
from im_cost_status
...
@@ -2083,7 +2083,7 @@ ad_proc -public im_cost_update_project_cost_cache {
...
@@ -2083,7 +2083,7 @@ ad_proc -public im_cost_update_project_cost_cache {
"
"
set ts_budget
[
db_string ts_budget
$planning
_ts_hours_sql -default 0.0
]
set ts_budget
[
db_string ts_budget
$planning
_ts_hours_sql -default 0.0
]
if
{
""
==
$ts
_budget
}
{
set ts_budget 0.0
}
if
{
""
==
$ts
_budget
}
{
set ts_budget 0.0
}
set ts_budget
[
expr
$ts
_budget
]
set ts_budget
[
expr
{
$ts
_budget
}
]
set subtotals
(
3726
)
$ts
_budget
set subtotals
(
3726
)
$ts
_budget
}
else
{
}
else
{
...
@@ -2100,7 +2100,7 @@ ad_proc -public im_cost_update_project_cost_cache {
...
@@ -2100,7 +2100,7 @@ ad_proc -public im_cost_update_project_cost_cache {
# Create a fake timesheet planning entry based on im_project.budget_hours field
# Create a fake timesheet planning entry based on im_project.budget_hours field
set budget_hours
[
db_string budget_hours
"select project_budget_hours from im_projects where project_id = :project_id"
-default
""
]
set budget_hours
[
db_string budget_hours
"select project_budget_hours from im_projects where project_id = :project_id"
-default
""
]
if
{
""
==
$budget
_hours
}
{
set budget_hours 0
}
if
{
""
==
$budget
_hours
}
{
set budget_hours 0
}
set cost_timesheet_planned
[
expr
$budget
_hours *
$default
_hourly_cost
]
set cost_timesheet_planned
[
expr
{
$budget
_hours *
$default
_hourly_cost
}
]
set subtotals
([
im_cost_type_timesheet_planned
])
$cost
_timesheet_planned
set subtotals
([
im_cost_type_timesheet_planned
])
$cost
_timesheet_planned
}
}
...
...
www/cost-centers/cost-center-action.tcl
View file @
d9ca8dec
...
@@ -17,7 +17,7 @@ ad_page_contract {
...
@@ -17,7 +17,7 @@ ad_page_contract {
{
return_url
"/intranet-cost/cost-centers/index"
}
{
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
]
set
user_is_admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
if
{
!$user_is_admin_p
}
{
if
{
!$user_is_admin_p
}
{
ad_return_complaint 1
"You have insufficient privileges to use this page"
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">
<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="main_navbar_label">admin</property>
<property name="admin_navbar_label">admin_cost_centers</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>
<h1>@page_title@</h1>
...
...
www/cost-centers/index.tcl
View file @
d9ca8dec
...
@@ -17,7 +17,7 @@ ad_page_contract {
...
@@ -17,7 +17,7 @@ ad_page_contract {
# Defaults & Security
# 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
]
set
user_is_admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
if
{
!$user_is_admin_p
}
{
if
{
!$user_is_admin_p
}
{
...
@@ -126,7 +126,7 @@ db_foreach cost_centers $main_sql {
...
@@ -126,7 +126,7 @@ db_foreach cost_centers $main_sql {
}
}
append table
"
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><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><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>
<td>
$cost
_center_code</td>
...
@@ -139,7 +139,7 @@ db_foreach cost_centers $main_sql {
...
@@ -139,7 +139,7 @@ db_foreach cost_centers $main_sql {
"
"
if
{{}
!=
$employee
_list
}
{
if
{{}
!=
$employee
_list
}
{
append table
"
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
", "
]
[
join
$employee
_list
", "
]
</td></tr>
</td></tr>
"
"
...
@@ -156,7 +156,7 @@ append left_navbar_html "
...
@@ -156,7 +156,7 @@ append left_navbar_html "
<div class='filter-block'>
<div class='filter-block'>
<div class='filter-title'>#intranet-cost.AdminCostCenter#</div>
<div class='filter-title'>#intranet-cost.AdminCostCenter#</div>
<ul>
<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>
</ul>
</div>
</div>
"
"
www/cost-centers/new.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
noquote
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</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>
<h2>@page_title@</h2>
...
@@ -10,6 +10,6 @@
...
@@ -10,6 +10,6 @@
<div class="general-message">@message@</div>
<div class="general-message">@message@</div>
</if>
</if>
<property name="focus">@focus;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<formtemplate id="cost_center"></formtemplate>
<formtemplate id="cost_center"></formtemplate>
www/cost-centers/new.tcl
View file @
d9ca8dec
...
@@ -24,7 +24,7 @@ ad_page_contract {
...
@@ -24,7 +24,7 @@ ad_page_contract {
# Default & Security
# 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
]
set
user_is_admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
if
{
!$user_is_admin_p
}
{
if
{
!$user_is_admin_p
}
{
ad_return_complaint 1
"You have insufficient privileges to use this page"
ad_return_complaint 1
"You have insufficient privileges to use this page"
...
...
www/cost-centers/permissions-user-add.adp
View file @
d9ca8dec
<master>
<master>
<property name="
title">@page_title
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context@</property>
<property name="context">@context
;literal
@</property>
<include src="/packages/acs-subsite/www/permissions/perm-user-add-include">
<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 {
...
@@ -22,7 +22,7 @@ ad_page_contract {
{
submit_save
""
}
{
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
]}
{
if
{
!
[
im_permission
$user
_id add_costs
]}
{
ad_return_complaint 1
"<li>You have insufficient privileges to see this page"
ad_return_complaint 1
"<li>You have insufficient privileges to see this page"
...
@@ -56,9 +56,9 @@ if {"" != $submit_del} {
...
@@ -56,9 +56,9 @@ if {"" != $submit_del} {
set otype
$object
_type
(
$cost
_id
)
set otype
$object
_type
(
$cost
_id
)
# ToDo: Security
# ToDo: Security
if
[
catch
{
if
{
[
catch
{
im_exec_dml del_cost_item
"
${otype}
__delete(:cost_id)"
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>
ad_return_complaint 1
"<li>Error deleting cost item #
$cost
_id of type '
$otype
':<br>
<pre>
$errmsg
</pre>"
<pre>
$errmsg
</pre>"
return
return
...
...
www/costs/new.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="focus">@focus;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<property name="context">@context;
noquote
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</property>
<property name="main_navbar_label">finance</property>
<if @message@ not nil>
<if @message@ not nil>
<div class="general-message">@message@</div>
<div class="general-message">@message@</div>
</if>
</if>
<table cellspacing=
1 cellpadding=1 border=0
>
<table cellspacing=
"1" cellpadding="1" border="0"
>
<tr>
<tr>
<td valign=
top
>
<td valign=
"top"
>
<table cellspacing=
1 cellpadding=1 border=0
>
<table cellspacing=
"1" cellpadding="1" border="0"
>
<tr>
<tr>
<td class=rowtitle align=
center
>@page_title@</td>
<td class=rowtitle align=
"center"
>@page_title@</td>
</tr>
</tr>
<tr>
<tr>
<td>
<td>
...
@@ -24,12 +24,12 @@
...
@@ -24,12 +24,12 @@
</table>
</table>
</td>
</td>
<td valign=
top
>
<td valign=
"top"
>
<if "" ne @admin_html@>
<if "" ne @admin_html@>
<table cellspacing=
1 cellpadding=1 border=0
>
<table cellspacing=
"1" cellpadding="1" border="0"
>
<tr>
<tr>
<td class=rowtitle align=
center
>#intranet-cost.Administration#</td>
<td class=rowtitle align=
"center"
>#intranet-cost.Administration#</td>
</tr>
</tr>
<tr>
<tr>
<td>
<td>
...
...
www/costs/new.tcl
View file @
d9ca8dec
...
@@ -24,7 +24,7 @@ ad_page_contract {
...
@@ -24,7 +24,7 @@ ad_page_contract {
# Default & Security
# 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
page_title
"
[
_ intranet-cost.Edit_Cost
]
"
set
context
[
im_context_bar
$page
_title
]
set
context
[
im_context_bar
$page
_title
]
...
@@ -34,7 +34,7 @@ set context [im_context_bar $page_title]
...
@@ -34,7 +34,7 @@ set context [im_context_bar $page_title]
# Redirect to sub-type
# 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
"
set subtype_sql
"
select bou.*
select bou.*
from acs_objects o,
from acs_objects o,
...
@@ -80,7 +80,7 @@ set admin_html ""
...
@@ -80,7 +80,7 @@ set admin_html ""
# Get everything about the cost
# 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
# New variable: setup some reasonable defaults
set page_title
"
[
_ intranet-cost.New_Cost_Item
]
"
set page_title
"
[
_ intranet-cost.New_Cost_Item
]
"
...
...
www/index.adp
View file @
d9ca8dec
<master>
<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="main_navbar_label">finance</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<property name="left_navbar">@left_navbar_html;
noquote
@</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>
<tr><td>
<%= [im_component_bay top] %>
<%= [im_component_bay top] %>
</td></tr>
</td></tr>
</table>
</table>
<table cellpadding=
0 cellspacing=0 border=0
width="100%">
<table cellpadding=
"0" cellspacing="0" border="0"
width="100%">
<tr>
<tr>
<td valign=
top
>
<td valign=
"top"
>
<%= [im_component_bay left] %>
<%= [im_component_bay left] %>
</td>
</td>
<td valign=
top
>
<td valign=
"top"
>
<%= [im_component_bay right] %>
<%= [im_component_bay right] %>
</td>
</td>
</tr>
</tr>
</table>
</table>
<table cellpadding=
0 cellspacing=0 border=0
width="100%">
<table cellpadding=
"0" cellspacing="0" border="0"
width="100%">
<tr><td>
<tr><td>
<%= [im_component_bay bottom] %>
<%= [im_component_bay bottom] %>
</td></tr>
</td></tr>
...
...
www/index.tcl
View file @
d9ca8dec
...
@@ -14,7 +14,7 @@ ad_page_contract {
...
@@ -14,7 +14,7 @@ ad_page_contract {
{
project_id 0
}
{
project_id 0
}
{
company_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
page_title
"
[
_ intranet-cost.Finance_Home
]
"
set
context_bar
[
im_context_bar
$page
_title
]
set
context_bar
[
im_context_bar
$page
_title
]
set
return_url
[
im_url_with_query
]
set
return_url
[
im_url_with_query
]
...
...
www/list.adp
View file @
d9ca8dec
<master>
<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="main_navbar_label">finance</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<property name="left_navbar">@left_navbar_html;
noquote
@</property>
<property name="left_navbar">@left_navbar_html;
literal
@</property>
<form action="/intranet-cost/costs/cost-action" method="POST">
<form action="/intranet-cost/costs/cost-action" method="POST">
<%= [export_vars -form {company_id cost_id return_url}] %>
<%= [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_header_html;noquote@
@table_body_html;noquote@
@table_body_html;noquote@
@table_continuation_html;noquote@
@table_continuation_html;noquote@
...
...
www/list.tcl
View file @
d9ca8dec
...
@@ -63,7 +63,7 @@ ad_page_contract {
...
@@ -63,7 +63,7 @@ ad_page_contract {
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# User id already verified by filters
# 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
page_title
"
[
_ intranet-cost.Cost_Items
]
"
set
context_bar
[
im_context_bar
$page
_title
]
set
context_bar
[
im_context_bar
$page
_title
]
set
page_focus
"im_header_form.keywords"
set
page_focus
"im_header_form.keywords"
...
@@ -79,10 +79,10 @@ if {![im_permission $user_id view_costs]} {
...
@@ -79,10 +79,10 @@ if {![im_permission $user_id view_costs]} {
return
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 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
}
{
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
]
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 {
...
@@ -130,10 +130,10 @@ db_foreach column_list_sql $column_sql {
# ---------------------------------------------------------------
# ---------------------------------------------------------------
set
criteria
[
list
]
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
]
","
]
)"
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
]
","
]
)"
lappend criteria
"c.cost_type_id in (
[
join
[
im_sub_categories
$cost
_type_id
]
","
]
)"
}
}
if
{
$customer
_id
}
{
if
{
$customer
_id
}
{
...
@@ -174,7 +174,7 @@ if {"" != $project_id && 0 != $project_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"
lappend criteria
"im_first_letter_default_to_a(cust.company_name)=:letter"
}
}
...
@@ -217,7 +217,7 @@ switch $order_by {
...
@@ -217,7 +217,7 @@ switch $order_by {
}
}
set
where_clause
[
join
$criteria
" and
\n
"
]
set
where_clause
[
join
$criteria
" and
\n
"
]
if
{
!
[
empty_string_p
$where
_clause
]
}
{
if
{
$where
_clause ne
""
}
{
set where_clause
" and
$where
_clause"
set where_clause
" and
$where
_clause"
}
}
...
@@ -314,7 +314,7 @@ set filter_html "
...
@@ -314,7 +314,7 @@ set filter_html "
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# Set up colspan to be the number of headers + 1 for the # column
# 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
""
set
table_header_html
""
#<tr>
#<tr>
...
@@ -328,13 +328,13 @@ set table_header_html ""
...
@@ -328,13 +328,13 @@ set table_header_html ""
#
#
set url "
$local
_url?
"
set url "
$local
_url?
"
set query_string
[
export_ns_set_vars url
[
list
order_by
]]
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 url "
$query
_string&
"
}
}
append table_header_html "
<tr>
\n
"
append table_header_html "
<tr>
\n
"
foreach col
$column
_headers {
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
"
append table_header_html "
<td class=rowtitle>$col</td>
\n
"
} else {
} else {
append table_header_html "
<td class=rowtitle><a href=
\"
${url}
order_by=
[
ns_urlencode
$col
]
\"
>$col</a></td>
\n
"
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
...
@@ -354,7 +354,7 @@ set ctr 0
set idx
$start
_idx
set idx
$start
_idx
db_foreach costs_info_query {} {
db_foreach costs_info_query {} {
set url
[
im_maybe_prepend_http
$url
]
set url
[
im_maybe_prepend_http
$url
]
if {
[
empty_string_p
$url
]
} {
if {
$url
eq ""
} {
set url_string "
 
;
"
set url_string "
 
;
"
} else {
} else {
set url_string "
<a href=
\"
$url
\"
>$url</a>
"
set url_string "
<a href=
\"
$url
\"
>$url</a>
"
...
@@ -364,7 +364,7 @@ db_foreach costs_info_query {} {
...
@@ -364,7 +364,7 @@ db_foreach costs_info_query {} {
if {"" ==
$amount
} { set currency "" }
if {"" ==
$amount
} { set currency "" }
# Append together a line of data based on the "
column_vars
" parameter list
# 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 {
foreach column_var
$column
_vars {
append table_body_html "
\t
<td valign=top>
"
append table_body_html "
\t
<td valign=top>
"
set cmd "
append table_body_html
$column
_var
"
set cmd "
append table_body_html
$column
_var
"
...
@@ -381,7 +381,7 @@ db_foreach costs_info_query {} {
...
@@ -381,7 +381,7 @@ db_foreach costs_info_query {} {
}
}
# Show a reasonable message when there are no result rows:
# 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 "
set table_body_html "
<tr><td colspan=$colspan><ul><li><b>
<tr><td colspan=$colspan><ul><li><b>
[
_ intranet-cost.lt_There_are_currently_n
]
[
_ intranet-cost.lt_There_are_currently_n
]
...
@@ -391,7 +391,7 @@ if { [empty_string_p $table_body_html] } {
...
@@ -391,7 +391,7 @@ if { [empty_string_p $table_body_html] } {
if {
$ctr
==
$how
_many &&
$end
_idx <
$total
_in_limited } {
if {
$ctr
==
$how
_many &&
$end
_idx <
$total
_in_limited } {
# This means that there are rows that we decided not to return
# This means that there are rows that we decided not to return
# Include a link to go to the next page
# 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
]]
"
set next_page_url "
$local
_url?start_idx=$next_start_idx&
[
export_ns_set_vars url
[
list
start_idx
]]
"
} else {
} else {
set next_page_url ""
set next_page_url ""
...
@@ -400,7 +400,7 @@ if { $ctr == $how_many && $end_idx < $total_in_limited } {
...
@@ -400,7 +400,7 @@ if { $ctr == $how_many && $end_idx < $total_in_limited } {
if {
$start
_idx > 0 } {
if {
$start
_idx > 0 } {
# This means we didn't start with the first row - there is
# This means we didn't start with the first row - there is
# at least 1 previous row. add a previous page link
# 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 }
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
]]
"
set previous_page_url "
$local
_url?start_idx=$previous_start_idx&
[
export_ns_set_vars url
[
list
start_idx
]]
"
} else {
} else {
...
@@ -415,7 +415,7 @@ if { $start_idx > 0 } {
...
@@ -415,7 +415,7 @@ if { $start_idx > 0 } {
# => include a link to go to the next page
# => include a link to go to the next page
#
#
if {
$ctr
==
$how
_many &&
$total
_in_limited > 0 &&
$end
_idx <
$total
_in_limited} {
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>
"
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 {
} else {
set next_page ""
set next_page ""
...
@@ -426,7 +426,7 @@ if {$ctr==$how_many && $total_in_limited > 0 && $end_idx < $total_in_limited} {
...
@@ -426,7 +426,7 @@ if {$ctr==$how_many && $total_in_limited > 0 && $end_idx < $total_in_limited} {
# => add a previous page link
# => add a previous page link
#
#
if {
$start
_idx > 0 } {
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 }
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>
"
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 {
} else {
...
@@ -442,7 +442,7 @@ set table_continuation_html "
...
@@ -442,7 +442,7 @@ set table_continuation_html "
set button_html "
set button_html "
<tr>
<tr>
<td colspan=
[
expr
$colspan
- 3
]
></td>
<td colspan=
[
expr
{
$colspan
- 3
}
]
></td>
<td align=center>
<td align=center>
<input type=submit name=submit_save value='
[
_ intranet-cost.Save
]
'>
<input type=submit name=submit_save value='
[
_ intranet-cost.Save
]
'>
</td>
</td>
...
...
www/rep-costs/index.adp
View file @
d9ca8dec
<master src="../../../intranet-core/www/master">
<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="context">#intranet-cost.context#</property>
<property name="main_navbar_label">finance</property>
<property name="main_navbar_label">finance</property>
<br>
<br>
<%= [im_costs_navbar "none" "/intranet/invoices/index" "" "" [list] "costs_rep"] %>
<%= [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_header_html %>
<%= $table_body_html %>
<%= $table_body_html %>
<%= $table_continuation_html %>
<%= $table_continuation_html %>
...
...
www/rep-costs/index.tcl
View file @
d9ca8dec
...
@@ -26,7 +26,7 @@ ad_page_contract {
...
@@ -26,7 +26,7 @@ ad_page_contract {
# Defaults & Security
# 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
subsite_id
[
ad_conn subsite_id
]
set
bgcolor
(
0
)
" class=roweven "
set
bgcolor
(
0
)
" class=roweven "
set
bgcolor
(
1
)
" class=rowodd "
set
bgcolor
(
1
)
" class=rowodd "
...
@@ -95,7 +95,7 @@ where start_block >= rc.start_date
...
@@ -95,7 +95,7 @@ where start_block >= rc.start_date
db_foreach all_start_blocks
$all
_start_blocks_sql
{
db_foreach all_start_blocks
$all
_start_blocks_sql
{
set key
"
$rep
_cost_id:
$start
_block"
set key
"
$rep
_cost_id:
$start
_block"
# Fill the field with a link to create a new cost item
# 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
"
ns_log Notice
"/intranet-cos/rep-costs/index: key=
$key
"
}
}
...
@@ -145,7 +145,7 @@ foreach cost_tuple $repeating_cost_ids {
...
@@ -145,7 +145,7 @@ foreach cost_tuple $repeating_cost_ids {
set cost_id
[
lindex
$cost
_tuple 0
]
set cost_id
[
lindex
$cost
_tuple 0
]
set cost_name
[
lindex
$cost
_tuple 1
]
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
"
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
}
{
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">
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
noquote
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</property>
<property name="main_navbar_label">finance</property>
<h2>@page_title@</h2>
<h2>@page_title@</h2>
...
@@ -9,6 +9,6 @@
...
@@ -9,6 +9,6 @@
<div class="general-message">@message@</div>
<div class="general-message">@message@</div>
</if>
</if>
<property name="focus">@focus;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<formtemplate id="cost"></formtemplate>
<formtemplate id="cost"></formtemplate>
www/rep-costs/new-rep-cost.tcl
View file @
d9ca8dec
...
@@ -20,7 +20,7 @@ ad_page_contract {
...
@@ -20,7 +20,7 @@ ad_page_contract {
# Default & Security
# 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
page_title
[
lang::message::lookup
""
intranet-cost.Create_Repeating_Cost_Item
"Create Repeating Cost Item"
]
set
context
[
im_context_bar
$page
_title
]
set
context
[
im_context_bar
$page
_title
]
set
today
[
db_string birthday_today
"select to_char(sysdate,'YYYY-MM-DD') from dual"
]
set
today
[
db_string birthday_today
"select to_char(sysdate,'YYYY-MM-DD') from dual"
]
...
@@ -72,9 +72,9 @@ append cost_name " - $start_block"
...
@@ -72,9 +72,9 @@ append cost_name " - $start_block"
set
cost_id
[
im_new_object_id
]
set
cost_id
[
im_new_object_id
]
set
cause_object_id
$rep
_cost_id
set
cause_object_id
$rep
_cost_id
set
effective_date
$start
_block
set
effective_date
$start
_block
if
{
!
[
exists_and_not_null payment_days
]
}
{
set payment_days 0
}
if
{
(
!
[
info
exists payment_days
]
||
$payment
_days eq
""
)
}
{
set payment_days 0
}
if
{
!
[
exists_and_not_null tax
]
}
{
set tax 0
}
if
{
(
!
[
info
exists tax
]
||
$tax
eq
""
)
}
{
set tax 0
}
if
{
!
[
exists_and_not_null vat
]
}
{
set vat 0
}
if
{
(
!
[
info
exists vat
]
||
$vat
eq
""
)
}
{
set vat 0
}
set
project_options
[
im_project_options
]
set
project_options
[
im_project_options
]
set
customer_options
[
im_company_options -include_empty_p 0 -status
"Active"
-type
"CustOrIntl"
]
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">
<master src="../../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
noquote
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">finance</property>
<property name="main_navbar_label">finance</property>
<h2>@page_title@</h2>
<h2>@page_title@</h2>
...
@@ -9,6 +9,6 @@
...
@@ -9,6 +9,6 @@
<div class="general-message">@message@</div>
<div class="general-message">@message@</div>
</if>
</if>
<property name="focus">@focus;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<formtemplate id="cost"></formtemplate>
<formtemplate id="cost"></formtemplate>
www/rep-costs/new.tcl
View file @
d9ca8dec
...
@@ -24,7 +24,7 @@ ad_page_contract {
...
@@ -24,7 +24,7 @@ ad_page_contract {
# Default & Security
# 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
page_title
"<#_ Edit Repeating Cost#>"
set
context
[
im_context_bar
$page
_title
]
set
context
[
im_context_bar
$page
_title
]
set
today
[
db_string birthday_today
"select sysdate from dual"
]
set
today
[
db_string birthday_today
"select sysdate from dual"
]
...
@@ -42,7 +42,7 @@ set focus "cost.var_name"
...
@@ -42,7 +42,7 @@ set focus "cost.var_name"
# Get everything about the cost
# 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
# New variable: setup some reasonable defaults
set page_title
"<#_ New Repeating Cost Item#>"
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