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

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • rabii
    commented on 's reply
    tbh i don't understand what you mean.

    can you explain further this part
    These two methods are giving proper result in case on single file. I'm trying to access this from espo case. If I select it's gives an output that not matched to condition statement.

    not sure what you need to achieve.

  • conceptmedical
    commented on 's reply
    rabii, my bad I have tagged a wrong URL https://forum.espocrm.com/forum/gene...n-pdf-template Kindly check that, As suggested I have used Tcpdf
    case a) {pageAbsoluteNumber} of {totalPageNumber}
    case b) {pageNumber} of {totalPageNumber}

    These two methods are giving proper result in case on single file. I'm trying to access this from espo case. If I select it's gives an output that not matched to condition statement.

    If I select two cases, then first Page display Page 1 of 1- and second-page Display Page 2 of 1 that is wrong.

  • rabii
    commented on 's reply
    this post has nothing to do with print to pdf

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

  • rabii
    commented on 's reply
    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
    commented on 's reply
    If I used the standard html then on edit its get spoiled the design and case statement. Espo is not friendly as much it should be.

  • rabii
    commented on 's reply
    Used to work before, but this was just an example i wouldn't want to inline style in tdTag instead i would apply my design to a span / div within the tdTag. Remember you can use simple html table and apply inline style on tr / td etc no worries.

  • conceptmedical
    commented on 's reply
    inline style in {{#tdTag}} is not working or not supported

  • rabii
    replied
    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}}

    Leave a comment:


  • victor
    replied
    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.

    Leave a comment:


  • 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?
Working...