Difference between revisions of "Invoice Module Variables"

From SmartWiki
Jump to: navigation, search
Line 60: Line 60:
 
* '''@tax2@''': Total tax 2 on the invoice (the sum of all the ~tax2~ amounts)  
 
* '''@tax2@''': Total tax 2 on the invoice (the sum of all the ~tax2~ amounts)  
 
* '''@invtotal@''': this is the total amount of the invoice, including both taxes.  
 
* '''@invtotal@''': this is the total amount of the invoice, including both taxes.  
* '''@invnumber@''': this is used to refer to the invoice number if you are using auto-numbering (which can be configured on the Application Configuration page.)
+
* '''@invnumber@''': this is used to refer to the invoice number if you are using auto-numbering (which can be configured on the [[Invoice UTA|Invoice Configuration]] page.)
  
  
 
* '''@invdate@''': display the date of the invoice (by default is the date the invoice is created, but can be changed)
 
* '''@invdate@''': display the date of the invoice (by default is the date the invoice is created, but can be changed)
* '''@statusname@''': display the status of the invoice. (Statuses can be created on the Application Configuration Page)
+
* '''@statusname@''': display the status of the invoice. (Statuses can be created on the [[Invoice UTA|Invoice Configuration]] page.)
  
 
==Example==
 
==Example==

Revision as of 08:10, 23 July 2013

The following variables can be used when creating a Web Page View to generate an Invoice using the Invoicing Module:

Invoice Line Items

Invoice Items refers to the Level 2 or Level 3 items to be billed.

On the Invoice Configuration page, you must first provide the field names of the associated Level 2 or 3 fields so they can be listed as part of the individual line items on the invoice. This is done in the Invoice Item Field Mapping section. The fields are:

  • Item Detail:
  • Item Quantity:
  • Item Amount:
  • Item Tax:
  • Item Tax 2:


For example, the associated fields on the Level 2 or Level 3 entities might be named:

Item Detail: @type@
Item Quantity: @quantity@
Item Amount: @rate@
Item Tax: @GST Amount@
Item Tax 2: @PST Amount@


On the Web Page View you refer to each of these fields using special terminology which allows them to be generated as a list:

  • Item Detail: ~description~
  • Item Quantity: ~qty~
  • Item Amount: ~amount~
  • Item Tax: ~tax~
  • Item Tax 2: ~tax2~

Also:

  • ~fullamount~ is used to display the product of Quantity and Amount
  • ~Index can be used to number the lines (1, 2, 3...)
  • ~Index~ start numbering at 1, ~index~ starts numbering at 0.


If you wish the invoice line items to include fields other than the standard fields (which are Item Detail, Quantity, Amount, Tax and Tax2):

  • Create a Store Value - System Variables field in the Invoice Item Custom Fields section of the Invoice Configuration page which refers to the field name of the Level 2 or 3 field (example: @Product Code@).
    • Hint: You can use the same name for this field (ie: Create a field called Product Code which stores a System Variable called @Product Code@)
  • Within the invoice line item section on the Web Page View you can refer to the field name from the Invoice Item Custom Field section between $’s. (Example: $Product Code$)

NOTE: The field name between the $$ is Case Sensitive.


Invoice Totals

  • @amount@: This is the subtotal, also known as the invoice total before tax (the sum of all ~fullamount~ amounts)
  • @tax@: Total tax 1 on the invoice (the sum of all the ~tax~ amounts)
  • @tax2@: Total tax 2 on the invoice (the sum of all the ~tax2~ amounts)
  • @invtotal@: this is the total amount of the invoice, including both taxes.
  • @invnumber@: this is used to refer to the invoice number if you are using auto-numbering (which can be configured on the Invoice Configuration page.)


  • @invdate@: display the date of the invoice (by default is the date the invoice is created, but can be changed)
  • @statusname@: display the status of the invoice. (Statuses can be created on the Invoice Configuration page.)

Example

The following is a example that would be used on the 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:

<table>
<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=items)

<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> 
    <td><b>Sub-Total:</b></td>
    <td>@amount@</td>
</tr>
<tr> 
    <td><b>Total GST:</b></td>
    <td>@tax@</td>
</tr>
<tr> 
    <td><b>Total PST:</b></td>
    <td>@tax2@</td>
</tr>
<tr> 
    <td><b>Total:</b></td>
    <td>@invtotal@</td>
</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