I have a problem with the pdf template for an invoice.
It is the part "#if discountamount" that goes wrong. -> the discountAmount is zero but that part still displays.
The strange thing is: "#if shippingCost" works well. -> the shippongCost is zero and that part is hidden.
It is the part "#if discountamount" that goes wrong. -> the discountAmount is zero but that part still displays.
The strange thing is: "#if shippingCost" works well. -> the shippongCost is zero and that part is hidden.
HTML Code:
<table style="padding: 4px; text-align: right;"> <tbody> <!-- {{#if discountAmount}} --> <tr> <td style="color: #666;">Amount before discount</td> <td>{{preDiscountedAmountCurrencySymbol}} {{preDiscountedAmount}}</td> </tr> <tr> <td style="color: #666;">Discount</td> <td>{{discountAmountCurrencySymbol}} {{discountAmount}}</td> </tr> <!-- {{/if}} --> <tr> <td style="color: #666;">Subtotal</td> <td>{{amountCurrencySymbol}} {{amount}}</td> </tr> <tr> <td style="color: #666;">VAT</td> <td>{{taxAmountCurrencySymbol}} {{taxAmount}}</td> </tr> <!-- {{#if shippingCost}} --> <tr> <td style="color: #666;">Shipping cost</td> <td>{{shippingCostCurrencySymbol}} {{shippingCost}}</td> </tr> <!-- {{/if}} --> <tr> <td style="color: #666;">Total amount</td> <td style="color: #006E00; font-weight: bold;">{{grandTotalAmountCurrencySymbol}} {{grandTotalAmount}}</td> </tr> </tbody> </table>
Comment