Announcement

Collapse
No announcement yet.

Multi-Enum label text in PDF

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

  • Multi-Enum label text in PDF

    I have Multi-Enum field "documentsRequired" with these values (Key - Label):
    1 - Invoice
    2 - Certificate
    3 - Packing List

    Then in PDF I use this:
    {{#each documentsRequired}}
    {{./this}} {{/each}}

    and I get 1,2,3...

    How can I print the Label text instead of the Key value in PDF ?

    Thanks, Tim


  • #2
    Hi,

    I think there're two options.

    1. Using if for each available item with an explicit translation.
    2. To write a helper.

    Comment


    • #3
      These I got working.

      Multi-enum:
      {{#each documentsRequired}}
      {{#ifEqual ./this '1'}} Invoice<br>
      {{/ifEqual}} {{#ifEqual ./this '2'}} Packing List<br>
      {{/ifEqual}} {{#ifEqual ./this '3'}} Quality Certificate<br>
      {{/ifEqual}} {{#ifEqual ./this '4'}} Certificate of Origin<br>
      {{/ifEqual}} {{#ifEqual ./this '5'}} Shipping Bill<br>
      {{/ifEqual}} {{/each}


      Enum:
      Label saved to varchar before printed to PDF:
      $i=products.uom;
      uomLabel=language\translateOption($i, 'uom','Products');

      Comment

      Working...
      X