Announcement

Collapse
No announcement yet.

Sales pack - PDF template #if doesn't work for discountAmount

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sales pack - PDF template #if doesn't work for discountAmount

    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.

    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>

  • #2
    Hi,

    Try to check raw values. {{#if discountAmount_RAW}} You are checking string values that gives true. See: https://docs.espocrm.com/user-guide/...df/#raw-values

    Comment


    • #3
      Thanks Yurikuzn, this works! Is it possible to have VAT / Taxes over shipping costs? Now it's taxless.

      Comment

      Working...
      X