Difference between revisions of "Timesheet Variables"

From SmartWiki
Jump to: navigation, search
(Syntax)
(Example)
Line 17: Line 17:
  
 
==Example==
 
==Example==
The following is a example that would be used on the [[Web Page View Field|Web Page View]] to create a table listing all the items for the invoice, as well as the Subtotal, Total GST, PST and Invoice Total:
+
The following are examples that could be used on a {{WPV}} to create a table listing timesheet items:
  
<pre>
+
<pre style="white-space: pre-wrap;  white-space: -moz-pre-wrap;  white-space: -pre-wrap;  white-space: -o-pre-wrap;  word-wrap: break-word;"><table cellspacing=0 cellpadding=2 border=1>
<table>
+
 
<tr>
+
<tr><th>Staff</th><th>Details</th><th>Date</th><th>Effort</th><th>Status</th><th>Billable</th><th>Billed</th></tr>
  <td>Product Code</td>  
 
  <td>Item Description</td>  
 
  <td>Quantity</td>  
 
  <td>Unit Cost</td>
 
  <td>Total Cost</td>
 
  <td>GST</td>
 
  <td>PST</td>
 
</tr>
 
  
<form name=frmsubact>
+
[#(?object=timesheet;orderby=actiondate)
[#(?object=items)
 
  
<tr>
+
<tr><td nowrap>~username~</td><td>~itemdescription~</td><td>~actiondate~</td><td>~totalhours~</td><td>~status~</td><td>~billable~</td><td>~if(tsinvoiceid>0,'Yes','No') as billed~</td></tr>
  <td>$Product Code$</td>  
 
  <td>~description~</td>  
 
  <td> ~qty~ </td>  
 
  <td> ~amount~ </td>
 
  <td> ~fullamount~ </td>
 
  <td> ~tax~ </td>
 
  <td> ~tax2~ </td>
 
</tr>
 
  
 
#]
 
#]
</form>
 
  
<tr>  
+
</table>
    <td><b>Sub-Total:</b></td>
+
 
    <td>@amount@</td>
+
<table cellspacing=0 cellpadding=2 border=0>
</tr>
+
 
<tr>  
+
<tr><th>Billable Hours</th><th>Not Billable Hours</th><th>Billed Hours</th><th>Unbilled Hours</th></tr>
    <td><b>Total GST:</b></td>
+
 
    <td>@tax@</td>
+
<tr><th> [#(?object=timesheet;criteria=isagainstjob=1;groupfunction=sum)~totalhours~#]</th>
</tr>
+
 
<tr>
+
<th> [#(?object=timesheet;criteria=isagainstjob=0;groupfunction=sum)~totalhours~#]</th>
    <td><b>Total PST:</b></td>
 
    <td>@tax2@</td>
 
</tr>
 
<tr>  
 
    <td><b>Total:</b></td>
 
    <td>@invtotal@</td>
 
</tr>
 
  
</table>
+
<th> [#(?object=timesheet;criteria=tsinvoiceid>0 and isagainstjob=1;groupfunction=sum)~totalhours~#]</th>
</pre>
 
  
 +
<th> [#(?object=timesheet;criteria=tsinvoiceid=0 and isagainstjob=1;groupfunction=sum)~totalhours~#]</th>
  
The code between the '''[#(?object=items)''' and closing '''#]''' will be repeated for each line item to be included on the invoice.
+
</tr>
  
 +
</table></pre>
  
 +
The code between the '''[#(?object=items)''' and closing '''#]''' will be repeated for each line item to be included on the invoice.
  
 
==See Also==
 
==See Also==

Revision as of 13:21, 24 July 2014

The following variables can be used when creating a Web Page View or in other custom fields when referencing Timesheets: On the Web Page View you can refer to each Timesheet field using special terminology which allows them to be generated as a list:

Syntax

[#(?object=timesheet)~variablename~#]

where variablename is one of:

  • Date: ~actiondate~
  • User: ~username~
  • Status: ~status~
  • Client: ~client~
  • Project: ~project~
  • Duration: ~totalhours~
  • Billable: ~billable~
  • Notes: ~itemdescription~

Example

The following are examples that could be used on a Web Page View to create a table listing timesheet items:

<table cellspacing=0 cellpadding=2 border=1>

<tr><th>Staff</th><th>Details</th><th>Date</th><th>Effort</th><th>Status</th><th>Billable</th><th>Billed</th></tr>

[#(?object=timesheet;orderby=actiondate)

<tr><td nowrap>~username~</td><td>~itemdescription~</td><td>~actiondate~</td><td>~totalhours~</td><td>~status~</td><td>~billable~</td><td>~if(tsinvoiceid>0,'Yes','No') as billed~</td></tr>

#]

</table>

<table cellspacing=0 cellpadding=2 border=0>

<tr><th>Billable Hours</th><th>Not Billable Hours</th><th>Billed Hours</th><th>Unbilled Hours</th></tr>

<tr><th> [#(?object=timesheet;criteria=isagainstjob=1;groupfunction=sum)~totalhours~#]</th>

<th> [#(?object=timesheet;criteria=isagainstjob=0;groupfunction=sum)~totalhours~#]</th>

<th> [#(?object=timesheet;criteria=tsinvoiceid>0 and isagainstjob=1;groupfunction=sum)~totalhours~#]</th>

<th> [#(?object=timesheet;criteria=tsinvoiceid=0 and isagainstjob=1;groupfunction=sum)~totalhours~#]</th>

</tr>

</table>

The code between the [#(?object=items) and closing #] will be repeated for each line item to be included on the invoice.

See Also