Quote Automation
Generate PDF Invoices with Carbone
- Template type document docx simple
- Carbone min. v5.0.0+
- Features table loop attached files
- Target quote contract custom
Objectives
Generate quotes with the following features:
- Attach a file to the end of the generated document
- Basic calculations
Solution
Once the invoice template is ready, follow these steps to attach a file to the end of the generated document with Carbone:
appendFile formatter
Use the :appendFile formatter to attach a file using its url :
Example :
{d.products[i].datasheet:appendFile}
Computations
Use formatters to perform simple mathematical operations. For example, to calculate a subtotal from quantities and unit prices, use the :mul formatter:
{d.products[i].quantity:mul(.price)}
Use the :aggSum formatter to calculate the total sum:
{d.products[].quantity:mul(.price):aggSum}
Use the :formatC formatter in each Carbone tag that displays a price:
{d.products[i].quantity:mul(.price):formatC}
Store calculations in a variable using the :set formatter:
{d.products[].quantity:mul(.price):aggSum:set(c.subtotal)}
, so you can to use it later:{c.taxes:add(.subtotal):formatC}
And there you go!
You might also like
Trusted by 600+ paid customers in 40+ countries














