Prolab LIS Cloud

Prolab LIS Templates : Quotes

HBS Template Structure

<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <title>Devis</title>
    <style>
        /* CSS styles */
    </style>
</head>
<body>
    {{{quoteHeader}}}
    {{{customerInfo}}}
    
    <table class="params-table">
        <thead>
            <tr>
                <th>Column headers</th>
            </tr>
        </thead>
        <tbody>
            {{{quoteLines}}}
        </tbody>
    {{{quoteSummary}}}
    
    {{{paymentTerms}}}
    {{{notes}}}
    {{{termsAndConditions}}}
    {{{footer}}}
</body>
</html>

JSON Structure

{
  "template": "quote",
  "data": {
    "sectionName": {
      "type": "bloc|collection",
      "template": "HTML with {{variables}}",
      "content": {}
    }
  },
  "outputFormat": "pdf",
  "pageFormat": {
    "format": "A4",
    "margin": { "top": "1.5cm", "right": "1.5cm", "bottom": "1.5cm", "left": "1.5cm" }
  },
  "printOptions": {
    "printBackground": true,
    "displayHeaderFooter": true,
    "margin": { "top": "1.5cm", "right": "1.5cm", "bottom": "1.5cm", "left": "1.5cm" }
  },
  "headerTemplate": "<div>Page header</div>",
  "footerTemplate": "<div>Page <span class='pageNumber'></span> sur <span class='totalPages'></span></div>",
  "css": {
    "additional": ["@page { size: A4; }", "body { font-family: 'Segoe UI'; }"]
  }
}

Section Types

Bloc: Static content block

{
  "type": "bloc",
  "template": "<div>{{variable}}</div>",
  "content": {}
}

Collection: Dynamic list (repeats for each item)

{
  "type": "collection",
  "content": {
    "default_template": "<tr><td>{{variable}}</td></tr>",
    "items": []
  }
}

Variables by Section

quoteHeader

VariableTypeRequired
companyLogoUrlstringYes
companyNamestringYes
companySubtitlestringNo
companyAddressstringYes
companyPhonestringYes
companyEmailstringYes
companyWebsitestringNo
quoteNumberstringYes
quoteDatestringYes
validUntilstringNo

customerInfo

VariableTypeRequired
customerNamestringYes
customerEmailstringYes
customerPhonestringYes
customerAddressstringNo

quoteLines (collection)

VariableTypeRequired
descriptionstringYes
codestringYes
quantitynumber/stringYes
unitPricenumber/stringYes
lineTotalnumber/stringYes
currencySymbolstringYes

quoteSummary

VariableTypeRequired
subtotalnumber/stringNo
totalTaxnumber/stringNo
totalDiscountnumber/stringNo
totalnumber/stringYes
currencySymbolstringYes
totalInWordsFrenchstringNo
totalInWordsEnglishstringNo
validUntilstringNo
paymentTermsstringNo

Note: Use colspan based on table columns:

  • Quote (5 columns): colspan='4'
  • Quote2 (4 columns): colspan='3'

paymentTerms

VariableTypeRequired
checkPayeeNamestringNo
bankNamestringNo
bankAccountNumberstringNo

notes

VariableTypeRequired
notesstringNo

termsAndConditions

VariableTypeRequired
termsAndConditionsstringNo
VariableTypeRequired
footerTextstringNo
validityDaysnumber/stringNo

Template Variants

Quote (quote.json): 5 columns (Description, Code, Quantité, Prix unitaire, Total), colspan=’4′, includes subtotal/tax breakdown

Quote2 (quote2.json): 4 columns (Quantité, Description, Prix unitaire, Total), colspan=’3′, simplified summary (no subtotal/tax rows)

Handlebars Syntax

{{variable}}              // Variable output
{{{section}}}             // Unescaped HTML injection
{{#if variable}}...{{/if}} // Conditional block
{{#if a}}...{{else}}...{{/if}} // If/else