Aly
10/26/2024, 6:11 PMCeligo AI
10/26/2024, 6:11 PMAI generated answer (using internal Slack threads):To populate the due date on an Advanced PDF/HTML Template which is 14 days later than the
record.trandate
of the invoice, you can use the Freemarker date built-ins. Here is how you can do it:
1. First, you need to convert the record.trandate
to a date object. You can do this by using the ?date
built-in. This will convert the string to a date object that you can perform operations on.
freemarker
<#assign invoiceDate = record.trandate?date>
2. Next, you can add 14 days to the invoiceDate
by using the ?time
built-in. This built-in allows you to perform arithmetic operations on date objects.
freemarker
<#assign dueDate = invoiceDate + 14?days>
3. Finally, you can display the dueDate
in your template. You can format the date to your liking by using the ?string
built-in.
freemarker
${dueDate?string["yyyy-MM-dd"]}
So, the complete code would look like this:
freemarker
<#assign invoiceDate = record.trandate?date>
<#assign dueDate = invoiceDate + 14?days>
Due Date: ${dueDate?string["yyyy-MM-dd"]}
This will display the due date as 14 days after the transaction date in the format "yyyy-MM-dd".
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
10/26/2024, 6:12 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844465375
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839542806
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83365947
Celigo AI
10/26/2024, 6:12 PM