PDF Templates - include fields from many to one-to-many module in design

Hi!

I have the following situation, that I need a help how to resolve with:

  • Custom module: Internal orders (include general information on one internal order: hwo created it, what department, status…)
  • Custom module: Internal orders line items (include information on specific product to be ordered: product number, name, qty, dimensions, related documents, notes…)
  • Relationship made: Internal orders --> one-to-many --> Internal orders line items
  • I add products to an order via Internal order subpanel named “Internal orders line items” that is linked to that module

Issue:

  • I need Internal orders line items data/fields included into PDF template that has Internal orders as base module
    • i.e. I need to printout one internal order with all general data and below all linked products info from Internal orders line items

Attached screens:

  • screenshot of the internal order main module details screen
    • you can seen in the first subpanel example line item named “iveral 3”
  • screenshot of the linked line item “iveral 3” detais screen with information I need on PDF template below the main module details, such as: qty, p/n, description, dimensions…

Tried to find a way to do this, but no success until now… :frowning:

I would highly appreciate any help or hint how to make this feasible.

Many thanks in advance for help!

HAVE A GREAT DAY! :wink:

Mario

I don’t know the answer about the PDF generation, but before that, let me ask you something… howcome you’re not using the default Quotes / Line items modules? You could customize them, of course. But with SuiteCRM I always advise to avoid custom modules if you can use default ones instead. It solves a bunch of problems, and gives you a lot of added functionality (like PDF generation!).

If your Custom Module Line Items does not populate the Core aos_quotes_partnumbers then what you need to do is customise the PDF generation code and add your Custom variable in the PDF template.
You can place a variable like {$internal_orders_line_items} in PDF Template and handle this in generatPdf.php file
you can customise the Generate PDF Entrypoint to call your custom generatePdf.php file which will handle your custom variables.