Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-invoices
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-timesheet2-invoices
Commits
a2456003
Commit
a2456003
authored
Sep 18, 2006
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added CostCenter Permissions
parent
e064d538
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
new-3.tcl
www/invoices/new-3.tcl
+50
-0
No files found.
www/invoices/new-3.tcl
View file @
a2456003
...
...
@@ -26,6 +26,7 @@ ad_page_contract {
company_id:integer
invoice_currency
invoice_hour_type
{
cost_center_id:integer 0
}
target_cost_type_id:integer
{
return_url
""
}
}
...
...
@@ -54,6 +55,14 @@ if {![im_permission $user_id add_invoices]} {
<li>
[
_ intranet-timesheet2-invoices.lt_You_dont_have_suffici
]
"
}
set
allowed_cost_type
[
im_cost_type_write_permissions
$user
_id
]
if
{[
lsearch
-exact
$allowed
_cost_type
$target
_cost_type_id
]
== -1
}
{
ad_return_complaint
"Insufficient Privileges"
"
<li>You can't create documents of type
\#
$target
_cost_type_id."
ad_script_abort
}
# ---------------------------------------------------------------
# Gather invoice data
# ---------------------------------------------------------------
...
...
@@ -75,6 +84,47 @@ if { [catch {
}
# Default for cost-centers - take the user's
# dept from HR.
if
{
0 ==
$cost
_center_id
}
{
set cost_center_id
[
im_costs_default_cost_center_for_user
$user
_id
]
}
set
cost_center_label
[
lang::message::lookup
""
intranet-invoices.Cost_Center
"Cost Center"
]
set
cost_center_select
[
im_cost_center_select -include_empty 1 -department_only_p 0 cost_center_id
$cost
_center_id
$target
_cost_type_id
]
set
contact_ids
[
db_list contact_ids
"
select distinct
company_contact_id
from
im_timesheet_tasks t,
im_projects p
where
t.task_id = p.project_id
and
$tasks
_where_clause
"
]
if
{[
llength
$contact
_ids
]
> 0
}
{
set company_contact_id
[
lindex
$contact
_ids 0
]
}
else
{
set company_contact_id
$accounting
_contact_id
}
db_1row accounting_contact_info
"
select
im_name_from_user_id(:company_contact_id) as company_contact_name,
im_email_from_user_id(:company_contact_id) as company_contact_email
"
set
invoice_office_id
[
db_string company_main_office_info
"select main_office_id from im_companies where company_id = :org_company_id"
-default
""
]
# Create the default values for a new invoice.
#
# Calculate the next invoice number by calculating the maximum of
...
...
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