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
cc4960cf
Commit
cc4960cf
authored
Dec 14, 2017
by
cosine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Finished prices with valid_from and valid_through
parent
1a87c2c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
intranet-timesheet2-invoices-procs.tcl
tcl/intranet-timesheet2-invoices-procs.tcl
+4
-3
new.tcl
www/price-lists/new.tcl
+27
-10
No files found.
tcl/intranet-timesheet2-invoices-procs.tcl
View file @
cc4960cf
...
@@ -55,10 +55,11 @@ ad_proc im_timesheet_price_component { user_id company_id return_url} {
...
@@ -55,10 +55,11 @@ ad_proc im_timesheet_price_component { user_id company_id return_url} {
set bgcolor
(
0
)
" class=roweven "
set bgcolor
(
0
)
" class=roweven "
set bgcolor
(
1
)
" class=rowodd "
set bgcolor
(
1
)
" class=rowodd "
# set price_format "000.00"
set price_format
"%0.2f"
set price_format
"%0.2f"
set colspan 7
set colspan 7
set return_url
[
im_url_with_query
]
set price_list_html
"
set price_list_html
"
<form action=/intranet-timesheet2-invoices/price-lists/price-action method=POST>
<form action=/intranet-timesheet2-invoices/price-lists/price-action method=POST>
[
export_vars -form
{
company_id return_url
}]
[
export_vars -form
{
company_id return_url
}]
...
@@ -107,7 +108,7 @@ ad_proc im_timesheet_price_component { user_id company_id return_url} {
...
@@ -107,7 +108,7 @@ ad_proc im_timesheet_price_component { user_id company_id return_url} {
append price_rows_html
"<tr><td colspan=
$colspan
> </td></tr>
\n
"
append price_rows_html
"<tr><td colspan=
$colspan
> </td></tr>
\n
"
}
}
set url
[
export_vars -base
"/intranet-timesheet2-invoices/price-lists/new"
{
price_id
}]
set url
[
export_vars -base
"/intranet-timesheet2-invoices/price-lists/new"
{
price_id
return_url
}]
append price_rows_html
"
append price_rows_html
"
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}]
) nobreak>
<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}]
) nobreak>
...
...
www/price-lists/new.tcl
View file @
cc4960cf
...
@@ -39,7 +39,7 @@ if {![im_permission $user_id add_finance]} {
...
@@ -39,7 +39,7 @@ if {![im_permission $user_id add_finance]} {
}
}
# Get the company_id if the price_id exists
# Get the company_id if the price_id exists
if
{[
info
exists price_id
]}
{
if
{[
info
exists price_id
]
&& !
[
info
exists company_id
]
}
{
db_1row price_info
"
db_1row price_info
"
select company_id
select company_id
from im_timesheet_prices
from im_timesheet_prices
...
@@ -87,8 +87,8 @@ ad_form \
...
@@ -87,8 +87,8 @@ ad_form \
{
task_type_id:text
(
im_category_tree
)
,optional
{
label
"
[
_ intranet-timesheet2-invoices.Task_Type
]
"
}
{
custom
{
category_type
"Intranet Project Type"
translate_p 1 include_empty_p 1
}}
}
{
task_type_id:text
(
im_category_tree
)
,optional
{
label
"
[
_ intranet-timesheet2-invoices.Task_Type
]
"
}
{
custom
{
category_type
"Intranet Project Type"
translate_p 1 include_empty_p 1
}}
}
{
material_id:text
(
select
)
,optional
{
label
"
[
_ intranet-timesheet2-invoices.Material
]
"
}
{
options
$material
_options
}
}
{
material_id:text
(
select
)
,optional
{
label
"
[
_ intranet-timesheet2-invoices.Material
]
"
}
{
options
$material
_options
}
}
{
project_id:text
(
select
)
,optional
{
label
"
[
_ intranet-core.Project
]
"
}
{
options
$project
_options
}
}
{
project_id:text
(
select
)
,optional
{
label
"
[
_ intranet-core.Project
]
"
}
{
options
$project
_options
}
}
{
valid_from:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.Start_Date
]
"
}
{
after_html
{
<input type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
onclick =
"return showCalendarWithDateWidget('
start_date
', 'y-m-d');"
>
}}
}
{
valid_from:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.Start_Date
]
"
}
{
after_html
{
<input type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
onclick =
"return showCalendarWithDateWidget('
valid_from
', 'y-m-d');"
>
}}
}
{
valid_through:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.End_Date
]
"
}
{
after_html
{
<input type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
onclick =
"return showCalendarWithDateWidget('
end_date
', 'y-m-d');"
>
}}
}
{
valid_through:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.End_Date
]
"
}
{
after_html
{
<input type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
onclick =
"return showCalendarWithDateWidget('
valid_through
', 'y-m-d');"
>
}}
}
{
price:text
(
text
)
{
label
"
[
_ intranet-timesheet2-invoices.Price
]
"
}
{
html
{
size 10
}}}
{
price:text
(
text
)
{
label
"
[
_ intranet-timesheet2-invoices.Price
]
"
}
{
html
{
size 10
}}}
{
currency:text
(
select
)
{
label
"
[
_ intranet-timesheet2-invoices.Currency
]
"
}
{
options
$currency
_options
}
}
{
currency:text
(
select
)
{
label
"
[
_ intranet-timesheet2-invoices.Currency
]
"
}
{
options
$currency
_options
}
}
}
}
...
@@ -101,6 +101,10 @@ ad_form -extend -name price -on_request {
...
@@ -101,6 +101,10 @@ ad_form -extend -name price -on_request {
from im_timesheet_prices p
from im_timesheet_prices p
where p.price_id = :price_id
where p.price_id = :price_id
}
-new_data
{
}
-new_data
{
set valid_from_sql
[
template::util::date get_property sql_date
$valid
_from
]
set valid_through_sql
[
template::util::date get_property sql_timestamp
$valid
_through
]
db_dml price_insert
"
db_dml price_insert
"
insert into im_timesheet_prices (
insert into im_timesheet_prices (
price_id,
price_id,
...
@@ -108,6 +112,9 @@ ad_form -extend -name price -on_request {
...
@@ -108,6 +112,9 @@ ad_form -extend -name price -on_request {
company_id,
company_id,
task_type_id,
task_type_id,
material_id,
material_id,
project_id,
valid_from,
valid_through,
currency,
currency,
price
price
) values (
) values (
...
@@ -116,19 +123,29 @@ ad_form -extend -name price -on_request {
...
@@ -116,19 +123,29 @@ ad_form -extend -name price -on_request {
:company_id,
:company_id,
:task_type_id,
:task_type_id,
:material_id,
:material_id,
:project_id,
$valid
_from_sql,
$valid
_through_sql,
:currency,
:currency,
:price
:price
)
)
"
"
}
-edit_data
{
}
-edit_data
{
set valid_from_sql
[
template::util::date get_property sql_date
$valid
_from
]
set valid_through_sql
[
template::util::date get_property sql_timestamp
$valid
_through
]
db_dml price_update
"
db_dml price_update
"
update im_prices set
update im_timesheet_prices set
package_name = :package_name,
uom_id = :uom_id,
label = :label,
company_id = :company_id,
name = :name,
task_type_id = :task_type_id,
url = :url,
material_id = :material_id,
sort_order = :sort_order,
project_id = :project_id,
parent_price_id = :parent_price_id
valid_from =
$valid
_from_sql,
valid_through =
$valid
_through_sql,
currency = :currency,
price = :price
where
where
price_id = :price_id
price_id = :price_id
"
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment