Hi, everyone …
@Elizabeth (I’ll flag you since this deals with templates) …
I experienced my second huge learning curve with TaxCycle last week - learning how to debug the invoice template and understand Mustache template code.
The problem: I was annoyed that the Client Invoice (CInvoice) was not adding a subtotal after the Discounts, going directly into applying the Tax. If you add Disbursements, then the subtotal would appear for Discounts, but again, no subtotal after the Disbursements, going again directly to applying the tax. I would have expected TaxCycle to have gotten that right, unless no one noticed and it was just one of my own idiosyncrasies.
Anyway, I put my Computer Science degree skills to work and after a bit of a learning curve understanding Mustache, I corrected the template.
I made three changes. The main thing I found was that TaxCycle wanted to place the subtotals for one section (ie: discounts section) into the program code for the NEXT section (ie: Disbursements section)
First Correction:
{{/ CurrentClient.BillingWorksheet.Totals.Discount }}
Subtotal ${{ format(CurrentClient.BillingWorksheet.Totals.TotalBeforeDisbursements, “C”) }}
{{# CurrentClient.BillingWorksheet.Totals.TotalDisbursements }}
Moved it BEFORE the {{# … TotalDisbursements}} section instead of after it
Second Correction:
{{! Disbursements Section template}}{{# CurrentClient.BillingWorksheet.Disbursements }}
{{ Description }} {{# Amount }}${{ format(Amount, “C”) }}{{/ Amount }}
{{/ CurrentClient.BillingWorksheet.Disbursements }}{{< disbursements}}{{/ disbursements }}{{# . }} {{> disbursements }} {{/ . }}
Moved the {{<disbursements}} from where it was above the {{ Description }} table after the {{! Disbursements Section template}} comment to below the {{Description}} table, as the Disbursements weren’t displaying properly otherwise.
Third Correction
{{/ CurrentClient.BillingWorksheet.Totals.ShowDetails}}
Total Disbursements |
${{ format(CurrentClient.BillingWorksheet.Totals.TotalDisbursements, “C”) }} |
Subtotal |
${{ format(CurrentClient.BillingWorksheet.Totals.TotalBeforeTaxes, “C”) }} |
{{/ CurrentClient.BillingWorksheet.Totals.TotalDisbursements }}
Moved this Subtotal Table Row UP from being in the GST table section to this location in the Disbursements section. This allows the Disbursement subtotal to be shown as part of the disbursements. Otherwise, when placed AFTER the {{/ … TotalDisbursements}} termination section, the Disbursements wouldn’t subtotal.
Much happier with the Invoice now, but was surprised that I had a repair job to do within my first two weeks of licensing the software! A great way to get my feet wet though, LOL.
I did add my own unique comments onto the Invoice as well, but omitted those for this upload.
T1TY2019.CInvoice.taxcycletemplate (18.6 KB)