Announcement

Collapse
No announcement yet.

Compare quantity/amount in PDF-Templates (How to Debug)

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

  • Compare quantity/amount in PDF-Templates (How to Debug)

    I want to hide "quantity" in pdf-templates if it's zero but somehow i cant compare it.
    I tried many ways but none work.

    HTML Code:
    <td style="background-color:#f6e7f4; border-bottom: .5px solid #CF78C3;">
       <span style="font-size: 10px;">
          <!-- {{#if [quantity > '0.00']}} -->{{quantity}}<!-- {{/if}} -->
       </span>
    </td>
    HTML Code:
    <td style="background-color:#f6e7f4; border-bottom: .5px solid #CF78C3;">
       <span style="font-size: 10px;">
          <!-- {{#if 'quantity' [>] '0.00'}} -->{{quantity}}<!-- {{/if}} -->
       </span>
    </td>
    HTML Code:
    <td style="background-color:#f6e7f4; border-bottom: .5px solid #CF78C3;">
       <span style="font-size: 10px;">
          <!-- {{#ifEqual 'quantity' '0.00'}} -->{{quantity}}<!-- {{/ifEqual}} -->
       </span>
    </td>
    HTML Code:
    <td style="background-color:#f6e7f4; border-bottom: .5px solid #CF78C3;">
       <span style="font-size: 10px;">
          <!-- {{#ifEqual quantity '0.00'}} -->{{quantity}}<!-- {{/ifEqual}} -->
       </span>
    </td>
    HTML Code:
    <td style="background-color:#f6e7f4; border-bottom: .5px solid #CF78C3;">
       <span style="font-size: 10px;">
          <!-- {{#ifEqual quantity 0.00}} -->{{quantity}}<!-- {{/ifEqual}} -->
       </span>
    </td>


    HTML Code:
    <td style="background-color:#f6e7f4; border-bottom: .5px solid #CF78C3;">
       <span style="font-size: 10px;">
          <!-- {{#ifEqual quantity 0}} -->{{quantity}}<!-- {{/ifEqual}} -->
       </span>
    </td>


    Where am i going wrong?

  • #2
    Hi arrestthepresident,

    Please try #ifEqual without using styles. That is, use the opening tag before the style and the closing tag after using the style.

    Comment


    • #3
      It is recommended to use tags when dealing with pdf, this is how you can achieve what you need:

      PHP Code:
      {{#tableTag}}
            
      {{#trTag}}
                
      {{#ifEqual quantity "0.00"}}
                
      {{#tdTag style="background-color:#f6e7f4; border-bottom: .5px solid #CF78C3;"}}<span style="font-size: 10px;">{{quantity}}</span>{{/tdTag}}
                
      {{else}}
                {{
      #tdTag}}Whoops is not equal 0 {{/tdTag}}
                
      {{/ifEqual}}
            {{/
      trTag}}
      {{/
      tableTag}}​ 

      Comment


      • rabii
        rabii commented
        Editing a comment
        if you are using latest version, you can use the style field which is dedicated to style all your html and it works like an charm. Espocrm is the only open source crm i know off that offer print to pdf feature. Instead of not being grateful for the work this amazing team do for free for us, just share your code and what you want to achieve and we will help you achieve it.

      • conceptmedical
        conceptmedical commented
        Editing a comment
        rabii, I have already posted on community for that, Please check and comments on https://forum.espocrm.com/forum/deve...st-not-working

      • rabii
        rabii commented
        Editing a comment
        this post has nothing to do with print to pdf
    Working...
    X