This manual is deprecated. Please visit https://groupoffice.readthedocs.io for the latest documentation.

Project PDF templates

From Group-Office Groupware and CRM Documentation
Jump to: navigation, search

To customize reports in the projects module go to:

Projects → Administration → Report templates → Template → Pages

Doubleclick a page to edit or add one.

You can simply type text in the page and add smart tags by clicking on a tag at the right pane. Custom fields for the project or report template may also be used. You could add for example:

The project we are reporting here is called {name} and started at {start_time|from_unixdate}.

All the tags from the panel on the right come from the project or report template. The |from_unixtime modifier converts the database timestamp to a readable date.

Tag modifiers

The following modifiers are available:

You can add paramters like this:

{var|from_unixtime:0}

Tagname Parameters Description
from_unixtime bool with time or just the date Convert unix timestamp to date
Number int decimals Format a number from the database

You can also use simple math in tags:

{var*60|number:1}

Getting totals

In a lot of cases you want to sum up expenses, hours etc. You can do this with the {totalize} tag.

{totalize fields="period_expenses,total_expenses,total_count,period_count" templates="Project, Travel costs"}

The fields can have a number of field names that will be avialble as tags after the totalize tags. The example above will calcualte the total expenses and total count of projects with template name “Project” or “Travel costs”. The templates attribute is not mandatory. If you omit it it will calculate it for all project templates. The new tags that will be available are {period_expenses}, {total_expenses} etc.

The fields that are available for the totalize tags are:

period_expenses Calculates the total expenses for the reporting period
total_expenses Calclates the total expenses for all time
total_count Calculates the total number of projects for the reporting period
period_count Calclates the total expenses for all time

You can also do the same for custom fields. This works in the same way as the totalize tags:

{totalize_customfields fields="col_76,col_78" templates=""}

This will create {total_col_76} and {period_col_76}. The custom field database names can be looked up at the custom fields module or inserted with the panel on the right.

HTML markup

You can use simple HTML markup within {html}{/html} tags.

For example:

{html}
<table border="0" cellpadding="2">
<tr>
<td colspan="2">
<span style="color:#7da541;font-size:12px">Project information<br /></span>
</td>
</tr>
<tr>
<td width="70">Name:</td>
<td>{path}</td>
</tr>
<tr>
<td width="70">Status:</td>
<td>{status_name}</td>
</tr>
<tr>
<td width="70">Starts:</td>
<td>{start_time|from_unixtime:0}</td>
</tr>
<tr>
<td width="70">Ends:</td>
<td>{due_time|from_unixtime:0}</td>
</tr>
<tr>
<td width="70">
Description:</td>
<td>
{description|to_html}
</td>
</tr>
</table>

<br /><br />
{/html}

Dividing pages into columns

You can devide pages into column using the "col" tag. It takes a percentage number for the width:

{col width="50"}

...

{col width="50"}

...

{col width="100"}

This column will move to the next line automatically and will take up the full width again.

Special tables

Group-Office can draw some special tables with data from the database. You can use any field from the database and custom fields as wel like col_1 (lookup the dataname in the customfields module).

With Events, Tasks and Notes you can also filter the results on any field with an attibute:

{htmltable type="notes" filter="name=test" border="1" cellpadding="2"}

Or with filter by more then one field and on a custom field:

{htmltable type="notes" filter="col_1=test|name=test" border="1" cellpadding="2"}

Here are some examples:

Comments

{htmltable type="comments" border="0" cellpadding="2"}
{thead}
<tr><td colspan="2"><span style="color:#7da541;font-size:12px">Comments</span></td>
</tr>
{/thead}
{row}
<tr>
<td>{user_name} wrote on {ctime|from_unixdate}: <em>{comments|to_html}</em></td>
</tr>
{/row}
{/htmltable}

Tasks

{html}
<br /><br />
<span style="color:#7da541;font-size:12px">Tasks</span><br />
{/html}
{htmltable type="tasks" due_in_period="0" completed="0" border="1" cellpadding="2"}
{thead}
<tr>
<td>Name</td>
<td>Due at</td>
</tr>
{/thead}
{row}
<tr>
<td><em>{name}</em></td>
<td><em>{due_time|from_unixdate}</em></td>
</tr>
{/row}
{/htmltable}


Notes

{html}
<br /><br />
<span style="color:#7da541;font-size:12px;">Notes</span><br />
{/html}
{htmltable type="notes" border="1" cellpadding="2"}
{thead}
<tr>
<td>Name</td>
<td>Content</td>
</tr>
{/thead}
{row}
<tr>
<td><em>{name}</em></td>
<td><em>{content}</em></td>
</tr>
{/row}
{norows}
<tr>
<td colspan="2">No events were found</td>
</tr>
{/norows}
{/htmltable}


Events

{html}
<br /><br />
<span style="color:#7da541;font-size:12px;">Events</span><br />
{/html}
{htmltable type="events" filter="name=test" occur_in_period="0" border="1" cellpadding="2"}
{thead}
<tr>
<td>Name</td>
<td>Starts at</td>
</tr>
{/thead}
{row}
<tr>
<td><em>{name}</em></td>
<td><em>{start_time|from_unixdate}</em></td>
</tr>
{/row}
{norows}
<tr>
<td colspan="2">No events were found</td>
</tr>
{/norows}
{/htmltable}

timeregistration

Totals only

{font size="8" line-height-ratio="1.5"}

{totalize fields="period_hours"}

{math sum="period_hours_amount / period_hours_units" assign="fee"}

{html}
<br />
<table width="200">
<tr>
<td>Total amount:</td><td>€ {period_hours_amount|number}</td>
</tr>
<tr>
<td>Total units:</td><td>{period_hours_units}</td>
</tr>
<tr>
<td>Amount per unit:</td><td>€ {fee|number}</td>
</tr>
</table>

<br />
{/html}

{html}
<span style="color:#7da541;font-size:12px">Hours per project<br /></span
{/html}
{htmltable type="hours_by_project" border="1" width="700" cellpadding="2"}
{thead}
<tr style="font-weight:bold;">
<td width="100">Project</td>
<td colspan="3">Total</td>
</tr>
<tr>
<td width="100"></td>
<td>D</td>
<td>U</td>
<td>€</td>
</tr>
{/thead}

{row}
<tr nobr="true">
<td width="100">{path}</td>
<td align="right">{units|number:0}</td>
<td align="right">{amount|number:0}</td>
<td align="right">{days|number:0}</td>
</tr>
{/row}

{sum}
<tr nobr="true" style="font-weight:bold">
<td width="100">Total:</td>
<td align="right">{total_units|number:0}</td>
<td align="right">{total_amount|number:0}</td>
<td align="right">{total_days|number:0}</td>
</tr>
{/sum}

{/htmltable}

{html}
<span style="color:#7da541;font-size:12px"><br />Hours per user<br /></span>
{/html}


{htmltable type="hours_by_user" border="1" width="700" cellpadding="2"}
{thead}
<tr style="font-weight:bold;">
<td width="100">User</td>
<td colspan="3">Total</td>
</tr>
<tr>
<td width="100"></td>
<td>D</td>
<td>U</td>
<td>€</td>
</tr>
{/thead}

{row}
<tr nobr="true">
<td width="100">{user_name}</td>
<td align="right">{units|number:0}</td>
<td align="right">{amount|number:0}</td>
<td align="right">{days|number:0}</td>
</tr>
{/row}

{sum}
<tr nobr="true" style="font-weight:bold">
<td width="100">Total:</td>
<td align="right">{total_units|number:0}</td>
<td align="right">{total_amount|number:0}</td>
<td align="right">{total_days|number:0}</td>
</tr>
{/sum}

{/htmltable}


Totals with months

{font size="8" line-height-ratio="1.5"}

{totalize fields="period_hours"}

{math sum="period_hours_amount / period_hours_units" assign="fee"}

{html}
<br />
<table width="200">
<tr>
<td>Total amount:</td><td>€ {period_hours_amount|number}</td>
</tr>
<tr>
<td>Total units:</td><td>{period_hours_units}</td>
</tr>
<tr>
<td>Amount per unit:</td><td>€ {fee|number}</td>
</tr>
</table>

<br />
{/html}

{html}
<span style="color:#7da541;font-size:12px">Hours per project<br /></span
{/html}
{htmltable type="hours_by_project" border="1" width="700" cellpadding="2"}
{thead}
<tr style="font-weight:bold;">
<td width="100">Project</td>
{monthcol}<td colspan="3">{month}</td>{/monthcol}
<td colspan="3">Total</td>
</tr>
<tr>
<td width="100"></td>
{monthcol}<td>D</td><td>U</td><td>€</td>{/monthcol}
<td>D</td>
<td>U</td>
<td>€</td>
</tr>
{/thead}

{row}
<tr nobr="true">
<td width="100">{path}</td>
{monthcol}<td align="right">{days|number:0}</td>
<td align="right">{units|number:0}</td>
<td align="right">{amount|number:0}</td>{/monthcol}
<td align="right">{days|number:0}</td>
<td align="right">{units|number:0}</td>
<td align="right">{amount|number:0}</td>
</tr>
{/row}

{sum}
<tr nobr="true" style="font-weight:bold">
<td width="100">Total:</td>
{monthcol}<td align="right">{total_days|number:0}</td>
<td align="right">{total_units|number:0}</td>
<td align="right">{total_amount|number:0}</td>{/monthcol}
<td align="right">{total_days|number:0}</td>
<td align="right">{total_units|number:0}</td>
<td align="right">{total_amount|number:0}</td>
</tr>
{/sum}

{/htmltable}

{html}
<span style="color:#7da541;font-size:12px"><br />Hours per user<br /></span>
{/html}


{htmltable type="hours_by_user" border="1" width="700" cellpadding="2"}
{thead}
<tr style="font-weight:bold;">
<td width="100">User</td>
{monthcol}<td colspan="3">{month}</td>{/monthcol}
<td colspan="3">Total</td>
</tr>
<tr>
<td width="100"></td>
{monthcol}<td>D</td><td>U</td><td>€</td>{/monthcol}
<td>D</td>
<td>U</td>
<td>€</td>
</tr>
{/thead}

{row}
<tr nobr="true">
<td width="100">{user_name},{user_id}</td>
{monthcol}<td align="right">{days|number:0}</td>
<td align="right">{units|number:0}</td>
<td align="right">{amount|number:0}</td>{/monthcol}
<td align="right">{days|number:0}</td>
<td align="right">{units|number:0}</td>
<td align="right">{amount|number:0}</td>
</tr>
{/row}

{sum}
<tr nobr="true" style="font-weight:bold">
<td width="100">Total:</td>
{monthcol}<td align="right">{total_days|number:0}</td>
<td align="right">{total_units|number:0}</td>
<td align="right">{total_amount|number:0}</td>{/monthcol}
<td align="right">{total_days|number:0}</td>
<td align="right">{total_units|number:0}</td>
<td align="right">{total_amount|number:0}</td>
</tr>
{/sum}

{/htmltable}

All project information example

{html}
<table border="0" cellpadding="2">
<tr>
<td colspan="2">
<span style="color:#7da541;font-size:12px">Project information<br /></span>
</td>
</tr>
<tr>
<td width="70">Name:</td>
<td>{path}</td>
</tr>
<tr>
<td width="70">Status:</td>
<td>{status_name}</td>
</tr>
<tr>
<td width="70">Starts:</td>
<td>{start_time|from_unixtime:0}</td>
</tr>
<tr>
<td width="70">Ends:</td>
<td>{due_time|from_unixtime:0}</td>
</tr>
<tr>
<td width="70">
Description:</td>
<td>
{description|to_html}
</td>
</tr>
</table>

<br /><br />
{/html}


{htmltable type="comments" border="0" cellpadding="2"}
{thead}
<tr><td colspan="2"><span style="color:#7da541;font-size:12px">Comments</span></td>
</tr>
{/thead}
{row}
<tr>
<td>{user_name} wrote on {ctime|from_unixdate}: <em>{comments|to_html}</em></td>
</tr>
{/row}
{/htmltable}

{html}
<br /><br />
<span style="color:#7da541;font-size:12px">Tasks</span><br />
{/html}
{htmltable type="tasks" due_in_period="false" complete="0" border="1" cellpadding="2"}
{thead}
<tr>
<td>Name</td>
<td>Due at</td>
</tr>
{/thead}
{row}
<tr>
<td><em>{name}</em></td>
<td><em>{due_time|from_unixdate}</em></td>
</tr>
{/row}
{/htmltable}


{html}
<br /><br />
<span style="color:#7da541;font-size:12px">Timeregistration</span><br />
{/html}

{htmltable type="detailed_hours_per_user" border="1" cellpadding="2" width="535"}
{thead}
<tr style="font-weight:bold;">
<td width="100">Employee:</td>
<td colspan="2" width="435">{user_name}</td>
</tr>
<tr>
<td width="100">Date</td>
<td width="235">Description</td>
<td width="100">Minutes</td>
<td width="100">Amount</td>
</tr>
{/thead}

{row}
<tr nobr="true">
<td width="100">{date|from_unixtime:0}</td>
<td width="235">{comments}</td>
<td align="right" width="100">{units*60|number:2}</td>
<td align="right" width="100">{amount|number:2}</td>
</tr>
{/row}

{sum}
<tr nobr="true" style="font-weight:bold">
<td colspan="2" width="335">Total:</td>
<td align="right" width="100">{total_units|number:2}</td>
<td align="right" width="100">{total_amount|number:2}</td>
</tr>
{/sum}

{/htmltable}

Detailed hours

{html}
<table width="450"><tr><td>
<p>
<br /><br /><br />
Datum: {date}
Project id: {id}
</p>
<p>
Hours for period {cr_start_time|from_unixdate} t/m {cr_end_time|from_unixdate} for project {path}.
</p>
<br />
</td></tr></table>
{/html}

{htmltable type="detailed_hours" border="0" cellpadding="3" cellspacing="0" width="450"}
{thead}
<tr>
<td style="border-bottom:1px solid black" width="13%">Date</td>
<td style="border-bottom:1px solid black" width="60%">Employee/description</td>
<td style="border-bottom:1px solid black" width="9%">Time</td>
<td style="border-bottom:1px solid black" width="9%">Fee</td>
<td style="border-bottom:1px solid black" width="9%">Amount</td>
</tr>
{/thead}

{row}
<tr nobr="true">
<td width="13%" ><b>{date|from_unixtime:0}</b></td>
<td width="60%"><b>{user_name}</b><br />{comments}</td>
<td width="9%">{units|number:2}</td>
<td width="9%">{ext_fee_value|number:2}</td>
<td width="9%">{total_ext_fee|number:2}</td>
</tr>
{/row}

{sum}
<tr nobr="true">
<td width="73%" colspan="2">Total time</td>
<td width="9%" style="border-top:1px solid black">{total_units|number:2}</td>
<td width="9%"></td>
<td width="9%" style="border-top:1px solid black"></td>
</tr>
<tr nobr="true">
<td width="73%" colspan="2">Totaal fee</td>
<td width="9%"></td>
<td width="9%"></td>
<td width="9%">{total_total_ext_fee|number:2}</td>
</tr>
{/sum}


{/htmltable}