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
bf9a7cf8
Commit
bf9a7cf8
authored
May 11, 2005
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added timesheet-invoicing, basicly works (alpha)
parent
37a19d91
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
302 additions
and
267 deletions
+302
-267
intranet-timesheet2-invoices.info
intranet-timesheet2-invoices.info
+1
-1
intranet-timesheet2-invoices-procs.tcl
tcl/intranet-timesheet2-invoices-procs.tcl
+3
-2
new-2.tcl
www/invoices/new-2.tcl
+53
-13
new-3-postgresql.xql
www/invoices/new-3-postgresql.xql
+7
-4
new-3.adp
www/invoices/new-3.adp
+178
-1
new-3.tcl
www/invoices/new-3.tcl
+54
-225
new.tcl
www/invoices/new.tcl
+0
-2
new.tcl
www/price-lists/new.tcl
+4
-17
price-action.tcl
www/price-lists/price-action.tcl
+2
-2
No files found.
intranet-timesheet2-invoices.info
View file @
bf9a7cf8
...
...
@@ -15,7 +15,7 @@
<provides
url=
"intranet-timesheet2-invoices"
version=
"3.0.0"
/>
<requires
url=
"intranet-core"
version=
"3.0.0"
/>
<requires
url=
"intranet-timesheet"
version=
"3.0.0"
/>
<requires
url=
"intranet-timesheet
2
"
version=
"3.0.0"
/>
<requires
url=
"intranet-invoices"
version=
"3.0.0"
/>
<callbacks>
...
...
tcl/intranet-timesheet2-invoices-procs.tcl
View file @
bf9a7cf8
...
...
@@ -24,7 +24,8 @@ ad_proc im_timesheet_price_component { user_id company_id return_url} {
set bgcolor
(
0
)
" class=roweven "
set bgcolor
(
1
)
" class=rowodd "
set price_format
"000.00"
# set price_format "000.00"
set price_format
"%0.2f"
set colspan 7
set price_list_html
"
...
...
@@ -73,7 +74,7 @@ order by
<td>
$uom
</td>
<td>
$task
_type</td>
<td>
$material
</td>
<td>
[
format
"%0.3f"
$price
]
$currency
</td>
<td>
[
format
$price
_format
$price
]
$currency
</td>
<td><input type=checkbox name=price_id.
$price
_id></td>
</tr>"
incr ctr
...
...
www/invoices/new-2.tcl
View file @
bf9a7cf8
...
...
@@ -66,7 +66,27 @@ set in_clause_list [list]
foreach
selected_project
$select
_project
{
lappend in_clause_list
$selected
_project
}
set
projects_where_clause
"and p.project_id in (
[
join
$in
_clause_list
","
]
)"
set
projects_where_clause
"
and p.project_id in (
select
children.project_id
from
im_projects parent,
im_projects children
where
children.project_status_id not in (
[
im_project_status_deleted
]
,
[
im_project_status_canceled
]
)
and children.tree_sortkey
between parent.tree_sortkey
and tree_right(parent.tree_sortkey)
and parent.project_id in (
[
join
$in
_clause_list
","
]
)
order by
children.tree_sortkey
)
"
# check that all projects are from the same client
...
...
@@ -111,13 +131,15 @@ select
p.project_path,
p.project_path as project_short_name,
t.task_id,
t.task_units,
t.task_name,
t.planned_units,
t.billable_units,
t.task_uom_id,
t.reported_units_cache,
t.uom_id,
t.task_type_id,
t.project_id,
im_category_from_id(t.task_uom_id) as uom_name,
im_material_name_from_id(t.material_id) as material_name,
im_category_from_id(t.uom_id) as uom_name,
im_category_from_id(t.task_type_id) as type_name,
im_category_from_id(t.task_status_id) as task_status
from
...
...
@@ -126,32 +148,48 @@ from
where
t.project_id = p.project_id
$task
_invoice_id_null
$projects
_where_clause
order by
project_id, task_id
"
set
disabled_task_status_where
"
and t.task_status_id in (
select task_status_id
from im_task_status
where upper(task_status) not in (
select category_id
from im_categories
where category_type = 'Intranet Timesheet Task Status'
and upper(category) not in (
'CLOSED','INVOICED','PARTIALLY PAID',
'DECLINED','PAID','DELETED','CANCELED'
)
)
$projects
_where_clause
order by
project_id, task_id
"
set
task_table
"
<tr>
<td class=rowtitle align=middle>
[
im_gif help
"Include in Invoice"
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Task_Name
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Units
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Material
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Planned_Units
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Billable_Units
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Reported_Units
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.UoM
]
[
im_gif help
"Unit of Measure"
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Type
]
</td>
<td class=rowtitle>
[
_ intranet-timesheet2-invoices.Status
]
</td>
</tr>
"
<tr>
<td></td>
<td colspan=2>Please select the type of hours to use:</td>
<td align=center><input type=radio name=invoice_hour_type value=planned></td>
<td align=center><input type=radio name=invoice_hour_type value=billable checked></td>
<td align=center><input type=radio name=invoice_hour_type value=reported></td>
<td></td>
<td></td>
<td></td>
</tr>
\n
"
set
task_table_rows
""
set
ctr 0
...
...
@@ -181,8 +219,10 @@ db_foreach select_tasks $sql {
<input type=checkbox name=include_task value=
$task
_id checked>
</td>
<td align=left>
$task
_name</td>
<td align=right>
$task
_units</td>
<td align=right>
$material
_name</td>
<td align=right>
$planned
_units</td>
<td align=right>
$billable
_units</td>
<td align=right>
$reported
_units_cache</td>
<td align=right>
$uom
_name</td>
<td>
$type
_name</td>
<td>
$task
_status</td>
...
...
www/invoices/new-3-postgresql.xql
View file @
bf9a7cf8
...
...
@@ -42,10 +42,13 @@ where
<querytext>
select
trim(both ' ' from to_char(s.task_sum, :number_format)) as task_sum,
trim(both ' ' from to_char(s.planned_sum, :number_format)) as planned_sum,
trim(both ' ' from to_char(s.billable_sum, :number_format)) as billable_sum,
trim(both ' ' from to_char(s.reported_sum, :number_format)) as reported_sum,
s.task_type_id,
s.material_id,
s.task_uom_id,
im_material_name_from_id(s.material_id) as material_name,
s.uom_id,
c_type.category as task_type,
c_uom.category as task_uom,
s.company_id,
...
...
@@ -53,11 +56,11 @@ select
p.project_name,
p.project_path,
p.project_path as project_short_name,
p.
company_
project_nr
p.project_nr
from
($task_sum_inner_sql) s
LEFT JOIN
im_categories c_uom ON s.
task_
uom_id=c_uom.category_id
im_categories c_uom ON s.uom_id=c_uom.category_id
LEFT JOIN
im_categories c_type ON s.task_type_id=c_type.category_id
LEFT JOIN
...
...
www/invoices/new-3.adp
View file @
bf9a7cf8
...
...
@@ -7,4 +7,181 @@
<property name="context">@context_bar@</property>
<property name="main_navbar_label">finance</property>
@page_body;noquote@
\ No newline at end of file
<%= [im_costs_navbar "none" "/intranet/invoicing/index" "" "" [list]] %>
<form action=new-4 method=POST>
<%= [export_form_vars customer_id provider_id invoice_id cost_status_id return_url] %>
@include_task_html;noquote@
<!-- Invoice Data and Receipient Tables -->
<table cellpadding=0 cellspacing=0 bordercolor=#6699CC border=0 width=100%>
<tr valign=top>
<td>
<table border=0 cellPadding=0 cellspacing=2>
<!-- Invoice Data -->
<tr>
<td align=middle class=rowtitle colspan=2>
#intranet-timesheet2-invoices.Invoice_Data#
</td>
</tr>
<tr>
<td class=rowodd>#intranet-timesheet2-invoices.Invoice_nr#:</td>
<td class=rowodd>
<input type=text name=invoice_nr size=15 value='@invoice_nr@'>
</td>
</tr>
<tr>
<td class=roweven>#intranet-timesheet2-invoices.Invoice_date#:</td>
<td class=roweven>
<input type=text name=invoice_date size=15 value='@invoice_date@'>
</td>
</tr>
<tr>
<td class=rowodd>#intranet-timesheet2-invoices.Type#</td>
<td class=rowodd>
<%= [im_cost_type_select cost_type_id $cost_type_id [im_cost_type_company_doc]] %>
</td>
</tr>
<if @cost_type_id@ eq @cost_type_invoice@>
<tr>
<td class=roweven>#intranet-timesheet2-invoices.Payment_terms#</td>
<td class=roweven>
<input type=text name=payment_days size=5 value='@payment_days@'>
days date of invoice</td>
</tr>
<tr>
<td class=rowodd>
#intranet-timesheet2-invoices.Payment_Method#
</td>
<td class=rowodd>
[im_invoice_payment_method_select payment_method_id $payment_method_id]
</td>
</tr>\n"
</if>
<tr>
<td class=roweven>#intranet-timesheet2-invoices.Invoice_template#:</td>
<td class=roweven>
<%= [im_cost_template_select template_id $template_id] %>
</td>
</tr>
</table>
</td>
<td></td>
<td align=right>
<table border=0 cellspacing=2 cellpadding=0 >
<tr>
<td align=center valign=top class=rowtitle colspan=2>
#intranet-timesheet2-invoices.Recipient#
</td>
</tr>
<tr>
<td class=rowodd>#intranet-timesheet2-invoices.Company_name#</td>
<td class=rowodd>
<A href=/intranet/companies/view?company_id=@company_id@>@company_name@</A>
</td>
</tr>
<tr>
<td class=roweven>#intranet-timesheet2-invoices.VAT#</td>
<td class=roweven>@vat_number@</td>
</tr>
<tr>
<td class=rowodd>#intranet-timesheet2-invoices.Accounting_Contact#</td>
<td class=rowodd>
<A href=/intranet/users/view?user_id=@accounting_contact_id@>@company_contact_name@</A>
</td>
</tr>
<tr>
<td class=roweven>#intranet-timesheet2-invoices.Adress#</td>
<td class=roweven>@address_line1@ <br> @address_line2@</td>
</tr>
<tr>
<td class=rowodd>#intranet-timesheet2-invoices.Zip#</td>
<td class=rowodd>@address_postal_code@</td>
</tr>
<tr>
<td class=roweven>#intranet-timesheet2-invoices.Country#</td>
<td class=roweven>@country_name@</td>
</tr>
<tr>
<td class=rowodd>#intranet-timesheet2-invoices.Phone#</td>
<td class=rowodd>@phone@</td>
</tr>
<tr>
<td class=roweven>#intranet-timesheet2-invoices.Fax#</td>
<td class=roweven>@fax@</td>
</tr>
<tr>
<td class=rowodd>#intranet-timesheet2-invoices.Email#</td>
<td class=rowodd>@company_contact_email@</td>
</tr>
</table>
</tr>
</table>
<!-- the list of tasks (invoicable items) -->
<table cellpadding=2 cellspacing=2 border=0 width='100%'>
@task_table;noquote@
</table>
<!-- the list of task sums, distinguised by type and UOM -->
<table width=100%>
<tr>
<td align=right><table border=0 cellspacing=2 cellpadding=1>
@task_sum_html;noquote@
<!-- grand_total -->
<tr>
<td>
</td>
<td colspan=4 align=right>
<table border=0 cellspacing=1 cellpadding=0>
<tr>
<td>#intranet-timesheet2-invoices.VAT#</td>
<td><input type=text name=vat value='@vat@' size=4> % </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
<td colspan=4 align=right>
<table border=0 cellspacing=1 cellpadding=0>
<tr>
<td>#intranet-timesheet2-invoices.TAX#</td>
<td><input type=text name=tax value='@tax@' size=4> % </td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td colspan=6 align=right>
<input type=submit name=submit value='@button_text@'>
</td>
</tr>
</td>
</tr>
</table>
</form>
<!-- the list of reference prices -->
<table>
@reference_price_html;noquote@
</table>
www/invoices/new-3.tcl
View file @
bf9a7cf8
This diff is collapsed.
Click to expand it.
www/invoices/new.tcl
View file @
bf9a7cf8
...
...
@@ -254,13 +254,11 @@ select
p.project_name,
p.project_nr,
p.project_path,
p.final_company,
p.project_lead_id,
p.company_id,
c.company_name,
p.project_status_id,
im_name_from_user_id(p.project_lead_id) as lead_name,
im_category_from_id(p.subject_area_id) as subject_area,
im_category_from_id(p.project_type_id) as project_type,
im_category_from_id(p.project_status_id) as project_status,
im_proj_url_from_type(p.project_id, 'website') as url,
...
...
www/price-lists/new.tcl
View file @
bf9a7cf8
...
...
@@ -57,20 +57,7 @@ from im_categories
where category_type = 'Intranet Project Type'
"
]
set
task_type_options
[
linsert
$task
_type_options 0
[
list
""
""
]]
set
language_options
[
db_list_of_lists uom_options
"
select category, category_id
from im_categories
where category_type = 'Intranet Translation Language'
"
]
set
language_options
[
linsert
$language
_options 0
[
list
""
""
]]
set
material_options
[
db_list_of_lists uom_options
"
select category, category_id
from im_categories
where category_type = 'Intranet Translation Subject Area'
"
]
set
material_options
[
linsert
$material
_options 0
[
list
""
""
]]
set
material_options
[
im_material_options -include_empty 1
]
set
include_empty 0
set
currency_options
[
im_currency_options
$include
_empty
]
...
...
@@ -82,7 +69,7 @@ ad_form \
-mode
$form
_mode
\
-export
{
next_url user_id return_url
}
\
-form
{
price_id:key
(
im_t
rans
_prices_seq
)
price_id:key
(
im_t
imesheet
_prices_seq
)
{
company_id:text
(
hidden
)}
{
uom_id:text
(
select
)
{
label
"
[
_ intranet-timesheet2-invoices.Unit_of_Measure
]
"
}
{
options
$uom
_options
}
}
{
task_type_id:text
(
select
)
,optional
{
label
"
[
_ intranet-timesheet2-invoices.Task_Type
]
"
}
{
options
$task
_type_options
}
}
...
...
@@ -98,13 +85,13 @@ ad_form -extend -name price -on_request {
}
-select_query
{
select p.*
from im_t
rans
_prices p
from im_t
imesheet
_prices p
where p.price_id = :price_id
}
-new_data
{
db_dml price_insert
"
insert into im_t
rans
_prices (
insert into im_t
imesheet
_prices (
price_id,
uom_id,
company_id,
...
...
www/price-lists/price-action.tcl
View file @
bf9a7cf8
...
...
@@ -51,13 +51,13 @@ if {"" != $del} {
if
{
0 ==
[
llength
$price
_list
]}
{
ad_returnredirect
$return
_url
}
db_dml delete_prices
"
delete from im_timesheet
2-
_prices
delete from im_timesheet_prices
where price_id in (
[
join
$price
_list
","
]
)
"
ad_returnredirect
$return
_url
return
}
ad_return_complaint 1
"<li>
[
_ intranet-timesheet2-
-
invoices.lt_Unknown_action_for_pr
]
"
ad_return_complaint 1
"<li>
[
_ intranet-timesheet2-invoices.lt_Unknown_action_for_pr
]
"
return
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