Calculated Fields: 3% discount for paying in 10 days
We will add two new calculated fields to the invoice template:
1) A date field 10 days after the invoice date
2) Another field giving a 3% off the total
First open up the invoice designer for the template you wish to use:
![](https://i.embed.ly/1/image?url=http%3A%2F%2Fwww.invoiceexpert.com%2Fdocs%2Ftemplate_step1.png&key=16b1a988066d11e191834040d3dc5c07)
![](https://i.embed.ly/1/image?url=https%3A%2F%2Fwww.invoiceexpert.com%2Fdocs%2Ftemplate_step2.png&key=16b1a988066d11e191834040d3dc5c07)
Calculated Field: 10 days after Invoice Date
First click on the field list tab on the right panel of the invoice designer. Then click on any of the fields and begin typing "Invoice_Date" to search. Right click on Invoice_Date and click "Add calculated Field".
![](http://www.invoiceexpert.com/docs/calc1.png)
Now rename the new calculated field by clicking in the (Name) area in the property panel under the field list.
![](http://www.invoiceexpert.com/docs/calc2.png)
Now click the three dots on the right side of the "Expression" property to open up the Expression editor.
Then inside the editor type:
AddDays(Invoice_Date,10)
This will take the Invoice Date field, and add 10 days to that date. Now click OK.
![](http://www.invoiceexpert.com/docs/calc3.png)
Find your calculated field in the field list (remember you can click any field and start typing to search).
Drag your new "ten_days_later" calculated field into the template.
![](http://www.invoiceexpert.com/docs/calc4.png)
Calculated Field: 3% discount on balance due
Click on the BalanceDue field, which holds the total payment at the bottom of the invoice.
![](http://www.invoiceexpert.com/docs/calc6.png)
Now rename the calculated field to "early_discount" in the (Name) property.
![](http://www.invoiceexpert.com/docs/calc7.png)
Click on the expression property and in the expression editor type:
BalanceDue * 0.97
This will take the payment due and take off 3%.
To take off 10% you would type this instead:
BalanceDue * 0.90
![](http://www.invoiceexpert.com/docs/calc8.png)
Now drag your new "early_discount" calculated field into the template.
![](http://www.invoiceexpert.com/docs/calc9.png)
We now create two labels, by dragging a label from the left panel into the template. Repeat this twice.
![](http://www.invoiceexpert.com/docs/calc10.png)
Double click on the label and type in "Pay By: " and "Pay Only: "
You can also change the justification of the label to align to the right.
![](http://www.invoiceexpert.com/docs/calc11.png)
Now we must change the format of the calculated fields so they show up properly.
First click the "ten_days_later" field, click the white arrow then click the three dots by the format string.
![](http://www.invoiceexpert.com/docs/calc12.png)
In the format string editor popup, select the DateTime category on the left, then
select the date format you'd like to see and click OK.
![](http://www.invoiceexpert.com/docs/calc13.png)
Now do the same thing for the "early_discount" field.
![](http://www.invoiceexpert.com/docs/calc14.png)
Change the format to Currency and select "c2" from the standard types.
![](http://www.invoiceexpert.com/docs/calc15.png)
Now save the invoice template:
![](https://i.embed.ly/1/image?url=https%3A%2F%2Fwww.invoiceexpert.com%2Fdocs%2Ftemplate_step5.png&key=16b1a988066d11e191834040d3dc5c07)
Create a new invoice. Make sure the print template matches the template you modified.
![](http://www.invoiceexpert.com/docs/calc16.png)
Here you'll notice that our new fields were printed. Our invoice was due 7/9/2014 but we see that if they pay 10 days later (7/19/2014) they will get a 3% discount on $75.72 which results in only $73.45 being due.
![](http://www.invoiceexpert.com/docs/calc17.png)