Helpers
Helpers are used in blocks, e.g. {{#if productProductId}} ... {{/if}} is a helper that is used to conditionally show a block of text/html.
- availableHelpers: outputs list of available helpers
- blockHelperMissing
- commaList: outputs a properly encoded HTML list of the arguments passed. Given a product with id “10000” and description “product description”, {{#commaList productProductId productDescription}}{{/commaList}} will output “10000, product description”
- convertNewlineToHTML: Will properly encode line breaks for reports (order notes field)
- dataTableHeader: This section will appear above every data table
- dataTableOptions: Unused
- dateFormat: Formats a date by default as “Month date, year”. Accepts multiple arguments to change the format
- First argument: date to be printed. Can be a variable in the format “MM/DD/YYYY”
- Second argument: one of three locales “en”, “en-gb”, or “en-ca”, OR one of the following output formats:
- ‘M/D/YYYY’
- ‘MM/DD/YYYY’
- ‘MMM D, YYYY’
- ‘YYYY-MM-DD’
- ‘YYYY-M-D’
- ‘YYYY MMM D’
- ‘YYYY MMMM D’
- ‘DD/MM/YYYY’
- ‘DD.MM.YYYY’
- ‘D.M.YYYY’
- ‘D MMM YYYY’
- ‘D. MMM YYYY’
- ‘D MMMM YYYY’
- ‘D. MMMM YYYY’
- Third argument: If the second argument is a locale, then the third argument can be “short”, which will change the format to a numeric representation of the date
- Examples:
- {{dateFormat}} ==> “May 8, 2020” (todays date in this format)
- {{dateFormat printDate}} ==> “May 8, 2020” (print date in this format)
- {{dateFormat printDate "en-gb"}} ==> “8 May 2020”
- {{dateFormat printDate "D. MMMM YYYY"}} ==> “8. May 2020”
- {{dateFormat printDate "en-ca" "short"}} ==> “2020-05-08”
-
timeFormat: works just as "Format", but applied to time:
- The following formats are supported: ['HH:mm','H:mm','hh:mm a', 'hh:mm A', 'h:mm a', 'h:mm A', 'HHmm']. (H is 24 hours, h is 12 hours)
- The following locales are supported: ['en', 'en-gb', 'en-ca']
You can pass one argument which is a locale or a format. If no argument is passed, the default locale is used.
Examples:
- {{printTime}} --> 6:54 AM
- {{timeFormat printTime "en-gb"}} --> 06:54
- {{timeFormat printTime "hh:mm a"}} --> 06:54 am
- {{timeFormat printTime "H:mm"}} --> 6:54
- {{timeFormat printTime "HHmm"}} --> 0654
- each
- formula: Parses the argument passed as a formula,
e.g. {{#formula}}orderItemUnitPrice * 2{{/formula}} - helperMissing
- if
- ifEqual: conditionally renders content within helper if the two arguments passed are equal
- ifNotEqual: conditionally renders content within helper if the two arguments passed are not equal
- sectionBegin: Sets the beginning of the report page to the content passed
- sectionEnd: Sets the end of the report page to the content passed
- shortCode: Gets the Finale shortCode for a given product id, packing, and lot id (packing and lot id optional)
- unless
- variableDump: Outputs available variables and values in current context
- with
Example 1, formatting the Public Notes to format using line breaks in the UI:
{{#convertNewlineToHTML}}{{order.publicNotes}}{{/convertNewlineToHTML}}
Example 2: Using an ifEqual and ifNotEqual to output "Lightning Fast" if Company Name equals "Finale Inventory". If not, then output "Unknown and maybe expensive"
{{#ifEqual primary.groupName "Finale Inventory"}}Lightning Fast{{/ifEqual}}
{{#ifNotEqual primary.groupName "Finale Inventory"}}Unknown and maybe expensive{{/ifNotEqual}}
Variables
Variables can be used in the format {{variable_name}}
- pageTemplateIndex: Current page in page template
- pageTemplateFirst: Always “1”
- pageIndex: Current page
- sheetName: Name of report
- printDate: Current date printed
- pageMultipleCount: Number of times this group is printed
- pageMultipleIndex: Current group being printed
- pageMultipleFirst: True if this is the first page
- pageMultipleLast: True if this is the last page
- pageMultipleTotal: Total number of pages
Primary/Party variables
Primary refers to the current account’s company information. Most of these variables are self explanatory. Any field with a “Formatted” suffix is an end-user friendly representation of that information.
For party variables, replace primary with either customer or supplier.
- primary.primeImage: URL for company logo
- primary.groupName: Company name
- primary.userFieldData: Empty
- primary.atfLicenseNumber
- primary.atfLicenseExpiration
- primary.hazMatContactTel
- primary.hazMatContractNumber
- primary.carrierScac: Empty
- primary.carrierRegistrationNumber: Empty
- primary.carrierRegistrationHazMatNumber: Empty
- primary.addressFormatted
- primary.telecomNumberFormatted
- primary.telecomHomeNumberFormatted
- primary.telecomWorkNumberFormatted
- primary.telecomMobileNumberFormatted
- primary.telecomFaxNumberFormatted
- primary.telecomDirectNumberFormatted
- primary.emailHomeFormatted
- primary.emailWorkFormatted
- primary.emailPaymentFormatted
- primary.emailBillingFormatted
- primary.webAddressFormatted
- primary.accountCOGS
- primary.accountCOGSFormatted
- primary.accountInventory
- primary.accountInventoryFormatted
- primary.accountIncome
- primary.accountIncomeFormatted
- primary.accountReceivable
- primary.accountReceivableFormatted
- primary.accountSaleDiscount
- primary.accountSaleDiscountFormatted
- primary.accountSaleTax
- primary.accountSaleTaxFormatted
- primary.accountSaleFreight
- primary.accountSaleFreightFormatted
- primary.accountPayable
- primary.accountPayableFormatted
- primary.accountPurchaseDiscount
- primary.accountPurchaseDiscountFormatted
- primary.accountPurchaseTax
- primary.accountPurchaseTaxFormatted
- primary.accountPurchaseFreight
- primary.accountPurchaseFreightFormatted
Additional variables
All dimensions and metrics in the report are available as variables. These will be available to input into your template from the insert variables drop-down menu.
Also, when using orders, shipments, returns, or invoices, there are additional variables available for related entities like customers and suppliers.
Orders
- order.orderId
- order.userFieldData.***: used to access custom user fields
- order.shipFromFormatted
- order.shipToFormatted
- order.billToFormatted
- order.shipFromDirections
- order.shipToDirections
- order.billToDirections
- order.customer.***: used to access customer information. See Primary/party variables
- order.supplier.***: used to access supplier information. See Primary/party variables
- order.customerPo
- order.settlementTermName
- order.publicNotes
- order.privateNotes
- order.adjustmentListFormatted
- order.orderDate
Returns
- return.returnId
- return.customer.***: used to access customer information. See Primary/party variables
- return.returnDate
- return.publicNotes
- return.returnItemListTotalsFormatted
Shipments
- shipment.cancelDate
- shipment.packDate
- shipment.shipDateEstimated
- shipment.shipDate
- shipment.shipDateActual
- shipment.receiveDateEstimated
- shipment.receiveDate
- shipment.receiveDateActual
- shipment.shipmetnId
- shipment.trackingCode
- shipment.carrier
- shipment.shipFromFormatted
- shipment.shipToFormatted
- shipment.billToFormatted
- shipment.shipFromDirections
- shipment.shipToDirections
- shipment.billToDirections
- shipment.telecomNumberFromFormatted
- shipment.telecomNumberToFormatted
Invoices
- invoice.invoiceId
- invoice.adjustmentListFormatted
- invoice.invoiceDate
- invoice.customerPo
- invoice.settlementTermName
Comments
0 comments
Please sign in to leave a comment.