The aim of this article is to explain where the information displayed in PDF templates comes from, so that you can enter it in the right place in Frisbii objects.
These explanations also allow you to modify the Visualforce page to suit your needs.
In order to keep just the most relevant information here, you won't find any procedures for setting up, but links to Salesforce help or other articles in our knowledge base.
After reading the previous article let's take a look at the fields displayed on the PDF template by sections of the Visualforce page.
The headings in this section reflect the comments you'll find on the Visualforce page.
<!--Footer-->
This is the first part of the Visualforce page, but thanks to CSS it's still in the right place.
<!--Coordonnées de votre entreprise/ Your company's adress-->Information displayed | Frisbii Field | Object | Style | Condition |
Your company name | Name of the corporate name | Corporate name | text-transform: uppercase; | n/a |
Street - Head office | Street | Corporate name | n/a | n/a |
Postal code - Head office | Postal code | Corporate Name | n/a | n/a |
City - Head office | City | Corporate Name | n/a | n/a |
<!--Contact de votre entreprise/ Your companies contact infos-->Information displayed | Frisbii Field | Object | Style | Condition |
Phone number | Phone | Corporate Name | n/a | Only displayed if the field is filled in |
Fax number | Fax | Corporate Name | n/a | Only displayed if the field is filled in |
Email address | Corporate Name | n/a | n/a | |
Company website | Website | Corporate Name | n/a | n/a |
<!--Mentions légales/ Legal notice-->Information displayed | Frisbii Field | Subject | Style | Condition |
Legal form | Legal form | Corporate Name | n/a | n/a |
Share capital | Share capital | Corporate Name | n/a | n/a |
RCS City | RCS City | Corporate Name | n/a | n/a |
SIREN | SIREN | Corporate Name | n/a | n/a |
APE code | NAF / APE | Corporate Name | n/a | n/a |
Intracom. VAT No. | Intracom. VAT No. | Corporate Name | n/a | n/a |
<!--Référence de la Facture - Logo/ Invoice Number - Logo-->
This part represents the header that is displayed on the first and following pages.
Information displayed | Frisbii Field | Object | Style | Condition |
Invoice type | Type | Invoice | text-transform: uppercase; | n/a |
Proforma Mention | Sofacto_Proforma | Custom label | text-transform: uppercase; |
|
Invoice reference | Reference | Invoice | color:#696969; |
|
Invoice name | Name | Invoice | color:#696969; |
|
Sub-Type Credit Note | Sub-Type | Invoice | font-size:13px |
|
Issue date | Sofacto_InvoiceDate | Custom label | {0,date,dd'/'MM'/'yyyy} |
|
Delivery date | Sofacto_DeliveryDate | Custom label | {0,date,dd'/'MM'/'yyyy} |
|
Customer account number | Account number | Account | n/a |
|
Order number | Sofacto_OrderNumber | Custom label | n/a | n/a |
Initial invoice number | Initial invoice | Invoice | n/a |
|
Company logo | Logo | Corporate Name | float:right; |
> in the top right-hand corner on the Corporate Names tab. |
<!--Référence de la Facture - Logo/ Invoice Number - Logo-->
This section only appears if there is no shipping address on the account.
Information displayed | Champ Frisbii | Object | Style | Condition |
Billing address | Sofacto_Address1 | Custom label | text-transform: uppercase; | n/a |
Company name (customer) | Account name | Account | text-transform: uppercase; | n/a |
Contact name | Sofacto_Address2 | Custom label | n/a |
|
Billing street | Billing street | Account | n/a | n/a |
Billing postal code | Billing postal code | Account | n/a | n/a |
Billing city | Billing city | Account | n/a | n/a |
Billing country | Billing country | Account | n/a | n/a |
<!--Adresse de Facturation du Client avec adresse expedition/ Billing address with shipping address-->
This section only appears if there is a shipping address on the account.
<!--Adresse d'expedition/ Shipping Address-->Information displayed | Frisbii Field | Object | Style | Condition |
Shipping address | Sofacto_Address3 | Custom label | text-transform: uppercase; | n/a |
Company name (customer) | Account name | Account | text-transform: uppercase; | n/a |
Contact name | Sofacto_Address2 | Custom label | n/a |
|
Shipping street | Shipping street | Account | n/a | n/a |
Shipping postal code | Shipping postal code | Account | n/a | n/a |
Shipping city | Shipping city | Account | n/a | n/a |
Shipping country | Shipping country | Account | n/a | n/a |
<!--Adresse de facturation/ Billing Address-->Information displayed | Frisbii Field | Object | Style | Condition |
Billing address | Sofacto_Address1 | Custom label | text-transform: uppercase; | n/a |
Company name (customer) | Account name | Account | text-transform: uppercase; | n/a |
Contact name | Sofacto_Address2 | Custom label<0>Contact | n/a |
|
Billing street | Billing street | Account | n/a | n/a |
Billing postal code | Billing postal code | Account | n/a | n/a |
Billing city | Billing city | Account | n/a | n/a |
Billing country | Billing country | Account | n/a | n/a |
<!--Objet de la facture - Commentaire supplémentaire / Invoice Subject - Additional Comments-->Information displayed | Frisbii Field | Object | Style | Condition |
Invoice subject | Object | Invoice | font-size:15px |
|
Additional comments | Comments | Invoice | n/a |
|
<! --Tableau de facturation/ Invoice Table -->A page break is built into this table if a certain line limit is exceeded.
There are two different conditions which are implemented in several places:
a) Condition on the number of lines reported on the second page
Billing table first page
b) Condition for page break and display at bottom of invoice
Important : In order to calculate the number of lines in the Visualforce page code, it is essential to fill in the field Order on invoice lines.
Note: Before putting this template into production, please check how many lines you want to insert the page break for. Depending on the length of the description, the number of lines that fit on a page can vary. We advise you to test your "extreme cases" to identify the number of lines that corresponds to your needs.
<!-- Ligne entête produits/ Table header -->
Information displayed | Frisbii Field | Object | Style | Condition |
Designation | Designation | Invoice Line Item | border-left: hidden; | n/a |
Unit price | Sofacto_UnitPrice | Custom label | border-left: hidden; | n/a |
Quantity | Sofacto_Quantity | Custom label | border-left: hidden; | n/a |
Discount rate | Discount rate | Invoice Line Item | border-left: hidden; | n/a |
Discount amount | Sofacto_Discount | Custom label | border-left: hidden; | n/a |
Milestone | Sofacto_Milestone | Custom label | border-left: hidden; | n/a |
Amount excl. VAT | Sofacto_ExclTaxLine | Custom label | border-left: hidden; | n/a |
VAT rates | Sofacto_VATrate | Custom label | border-left: hidden; | n/a |
<Pour chaque poste de facture/ For each Invoice Line Item -->Reminder: Even if the field is not displayed on the invoice PDF, please fill in the Order fieldon each invoice line. If you leave this field blank, you will receive an error message when creating the PDF.
If you want to change the number of lines before the page break, be sure to change the number in this code snippet:
Caution: Make a note of the number you put in this condition, as you'll need to adapt this number in several places.
Another mechanism displays the second page and the bottom of the invoice according to the number of invoice lines:
<apex:variable var="rowNum" value="{!rowNum + 1}" />By repeating the application of the Visualforce code on the invoice lines (explained in this article: Invoice template - Explanation of the Visualforce Page proposed by Sofacto on GitHub), the rowNum variable defined at the end of this section is incremented. It allows the number of lines to be used for displaying other parts of the invoice.
Information displayed | Frisbii Field | Object | Style | Condition |
Designation | Designation | Invoice Line Item | italic |
|
Detailed description | Detailed description | Invoice Line Item | italic |
|
Unit price | Unit price excl. VAT | Invoice Line Item | n/a | n/a |
Quantity | Quantity | Invoice Line Item | n/a | n/a |
Discount rate | Discount Rate | Invoice Line Item | {0, number, ###.00}% |
|
Discount amount | Discount amount | Invoice Line Item | n/a |
|
Milestone | Percentage | Invoice Line Item | {0, number, ###.00}% |
|
Excl. VAT | Amount excl. VAT | Invoice Line Item | n/a | n/a |
VAT rate | VAT Rate (%) | Invoice Line Item | n/a | n/a |
<!-- Voir page suivante/ See next page -->
This section is displayed from six invoice lines upwards. You can change this number to suit your needs in this code snippet:
Remember that our billing table is displayed on the second page by default, if there are more than 10 invoice lines.
Currently the code considers that :
For 6 or more invoice lines, a second page is required to display the bank details and discount table, as well as the VAT allocation table.
For 10 or more invoice lines, it is necessary to divide the invoice table evenly over the second page.
Information displayed | Frisbii Field | Object | Style | Condition |
See next page | Sofacto_NextPage | Custom label | n/a |
|
<!--Bas de facture/ Invoice Bottom-->
This part is displayed on the second page of the invoice from 6 invoice lines upwards. If you want to change this operation, please change the number in this code snippet:
Be sure to be consistent in the numbers you enter for this variable in the various places on the Visualforce page. It must be the same as the page break and the line indicating the next page.
<!--Tableau Répartition TVA/ VAT Distribution Table -->Information displayed | Frisbii Field | Object | Style | Condition |
VAT breakdown | Sofacto_VAT2 | Custom label | border-left: hidden; | n/a |
VAT rate | Sofacto_VATrate | Custom label | border-left: hidden; | n/a |
VAT amount | Sofacto_VAT | Custom label | border-left: hidden; | n/a |
<!--TVA 20%/ VAT 20%-->Information displayed | Frisbii Field | Object | Style | Condition |
20% | Hard coded | n/a | n/a | TotalVAT20__c > 0 |
VAT rate | Total 20% VAT | Invoice | n/a | TotalVAT20__c > 0 |
<!--TVA 10%/ VAT 10%-->Information displayed | Frisbii Field | Object | Style | Condition |
10% | Hard coded | n/a | n/a | TotalVAT10__c > 0 |
VAT rate | Total 10% VAT | Invoice | n/a | TotalVAT10__c > 0 |
<!--TVA 5.5%/ VAT 5.5%-->Information displayed | Frisbii Field | Object | Style | Condition |
5.5% | Hard coded | n/a | n/a | TotalVAT55__c > 0 |
VAT rate | Total 5.5% VAT | Invoice | n/a | TotalVAT55__c > 0 |
Note: If you want to display other VAT rates in the VAT breakdown table, create the formula fields according to your needs, using the Total VAT 20% template explained at the top of this article.
Next, you need to add another row in the table on the Visualforce page.
You can copy this piece of code, modify it by putting the name of the field in the parts marked in yellow and paste it below the last </tr> of this part <!--TVA 5,5%/ VAT 5,5%--> :
<! --Tableau de Remise / Table of Discounts-->This table displays the footer discount, if the Discount Amount is higher than 0.00€ on the invoice.
Table header
Information displayed | Frisbii Field | Object | Style | Condition |
Footer discount | Sofacto_BottomDiscount | Custom label | font-size:10px; |
|
Reason for discount | Reason for discount | Invoice | font-size:10px; |
|
Discount rate | Discount Rate | Invoice | font-size:10px; | n/a |
Discount amount | Sofacto_Discount | Custom label | font-size:10px; | n/a |
Table body
Information displayed | Frisbii Field | Object | Style | Condition |
Reason for discount | Reason for discount | Invoice | n/a |
|
Discount rate | Discount Rate | Invoice | {0, number, ###.00}% | n/a |
Discount amount | Discount amount | Invoice | n/a | n/a |
<!--Net payable/ Balance due-->Information displayed | Frisbii Field | Object | Style | Condition |
Net payable | Sofacto_IncludingTax | Invoice | font-size:10px | n/a |
Amount incl. VAT | Total incl. VAT | Invoice | color:#696969; | n/a |
<!--Conditions particulières/ Special Conditions-->Information displayed | Frisbii Field | Object | Style | Condition |
Special conditions | Special conditions | Invoice | font-size:10px; |
|
<! --Pénalités en cas de retard/ Penalties in case of delay-->Information displayed | Frisbii Field | Object | Style | Condition |
Penalties for late payment | Penalties for late payment | Corporate Name | font-size:10px; |
|
<!--Indices/ Indexes-->Information displayed | Frisbii Field | Object | Style | Condition |
Price revised according to the formula P1 = P0 x (S1 / S0) | Sofacto_Indexes | Custom label | n/a |
|
S0 = index (Index name) | Index name | Index | n/a | n/a |
Reference Index Date | Reference Index Date | Subscription | n/a | n/a |
Reference index coefficient | Reference index coefficient | Subscription | n/a | n/a |
S1 = Index (Index name) | Index name | Index | n/a | n/a |
Index Date | Index Date | Invoice | n/a | n/a |
Index Coefficient to Date | Index Coefficient to Date | Invoice | n/a | n/a |
<! --Coordonnées bancaires / Bank Information-->This table is displayed if you have checked the box Show bank details on invoice and if bank details are entered in the Other bank details field on the invoice or, failing that, in the Default bank details field on the Corporate name.
Information displayed | Frisbii Field | Object | Style | Condition |
Due date | Due date | Invoice | font-size:9px; | n/a |
Payment method | Payment method | Invoice | font-size:9px; | n/a |
Term of payment | Term of payment | Invoice | font-size:9px; | n/a |
Bank name | Bank | Bank details | font-size:9px; | n/a |
IBAN | IBAN | Bank details | font-size:9px; | n/a |
BIC | BIC | Bank details | font-size:9px; | n/a |
<! --Saut de page 2-->
The page break condition is linked to the number of lines in the billing table.
This is why you also need to modify this condition if you want to adapt the maximum number of lines to your needs.
Update the page break condition here:
Please note The number is the same as the one you set in the display condition at the bottom of the table and the condition in the line that indicates the next page, and not the one you set in the billing table.
The parts that appear as headers on the second page:
Information displayed | Frisbii Field | Object | Style | Condition |
Invoice type | Type | Invoice | text-transform: uppercase; | n/a |
Proforma Mention | Sofacto_Proforma | Custom label | text-transform: uppercase; |
|
Invoice reference | Reference | Invoice | color:#696969; |
|
Invoice name | Name | Invoice | color:#696969; |
|
Sub-Type Credit Note | Sub-Type | Invoice | font-size:13px |
|
Issue date | Sofacto_InvoiceDate | Custom label | {0,date,dd'/'MM'/'yyyy} |
|
Customer account number | Account number | Account | n/a |
|
Order number | Sofacto_OrderNumber | Custom label<0>Invoice | n/a | n/a |
Initial invoice number | Initial invoice | Invoice | n/a |
|
Company logo | Logo | Corporate Name | float:right; |
> in the top right-hand corner on the Corporate Name tab. |
<!--Tableau de Facturation page 2/ Invoice Table 2nd page-->
There are two conditions to take into account for this table. A condition must be placed on the table header, as there is a possibility that the second page will be displayed just with the invoice footers and not to display the second page of the table (if there are not enough rows).
This condition can be found in the <tr> line for the table header:
You must enter <0>the same number as in the billing table on the first page.
Next, repeat this modification for the body of the invoice table.
Finally, the entire bottom of the invoice is taken from the first page:
<!--////////////////////////////////// Page 3//////////////////////////////////-->Firstly, the header on the second page is repeated on the third page as well.
It will only be displayed if the <0>Show payment schedule on invoice box is checked.
<!-- Echéancier / Payment Plan --> The payment schedule is only displayed if you have configured the prerequisites by following these items:
These columns are then displayed in the table on the third page:
Payment date
Amount excl. VAT
VAT amount
Amount incl. VAT
Add fields to thePayment Schedule.
If you want to display more of the fields found on the Payment object, you can copy, for example, this <td> for theheader:
{!$ObjectType.sofactoapp__R_glement__c.Fields.<0>sofactoapp__Montant__c.Label} and copy it just above<0> (Watch out for !).
Next, change the field's API name to the API name of the new field.
The same modification remains to be made for the body of the table:
First, copy this code:
and paste it just above (be careful to </tr> !).
Next, change the field's API name to the API name of the new field.