Do you have a question?

Enter one or more keywords and find the answer!

Creation of an invoice using ODT template


→  Download this guide in PDF formatDownload PDF


IMPORTANT: The file must be in .odt format and not .doc, so the use of word is not recommended. Rather, the use of OpenOffice is highly recommended.

This mini-guide on configuring the school invoice from ODT template, is divided into the following paragraphs:

  1. INTRODUCTION
  2. PLACEHOLDER DEFINITION
  3. PLACEHOLDER LISTS
  4. PLACEHOLDERS IN TABLES
  5. CONDITIONAL BLOCKS
  6. FILTERS
  7. LIST OF AVAILABLE PLACE CARDS
  8. MODEL UPLOAD TO SYSTEM
  9. USE OF THE INVOICE TEMPLATE
  10. EXAMPLE TEMPLATES

1. INTRODUCTION

An ODT invoice template is an odt format file that you upload to management in the Configuration → Contracts & Reports allows you to generate PDF documents containing dynamic information, using an .odt file, called a template, in which appropriate placeholders are inserted, which, in the final generated document, will be replaced by the value indicated by the placeholder.

WARNING: template refers, in the context of this documentation, to a normal .odt file containing placeholders, the file must be in ODF text document format, extension .odt.

Placeholders can be inserted in a normal writing context. They can also be inserted in tables and can be shown with conditional blocks or filters.

2. DEFINITION OF PLACEHOLDERS

La sintassi per definire un segnaposto è {oggetto.attributo}, il nome dell’oggetto è la parte del nome a sinistra del punto, il nome dell’attributo è la parte a destra del punto; quindi, ad esempio, per mostrare nel documento finale il nome del corso si usa {course.name}, per mostrare la sede del corso si usa {location.location}.

If the object name is plural, it means that a list of values will be generated that can be used within a table or to create a list in the final document. In this sense, an appropriate syntax can be used to indicate the beginning and end of the table.

E’ possibile creare dei segnaposti aggiuntivi utilizzando dei campi personalizzati, la sintassi di questi segnaposti è: {oggetto.customfields[codice]}, verrà mostrato il campo personalizzato che ha il codice inserito tra parentesi quadre.

3. LISTS OF VALUES

The syntax for using a list of values, involves indicating where the list begins and where it ends; in the block of text enclosed between the two markers, placeholders are inserted to show the values of each list item, for example, to list the full names and email address of each student in the course:

[! -- BEGIN students --]

{students.fullName} {students.email}

[!-- END students --]

For lists of values there is a special placeholder, the _total placeholder, which returns the total number of elements in the list.

If it becomes necessary to insert two identical lists within the same document, it will be possible to do so by inserting an underscore ( _ ) in the placeholder of the second list

[!-- BEGIN students_ --]

{students_.fullName} {students_.email}

[!-- END students_ --]

4. PLACEHOLDERS IN TABLES

The syntax for using a list of values within a table involves indicating where the table row begins and where it ends; in the block of text enclosed between the two markers, placeholders are inserted to show the values of each item in the list; for example, to list the full names, email address, and mobile phone of each student in the exam, within a table we would need to enter:

[!-- BEGIN row.students --] {students.fullName}
{students.email}
{students.mobile}

[!-- END row.students --]

the table row between [!-- BEGIN row.students --] e [!-- END row.students --] will be repeated for each student, in the document table.

If it becomes necessary to insert two identical lists within the same document, it will be possible to do so by inserting an underscore ( _ ) in the placeholder of the second list

[!-- BEGIN row.students_ --] {students_.fullName}
{students_.email}
{students_.mobile}

[!-- END row.students_ --]

5. CONDITIONAL BLOCKS

The conditional block is a part of the document, delimited by appropriate markers, with which a condition is associated that can be true or false, if true the content of the block is shown in the final document, if false the content of the block is deleted from the final document.

One of the defined custom fields or the conditions given in the CONDITION section of the list of available placeholders can be used as a condition for the block.
The condition using a custom field is true if the field is valorized, it is false if it is empty.

The syntax for defining the conditional block involves stating the beginning and end of the block, indicating the associated condition, e.g., to define a conditional block to be shown only if the order is discounted:

[!-- IF order.isDiscounted --]

Sconto: {order.discount}

[!-- ENDIF order.isDiscounted --]

order.isDiscounted is the condition, if it is true the order is discounted and the discount applied is shown, if it is false the order is not discounted and the discount line will not be included in the final document.

You can reverse the condition check by adding NOT to the syntax to define the conditional block, for example, to define a conditional block to be shown only if the order is not discounted:

[!-- IF NOT order.isDiscounted --]
Discount not applicable.
[!-- ENDIF NOT order.isDiscounted --]

order.isDiscounted is the condition, if it is true the order is discounted and the text "Discount not applicable" will not be shown in the final document, if it is false the order is not discounted and therefore the text "Discount not applicable" will be shown in the final document.

To use a custom field as a condition use the following syntax:

[!-- IF student.customfields[CERTIFICAZIONI] --]
Certifications: {student.customfields[CERTIFICATIONS]}
[!-- ENDIF student.customfields[CERTIFICAZIONI] --]

the row within the block will be shown only the student's certifications have been indicated, that is, if the custom field with code CERTIFICATIONS of the student is not empty.

6. FILTERS

Filters allow an operation to be performed that changes the value of the individual placeholder entered in the document and are available for any type of odt report, regardless of section.

The available filters are as follows:

  • cut allows us to limit the length of a text within the given value, for example to limit the length of the course name to a maximum of 5 characters we can use the placeholder {course.name|cut[5]}
  • daysbefore allows us to compute a date earlier than the date of the valorized placeholder, e.g. if we want to get the date corresponding to 2 weeks before the start of the course we can use the placeholder {course.startDate|daysbefore[14]}
  • daysafter allows us to compute a date later than the date of the valorized placeholder, for example if we want to get the date corresponding to 1 week after the start of the course we can use the placeholder {course.startDate|daysafter[7]}
  • lowercase changes the value of the placeholder to lowercase, for example to show the course name all in lowercase use the placeholder {course.name|lowercase}
  • uppercase changes the value of the placeholder to uppercase, e.g. to show the course name all in uppercase use the placeholder {course.name|uppercase}
  • uppercasefirst changes the value of the placeholder by capitalizing the first letter, e.g. to show the course name with the first letter capitalized use the placeholder {course.name|uppercasefirst}

If two versions of the same placeholder are needed in the document, one filtered and one unfiltered, simply add a _ (underscore) to the second occurrence of the placeholder, e.g., use {course.name|cut[5]} to show the abbreviated course name and {course_.name} to show the full course name later.

7. LIST OF PLACEHOLDERS AVAILABLE FOR INVOICE TEMPLATES.

SIGNAGE
VALUE
NOTES
{recipient.address}
address
{recipient.birthcountry}country of birth
{recipient.birthdate}date of birth
{recipient.birthday}
birthday
{recipient.birthplace}place of birth
{recipient.birthprovince}province of birth
{recipient.branchId}Reference branch name
{recipient.cap}zip code
{recipient.cards}membership card
{recipient.cardnumber}number from the card, if any
{recipient.certifiedEmail}
{recipient.city}city
{recipient.citizenship}citizenship
{recipient.clientCode}addressee code
{recipient.country}country
{recipient.countryCode}country
{recipient.customfields[]}
custom fieldThe custom field code should be indicated between the square brackets
{recipient.email}
email
{recipient.fullName}
call sign
{recipient.gender}
genre
{recipient.id}identifier
{recipient.lastUpdate}
{recipient.passport}passport
{recipient.profession}profession
{recipient.qualification}qualification
{recipient.maritalstatus}marital status
{recipient.mobile}mobile phone
{recipient.mobilePhone}mobile phone
by Invoice template
{recipient.name}
name
{recipient.notes}notes
{recipient.phone}
landline
{recipient.province}
province
{recipient.recipientCode}Recipient code
{recipient.splitPayment}
{recipient.surname}
surname
{recipient.taxcode}
tax code
{recipient.vatnumber}
VAT number
{recipient.type}
recipient.zipCodeZIP CODEby Invoice template
CONDITIONVALUENOTES
recipient.isAdulttrue if the student is of age, false otherwise
recipient.isNotAdulttrue if the student is a minor, false otherwise

Placeholder company order section

Data of the company issuing the invoice. The companies in question are those configured in the management system under Tax Management → Tax Settings
SIGNAGEVALUENOTES
{company.address}address
{company.cap}zip code
{company.city}city
{company.country}country code
{company.countryCode}country iso code
{company.email}email
{company.mobile}mobile phone
{company.name}business name
{company.phone}landline
{company.provinces}provinces
{company.taxcode}tax code
{company.vatnumber}VAT number

Placeholder invoice

SIGNAGEVALUENOTES
{invoice.amount}Total invoice amount
{invoice.branchId}Reference branch name
{invoice.date}Invoice date
{invoice.discount}total invoice discount
{invoice.expiry}Invoice due date
{invoice.netAmount}Net total
{invoice.number}Invoice number
{invoice.remaining}Remaining amount
{invoice.series}Invoice series
{invoice.stampAmount}Stamp amount
{invoice.type}Invoice type(0 => Invoice, 1 => Credit Note)
{invoice.vatAmount}total VAT
{invoice.endDateCoursesList}Course end dates list
{invoice.locationCodeNameCoursesList}Course location code list
{invoice.locationNameCoursesList}List of Course Locations
{invoice.ordersNumberList}List of order numbers
{invoice.studentsFullNameList}List of student names enrolled
Additional invoice information
{invoice.additionalInfoInvoice}Additional electronic invoice information
{invoice.ReferenceNumberLine}ReferenceNumberLine
{invoice.IdDocument}IdDocument
{invoice.Data}Date
{invoice.NumItem}NumItem
{invoice.CodeCommitConvention}CodeCommitConvention
{invoice.CodeCUP}codeCUP
{invoice.CodeCIG}codeCIG

Placeholder items

Invoice details, list
SIGNAGEVALUENOTES
{items.amount}total amount
{items.code}technical code article
{items.description}item description
{items.discount}discount
{items.id}
{items.netAmount}Net Amount
{items.orderCustomFields}Custom field related to the order from which the invoice is derived
{items.quantity}quantity
{items.vatAmount}total VAT
{items.vatDescription}Rate name
{items.vatNotes}Notes aliquot
{items.vatRates}% Rate
{items.internalEndLevel}final internal levelBy Invoice report

If prepared
{items.internalStartLevel}initial internal levelBy Invoice report

If prepared

Placeholders vatrates

Data on amounts grouped by type of VAT
SIGNAGEVALUENOTES
{vatrates.amount}VAT Amount
{vatrates.description}Rate nameConfigurable in Economic Settings - If present stamp can be used in Invoice templates
{vatrates.message}VAT invoice messageConfigurable in Economic Settings - If present stamp can be used in Invoice templates
{vatrates.nature}code nature of VATConfigurable in Economic Settings - If present stamp can be used in Invoice templates
{vatrates.netAmount}Net amount VAT
{vatrates.rate}% VATConfigurable in Economic Settings

placeholder installments invoices section

Invoice section installment payments, list
SIGNAGEVALUENOTES
{installments.amount}Installment amount
{installments.expiry}Installment due date
{installments.paymentmethod}Installment payment method

Placeholder order invoice section

order data invoice section
SIGNAGEVALUENOTES
{order.amount}Order amount
{order.branchId}branch reference
{order.customfields[CODE]}custom order fields
{order.date}date of order
{order.discount}Order discount
{order.downPayment}Advance amount
{order.id}Identifier
{order.number}Order number
{order.operatorName}Operator name that generated the order
{order.type}Order type(enrollment,renewal,transfer,etc.).
{order.year}Order reference year}

Placeholder orders invoice section

order data invoice section, list
SIGNAGEVALUENOTES
{orders.amount}Order amount
{orders.branchId}branch reference
{orders.customfields[CODE]}custom order fields
{orders.date}date of order
{orders.discount}Order discount
{orders.downPayment}Advance amount
{orders.id}Identifier
{orders.number}Order number
{orders.operatorName}Operator name that generated the order
{orders.type}Order type(enrollment,renewal,transfer,etc.).
{orders.year}Order reference year}

Placeholder course order section

course related data order section, placeholder valued only if there is only one course in the order, if there is a course template in the order the data is retrieved from the course template
SIGNAGEVALUENOTES
{course.booksTitleList}textbookseach title is separated by comma from the next, not valued if course model
{course.certificateEndLevel}Certified course arrival level
{course.certificateStartLevel}certified starting level of the course
{course.code}code
{course.cost}cost
{course.costIfInstallments}cost if payment in installmentsValued only if an installment plan is attached to the course/model
{course.customfields[]}custom fieldin square brackets should be the custom field code, valorized only if it is a course, not valorized in case of course template
{course.endDate}end datenot valued if course model
{course.duration}course durationCan be given in hours, lessons, or as a start and end date
{course.enrolledStudents}number of students enrolled
{course.firstInstallmentAmount}first installment amountValued only if an installment plan is attached to the course/model
{course.firstInstallmentDate}first installment due dateValued only if an installment plan is attached to the course/model
{course.firstInstallmentDay}day of the month first installment dueValued only if an installment plan is attached to the course/model
{course.firstInstallmentMonth}month first installment of any installment plan
{course.first installmentMonth}first installment due monthValued only if an installment plan is attached to the course/model
{course.hours}total lecture hours of the course
{course.installmentsNumber}number of installmentsValued only if an installment plan is attached to the course/model
{course.internalEndLevel}Internal arrival level of the course
{course.internalEndLevelDescription}description of the internal arrival level
{course.internalStartLevel}Internal starting level of the course
{course.internalStartLevelDescription}description of the internal level of initiation
{course.lessons}number of lessons
{course.lessonsDuration}lesson duration, set only if regular course, in minutes
{course.lessonsEndTime}final class scheduleValued only if Group course with one class per week. Not valued if course model
{course.lessonsPerWeek}number of lessons per week
{course.lessonsStartTime}initial class scheduleValued only if Group course with one class per week. Not valued if course model
{course.lessonsWeekDay}lessons, day of the weekValued only if Group course with one class per week. Not valued if course model
{course.lessonsWeekSchedule}classes, days of the week and scheduleValued if more than one class per week, not valued if course model
{course.installmentsAdvanceAmount}Amount to be paid to the order in case of installment paymentValued only if an installment plan is attached to the course/model
{course.locationCompleteAddress}full course venue addressnot valued if course model
{course.locationName}course venue namenot valued if course model
{course.model}template name used to create the course
{course.name}name
{course.plannedHours} planned class hours
{course.startDate}start datenot valued if course model
{course.studentsFullNameList}student list, the separator is the comma
{course.subject}subject of studyvalued only if single subject course
{course.subjectAlias}aka subject of studyvalued only if single subject course
{course.teachersFullNameList}teachers' nameseach callsign is separated by comma from the next, not valued if course model
{course.teachingYear}academic yearnot valued if course model
{course.fundName}linked fundValued only if present for Invoice templates
{course.locationCode}venue codeValued only if present for Invoice templates

Courses placeholders order section

course data order section, if course templates are present in the order the data are retrieved from the course templates, list
SIGNAGEVALUENOTES
{courses.booksTitleList}textbookseach title is separated by comma from the next, not valued if course model, not valued if course model
{courses.certificateEndLevel}Certified course arrival level
{courses.certificateStartLevel}certified starting level of the course
{courses.code}code
{courses.cost}cost
{courses.costIfInstallments}cost if payment in installmentsValued only if an installment plan is attached to the course/model
{courses.customfields[]}custom fieldin square brackets should be the custom field code, valorized only if it is a course, not valorized in case of course template
{course.duration}course durationCan be given in hours, lessons, or as a start and end date
{courses.endDate}end datenot valued if course model
{course.enrolledStudents}number of students enrolled
{courses.firstInstallmentAmount}first installment amountValued only if an installment plan is attached to the course/model
{courses.firstInstallmentDate}first installment due dateValued only if an installment plan is attached to the course/model
{courses.firstInstallmentDay}day of the month first installment dueValued only if an installment plan is attached to the course/model
{courses.first installmentMonth}first installment due monthValued only if an installment plan is attached to the course/model
{courses.hours}total lecture hours of the course
{courses.installmentsAdvanceAmount}Amount to be paid to the order in case of installment paymentValued only if an installment plan is attached to the course/model
{courses.installmentsNumber}number of installmentsValued only if an installment plan is attached to the course/model
{course.internalEndLevel}Internal arrival level of the course
{course.internalEndLevelDescription}description of the internal arrival level
{course.internalStartLevel}Internal starting level of the course
{course.internalStartLevelDescription}description of the internal level of initiation
{courses.lessons}number of lessons
{course.lessonsDuration}lesson duration, set only if regular course, in minutes
{courses.lessonsEndTime}final class schedulevalued only if one class per week, not valued if course model
{courses.lessonsStartTime}initial class schedulevalued only if one class per week, not valued if course model
{course.lessonsPerWeek}number of lessons per week
{course.lessonsStartTime}initial class scheduleValued only if Group course with one class per week. Not valued if course model
{courses.lessonsWeekDay}lessons, day of the weekvalued only if one class per week, not valued if course model
{courses.lessonsWeekSchedule}classes, days of the week and scheduleValued if more than one class per week, not valued if course model
{courses.locationCompleteAddress}full course venue addressnot valued if course model
{courses.locationName}course venue namenot valued if course model
{course.model}template name used to create the course
{courses.name}name
{course.plannedHours} planned class hours
{courses.startDate}start datenot valued if course model
{course.studentsFullNameList}student list, the separator is the comma
{courses.subject}subject of studyvalued only if single subject course
{courses.subjectAlias}Aliases subject of studyvalued only if single subject course
{courses._position}position of the item in the list
{courses.teachersFullNameList}teachers' nameseach callsign is separated by comma from the next, not valued if course model
{courses._total}Total number of items in the list
{course.teachingYear}academic yearnot valued if course model

Placeholder student order section

order section student data, valued only if there is only one student in the order
SIGNAGE
VALUE
NOTES
{student.address}
address
{student.birthcountry}country of birth
{student.birthdate}date of birth
{student.birthday}
birthday
{student.birthplace}place of birth
{student.birthprovince}province of birth
{student.branchId}Reference branch name
{student.cap}zip code
{student.cardnumber}Student ID number
{student.certifiedEmail}
{student.city}city
{student.country}country
{student.countryCode}country iso code
{student.citizenship}citizenship
{student.customfields[]}
custom fieldThe custom field code should be indicated between the square brackets
{student.email}
email
{student.fullName}
call sign
{student.gender}
genre
{student.id}
identifier
{student.invoiceDataAddress}Address (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataCity}City (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataCountry}Country (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataEmail}Email (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataFiscalCode}Tax code (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataMobilePhone}Mobile phone(billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataName}Name/Company (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataPec}PEC (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataPhone}Landline phone (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataProvince}Province (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataRecipientCode}Recipient code (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataVatNumber}VAT number (billing)Valued in case the master data includes billing data other than residence data
{student.invoiceDataZipCode}ZIP code (billing)Valued in case the master data includes billing data other than residence data
{student.lastUpdate}latest change to master data
{student.maritalstatus}marital status
{student.mobile}mobile phone
{student.name}
name
{student.pec}certified e-mail address
{student.phone}
landline
{student.province}
province
{student.passport}passport
{student.profession}profession
{student.qualification}qualification
{student.recipientCode}addressee code
{student.studLocation}Reference site
{student.surname}
surname
{student.taxcode}
tax code
{student.vatnumber}
VAT number
CONDITIONVALUENOTES
student.isAdult
true if the student is of age, false otherwise
student.isNotAdult
true if the student is a minor, false otherwise
{student.notes}notes
{student.zipCode{CAPper modello Fatture

Segnaposto students sezione ordini

dati degli studenti dell'ordine sezione ordini, lista
SEGNAPOSTO
VALORE
NOTE
{students.abilities[]}skill achievedThe ability code should be indicated in square brackets
{students.address}
address
{students.birthcountry}country of birth
{students.birthdate}date of birth
{students.birthday}
birthday
{students.birthplace}place of birth
{students.birthprovince}province of birth
{students.branchId}Reference branch name
{students.cap}zip code
{students.cardnumber}Card number
{students.certifiedEmail}
{students.city}city
{students.citizenship}citizenship
{students.country}country
{students.countryCode}country iso code
{students.customfields[]}
custom fieldThe custom field code should be indicated between the square brackets
{students.email}
email
{students.fullName}
call sign
{students.gender}
genre
{students.id}
identifier
{students.invoiceDataAddress}address (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataCity}city (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataCountry}Country (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataEmail}Email (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataFiscalCode}Tax code (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataMobilePhone}Mobile number (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataName}Name/Company (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataPec}Pec (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataPhone}landline phone (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataProvince}Province (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataRecipientCode}Recipient code (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataVatNumber}VAT number (billing)Valued in case the master data includes billing data other than residence data
{students.invoiceDataZipCode}ZIP code (billing)Valued in case the master data includes billing data other than residence data
{students.lastUpdate}
{students.maritalstatus}marital status
{students.mobile}mobile phone
{students.name}
name
{students.notes}notes field
{students.passport}passport
{students.pec}certified e-mail address
{students.phone}
landline
{students._position}position of the item in the list
{students.profession}profession
{students.province}
province
{students.qualification}qualification
{students.recipientCode}addressee code
{students.splitPayment}
{students.studLocation}Reference site
{students.surname}
surname
{students.taxcode}
tax code
{students._total}total number of items in the list
{students.vatnumber}
VAT number
CONDITIONVALUENOTES
students.isAdult
true if the student is of age, false otherwise
students.isNotAdult
true if the student is a minor, false otherwise

8. UPLOADING THE INVOICE TEMPLATE TO THE SYSTEM

To enter the invoice template into the system navigate to Configuration → Reports and click the "Add Report".
From the next screen fill in the following fields:

  • Name*: the name of the report (e.g. "Custom Invoice", "Company Invoice 1", "Custom Invoice", etc.)
  • Description: possible description of the invoice template
  • Report type: from template odt
  • Section in which to show the report *: Invoices
  • Template extension: OpenOffice Write (.odt)
  • Report template: upload the contract template in ODT format.
  • Select type: select the type of file extension that the contract should have when downloading or sending to the client, being able to choose from:
    • OpenOffice Write (.odt)
    • Portable Document Format (.pdf)
  • Order *: the order in which the reports are listed (e.g. 1, 2, 3, etc.)

Click the "Add report" to save the operation.

After uploading the template, go into editing the template (by clicking the icon with the edit stick) and check the "Enabled" to enable the export of the report from the courses and click one of the two buttons at the bottom of the page to save the operation.

Finally, click the icon on the row of the uploaded template, to enable administrative accounts that will be able to use the entered template.

9. USE OF THE INVOICE TEMPLATE

Entering the section Tax Management → Tax Settings and in editing one of the companies it will be possible to choose the loaded model as the default.

With this operation at the time the pdf of the invoices will be downloaded in the section Tax Management → Invoices / Credit Notes. the custom template will be shown as the default in the drop-down menu.

10. EXAMPLE MODEL

Leave a comment

You must be logged in to leave a comment.