Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-reporting-finance
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-reporting-finance
Commits
f31776ec
Commit
f31776ec
authored
Mar 31, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Right aligned numbers, fixed rounding issue
parent
94358278
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
17 deletions
+48
-17
finance-monthly-summary.tcl
www/finance-monthly-summary.tcl
+48
-17
No files found.
www/finance-monthly-summary.tcl
View file @
f31776ec
...
...
@@ -18,6 +18,7 @@ ad_page_contract {
project_id:integer,optional
customer_id:integer,optional
provider_id:integer,optional
{
rounding_precision:integer 2
}
}
# ------------------------------------------------------------
...
...
@@ -59,6 +60,8 @@ set page_title "Finance Monthly Summary"
set
context_bar
[
im_context_bar
$page
_title
]
set
context
""
set
number_locale
[
lang::user::locale
]
# ------------------------------------------------------------
# Defaults
...
...
@@ -218,11 +221,11 @@ set report_def [list \
$provider
_nr
$effective
_date_formatted
$cost
_name
"<nobr>
$paid
_amount_pretty</nobr>"
"<nobr>
$invoice
_amount_pretty</nobr>"
"<nobr>
$quote
_amount_pretty</nobr>"
"<nobr>
$bill
_amount_pretty</nobr>"
"<nobr>
$po
_amount_pretty</nobr>"
"
#align=right
<nobr>
$paid
_amount_pretty</nobr>"
"
#align=right
<nobr>
$invoice
_amount_pretty</nobr>"
"
#align=right
<nobr>
$quote
_amount_pretty</nobr>"
"
#align=right
<nobr>
$bill
_amount_pretty</nobr>"
"
#align=right
<nobr>
$po
_amount_pretty</nobr>"
}
\
content
{}
\
]
\
...
...
@@ -232,11 +235,11 @@ set report_def [list \
"
\#
colspan=1 <nobr><a href=
$this
_url&effective_date=
$effective
_date_formatted&level_of_detail=3 target=_blank><img src=/intranet/images/plus_9.gif width=9 height=9 border=0></a>
<i>
$effective
_date_formatted</i></nobr>"
""
"
<i>
$paid
_month_total
$default
_currency</i>"
"
<i>
$invoice
_month_total
$default
_currency</i>"
"
<i>
$quote
_month_total
$default
_currency</i>"
"
<i>
$bill
_month_total
$default
_currency</i>"
"
<i>
$po
_month_total
$default
_currency</i>"
"
#align=right <i>
$paid
_month_total_pretty
$default
_currency</i>"
"
#align=right <i>
$invoice
_month_total_pretty
$default
_currency</i>"
"
#align=right <i>
$quote
_month_total_pretty
$default
_currency</i>"
"
#align=right <i>
$bill
_month_total_pretty
$default
_currency</i>"
"
#align=right <i>
$po
_month_total_pretty
$default
_currency</i>"
}
\
]
\
footer
{
...
...
@@ -244,11 +247,11 @@ set report_def [list \
""
""
"<b>Subtotal:</b>"
"
<b>
$paid
_subtotal
$default
_currency</b>"
"
<b>
$invoice
_subtotal
$default
_currency</b>"
"
<b>
$quote
_subtotal
$default
_currency</b>"
"
<b>
$bill
_subtotal
$default
_currency</b>"
"
<b>
$po
_subtotal
$default
_currency</b>"
"
#align=right <b>
$paid
_subtotal_pretty
$default
_currency</b>"
"
#align=right <b>
$invoice
_subtotal_pretty
$default
_currency</b>"
"
#align=right <b>
$quote
_subtotal_pretty
$default
_currency</b>"
"
#align=right <b>
$bill
_subtotal_pretty
$default
_currency</b>"
"
#align=right <b>
$po
_subtotal_pretty
$default
_currency</b>"
}
\
]
...
...
@@ -260,7 +263,17 @@ set po_total 0
# Global header/footer
set
header0
{
"Customer"
"Provider"
"Date"
"Name"
"Paid"
"Invoice"
"Quote"
"Bill"
"PO"
}
set
footer0
{
""
""
""
"<br><b>Total:</b>"
"<br><b>
$paid
_total
$default
_currency</b>"
"<br><b>
$invoice
_total
$default
_currency</b>"
"<br><b>
$quote
_total
$default
_currency</b>"
"<br><b>
$bill
_total
$default
_currency</b>"
"<br><b>
$po
_total
$default
_currency</b>"
}
set
footer0
{
""
""
""
"#align=right <br><b>Total:</b>"
"#align=right <br><b>
$paid
_total_pretty
$default
_currency</b>"
"#align=right <br><b>
$invoice
_total_pretty
$default
_currency</b>"
"#align=right <br><b>
$quote
_total_pretty
$default
_currency</b>"
"#align=right <br><b>
$bill
_total_pretty
$default
_currency</b>"
"#align=right <br><b>
$po
_total_pretty
$default
_currency</b>"
}
# invoice_amount can be empty (null
)
, so let's add
"+0"
,
# which gets translated in a "0" if invoice_amount _is_ ""
...
...
@@ -477,7 +490,25 @@ db_foreach sql $sql {
-cell_class
$class
im_report_update_counters -counters
$counters
set paid_subtotal_pretty
[
lc_numeric
$paid
_subtotal %.$
{
rounding_precision
}
f
$number
_locale
]
set invoice_subtotal_pretty
[
lc_numeric
$invoice
_subtotal %.$
{
rounding_precision
}
f
$number
_locale
]
set quote_subtotal_pretty
[
lc_numeric
$quote
_subtotal %.$
{
rounding_precision
}
f
$number
_locale
]
set bill_subtotal_pretty
[
lc_numeric
$bill
_subtotal %.$
{
rounding_precision
}
f
$number
_locale
]
set po_subtotal_pretty
[
lc_numeric
$po
_subtotal %.$
{
rounding_precision
}
f
$number
_locale
]
set paid_total_pretty
[
lc_numeric
$paid
_total %.$
{
rounding_precision
}
f
$number
_locale
]
set invoice_total_pretty
[
lc_numeric
$invoice
_total %.$
{
rounding_precision
}
f
$number
_locale
]
set quote_total_pretty
[
lc_numeric
$quote
_total %.$
{
rounding_precision
}
f
$number
_locale
]
set bill_total_pretty
[
lc_numeric
$bill
_total %.$
{
rounding_precision
}
f
$number
_locale
]
set po_total_pretty
[
lc_numeric
$po
_total %.$
{
rounding_precision
}
f
$number
_locale
]
set paid_month_total_pretty
[
lc_numeric
$paid
_month_total %.$
{
rounding_precision
}
f
$number
_locale
]
set invoice_month_total_pretty
[
lc_numeric
$invoice
_month_total %.$
{
rounding_precision
}
f
$number
_locale
]
set quote_month_total_pretty
[
lc_numeric
$quote
_month_total %.$
{
rounding_precision
}
f
$number
_locale
]
set bill_month_total_pretty
[
lc_numeric
$bill
_month_total %.$
{
rounding_precision
}
f
$number
_locale
]
set po_month_total_pretty
[
lc_numeric
$po
_month_total %.$
{
rounding_precision
}
f
$number
_locale
]
set last_value_list
[
im_report_render_header
\
-output_format
$output
_format
\
-group_def
$report
_def
\
...
...
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