Why are the sales order items not available in the PDF template builder?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeffreysgrossman
    Senior Member
    • Jan 2025
    • 137

    #1

    Why are the sales order items not available in the PDF template builder?

    Curious why the related Sales Order Items Fields are not available in the PDF builder. The basic templates come with some of the fields needed from the sales order item entity. However if we want to show others like Discount and a custom field we have on the sales order items entity that work well on the actual sales order. They do not show up in the editor outside of choosing the Sales Order Items entity for the template. That does not performe the way we need it to. Any ideas on how to get these fields onto a sales order PDF?

    Click image for larger version

Name:	image.png
Views:	0
Size:	15.5 KB
ID:	122106

    I feel like im missing something?
  • victor
    Active Community Member
    • Aug 2022
    • 1031

    #2
    Short answer: because it's not easy to do.

    Extended answer:
    1. Make a copy of the default Sales Order template.
    2. Switch to code mode "</>" of the Sales Order template you created.
    3. Find the desired table in the code and add the columns you need (do not forget about their width) and rows with the correct Placeholders to it. For example, let it be "discount":​

    Click image for larger version

Name:	image.png
Views:	0
Size:	158.3 KB
ID:	122127

    - If you want to understand this functionality more: https://docs.espocrm.com/user-guide/...#each-iterator.
    - If you want to find a customizer who will refine/customize/create the template you need separately: https://forum.espocrm.com/forum/job-offers-requests.​

    Comment

    • jeffreysgrossman
      Senior Member
      • Jan 2025
      • 137

      #3
      victor thank you so much! Exactly what i was missing! I knew it was me not getting it! Appreciate your help. Got it all set now! I had been taking the template into another editor and it stripped all the coding that was needed and i missed the pieces that you highlight and instructions were really helpful! Thank you!

      Comment

      • jeffreysgrossman
        Senior Member
        • Jan 2025
        • 137

        #4
        victor I am stuck on getting a delivery order PDF to have the Inventory Number on there? I have tried lots of things but nothing seems to work. I don't suppose you could help with what the code would look like to basically reproduce the actual delivery order with Inventory Number? Any help will be greatly appreciated.

        Comment

        • victor
          Active Community Member
          • Aug 2022
          • 1031

          #5
          jeffreysgrossman,

          Almost identical to the previous example:

          Click image for larger version

Name:	image.png
Views:	0
Size:	137.1 KB
ID:	122238

          Comment

          • jeffreysgrossman
            Senior Member
            • Jan 2025
            • 137

            #6
            victor I am not sure what I did before that was not working as your code above does exactly what I needed. I swore when i tried that it output blanks when I added the .name and if I did not add the .name it listed all kinds of stuff. No matter. It works. I am very appreciative you were able to help me again! Have a wonderful day!

            Comment

            • jeffreysgrossman
              Senior Member
              • Jan 2025
              • 137

              #7
              Ok victor now I just feel like I have to redeem myself and ask you if you might be able to help with the code to print out all the possible Inventory Numbers that could be used? So the senario is a printed picklist of all the Inventory Numbers that show up in the drop down. I have tried using the instructions around Related Records and the mention using:
              Code:
              {{#each contacts}} Name: {{name}}, Role: {{opportunityRole}}, Contact's Account Type: {{account.type}} {{/each}}
              That is from the documentation I tried changing to:
              Code:
              {{#each InventoryNumber}}
                  Name: {{name}},
              {{/each}}
              But that does not work in my case while trying to print the pdf from the delivery order. Not sure if what I want is possible or not. So figured I would ask. If you are able to help me get a row with a list of all the possible matching inventory numbers from a delivery order that would be amazing! Either way have an amazing day!

              Thank You
              Jeff

              Comment


              • victor
                victor commented
                Editing a comment
                You don't need to tag me or anyone from the community who responded to your topic. This way you make other community members think that your request/question is directed to only one user. And even if there is an option to resolve your request, the community member will not do it in 90% of cases, because they were addressing someone specifically (me, for example).

                Regarding:
                So the senario is a printed picklist of all the Inventory Numbers that show up in the drop down
                Personally, I don't understand what you mean and most likely this request deserves a new topic with screenshots and a more detailed explanation.

              • jeffreysgrossman
                jeffreysgrossman commented
                Editing a comment
                Thank you victor! I get what you are saying! Really do appreciate the help on this. You have helped me get the PDF train rolling. I have been using the AI to help try and figure out how to get what I was asking but if I get to stuck I will creat a new post and see if I can more elegantly describe the situation. Have an amazing day. As always appreciate any help I get!
            Working...