Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-expenses
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-expenses
Commits
48c00e55
Commit
48c00e55
authored
Jul 09, 2019
by
adrtel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added payment portlet for expense bundles
parent
a255ff3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
4 deletions
+103
-4
bundle-new.adp
www/bundle-new.adp
+14
-4
bundle-new.tcl
www/bundle-new.tcl
+89
-0
No files found.
www/bundle-new.adp
View file @
48c00e55
...
...
@@ -13,13 +13,23 @@
<td>
<h2>@page_title@</h2>
<table>
<tr valign=top>
<td>
<formtemplate id=form></formtemplate>
<br>
</td>
<td align=right>
@payment_list_html;noquote@
</td>
</tr>
<tr>
<td colspan=2>
<h2>@included_expenses_msg@</h2>
<!--
@modify_bundle_link;noquote@
-->
<!-- @modify_bundle_link;noquote@-->
<listtemplate name=@list_id@></listtemplate>
</td>
</tr>
</table>
<if @form_mode@ eq "display" >
<%= [im_component_bay left] %>
...
...
www/bundle-new.tcl
View file @
48c00e55
...
...
@@ -38,6 +38,9 @@ set context_bar [im_context_bar $page_title]
set
user_locale
[
lang::user::locale
]
set
locale
$user
_locale
set
bgcolor
(
0
)
"class=invoiceroweven"
set
bgcolor
(
1
)
"class=invoicerowodd"
if
{
!
[
info
exists enable_master_p
]}
{
set enable_master_p 1
}
if
{
!
[
info
exists form_mode
]}
{
set form_mode
"edit"
}
...
...
@@ -499,6 +502,92 @@ foreach key [array names curr_hash] {
}
append
reimbursement_output_table
"</table><br><br><br>"
# ---------------------------------------------------------------
# Payments list
# ---------------------------------------------------------------
set
cost_id
$bundle
_id
im_cost_permissions
$current
_user_id
$cost
_id view_p read_p write_p admin_p
# set user_is_admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id
]
# set write_p [expr [im_profile::member_p -profile "Accounting" -user_id $current_user_id
]
||
$user
_is_admin_p
]
set
payment_list_html
"
<form action=/intranet-invoices/payment-action method=post>
[
export_vars -form
{
cost_id return_url
}]
<table border=0 cellPadding=1 cellspacing=1>
<tr>
<td align=middle class=rowtitle colspan=3>
[
lang::message::lookup
$user
_locale intranet-invoices.Related_Payments
]
</td>
</tr>"
set
payment_list_sql
"
select p.*,
to_char(p.received_date,'YYYY-MM-DD') as received_date_pretty,
im_category_from_id(p.payment_type_id) as payment_type
from im_payments p
where p.cost_id = :cost_id
"
set
payment_ctr 0
db_foreach payment_list
$payment
_list_sql
{
append payment_list_html
"
<tr
$bgcolor
(
[
expr
{
$payment
_ctr % 2
}]
)>
<td>
<A href=/intranet-payments/view?payment_id=
$payment
_id>
$received
_date_pretty
</A>
</td>
<td>
$amount
$currency
</td>
\n
"
if
{
$write
_p
}
{
append payment_list_html
"
<td>
<input type=checkbox name=payment_id value=
$payment
_id>
</td>
\n
"
}
append payment_list_html
"
</tr>
\n
"
incr payment_ctr
}
if
{
!$payment_ctr
}
{
append payment_list_html
"<tr class=roweven><td colspan=2 align=center><i>
[
lang::message::lookup
$user
_locale intranet-invoices.No_payments_found
]
</i></td></tr>
\n
"
}
if
{
$write
_p
}
{
append payment_list_html
"
<tr
$bgcolor
(
[
expr
{
$payment
_ctr % 2
}]
)>
<td align=right colspan=3>
<input type=submit name=add value=
\"
[
lang::message::lookup
$user
_locale intranet-invoices.Add_a_Payment
]
\"
>
<input type=submit name=del value=
\"
[
lang::message::lookup
$user
_locale intranet-invoices.Del
]
\"
>
</td>
</tr>
\n
"
}
append
payment_list_html
"
</table>
</form>
\n
"
# ---------------------------------------------------------------
# Special Output: Format using a template
# ---------------------------------------------------------------
...
...
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