How do I add line numbers from quotes to PDF Manager

In the Quotes module you can check "Display Line Numbers", and while looking at the quote in the Quotes module these line item numbers are displayed.  When you download a quote template though, they disappear as it is not a field out of the box in PDF Manager.  What is the correct input if I add a row just for this?

Parents
  • Hi Tucker Jackson

    you can do through coding like ..

    copy file from modules/Quotes/sugarpdf/sugarpdf.standard.php => custom/modules/Quotes/sugarpdf/sugarpdf.standard.php

    Firstly Change for Header 

    private function _initOptions(){
          $this->itemOptions = array(
              "Sr.No" =>"6%",

    then 

    //code add in your bundle list

    declare $count=0; before loop

     if ($line_item->object_name == "Product") {
    $item[$count]["Sr.No"] = $count+1;

    Hope this Helpful to you...

  • Steve thanks for this!  Saved me some time solving it - brilliant! Exactly what I needed to do.

    {$fields.show_line_nums+$count++}

  • Glad I could help, Luke! Working with raw html on the pdf editor can be difficult. 

    We are doing some crazy things now, including dynamically showing information on the PDF depending on the data in the Record; We allow Sales to show/hide a lot of PDF fields based on field input in the Record.. etc. So if you have any questions related to PDF's, feel free to contact me anytime.

  • You've certainly peaked my curiosity. I've been waiting for a way to insert terms & conditions based on which items are inserted into the quote. Would you mind to maybe share or elaborate how you've used? 

  • Hi Missy Brooks,

    Once you get your head around the if statement in the pdf manager then you can do loads of things, as Steve is doing.

    I now have one PDF that can appear totally different depending on the record type, as the reulting print out goes with a product that was returned and the type determines what we do with it here - ie what the paperwork states.

    Here is a simple example:

    {if $fields.powersupply ==''}  *This bit is empty so nothing appears if power supply was not ticked   {else}<img src="http://our_image_url_here/img/Arrow.JPG" alt="" width="25" height="10" />{/if}

    So power supply is a tick box.  If it is not ticked nothing happens: {if $fields.powersupply ==''}  *  {else}.....

    *The grey text area I added is just empty, unless you want to do someting else in that bit if not ticked?

    Then the Else part shows an arrow...

    On the record in sugar:

    The resulting arrow image on the PDF:

     .

    NOTE:  add your IF statements in the HTML editor (like: https://html-online.com/editor/ ), not the pdf editor.

    Some weird layout stuff stuff happens too if you edit in the pdf editor afterwards.  I ended up using an online html editer and pasting into the HTML view on the pdf manager.  Maybe just me here but have NEVER encountered such a difficult tool to use for a system to make PDF's!!  Oh actually SAP BbyD is probably worse!

    Also note - any tiny error in the html will mean the pdf fails to download.

    Anyway, hope that gets you started.... then you can get into nested if statements ;-)

    Luke.

Reply
  • Hi Missy Brooks,

    Once you get your head around the if statement in the pdf manager then you can do loads of things, as Steve is doing.

    I now have one PDF that can appear totally different depending on the record type, as the reulting print out goes with a product that was returned and the type determines what we do with it here - ie what the paperwork states.

    Here is a simple example:

    {if $fields.powersupply ==''}  *This bit is empty so nothing appears if power supply was not ticked   {else}<img src="http://our_image_url_here/img/Arrow.JPG" alt="" width="25" height="10" />{/if}

    So power supply is a tick box.  If it is not ticked nothing happens: {if $fields.powersupply ==''}  *  {else}.....

    *The grey text area I added is just empty, unless you want to do someting else in that bit if not ticked?

    Then the Else part shows an arrow...

    On the record in sugar:

    The resulting arrow image on the PDF:

     .

    NOTE:  add your IF statements in the HTML editor (like: https://html-online.com/editor/ ), not the pdf editor.

    Some weird layout stuff stuff happens too if you edit in the pdf editor afterwards.  I ended up using an online html editer and pasting into the HTML view on the pdf manager.  Maybe just me here but have NEVER encountered such a difficult tool to use for a system to make PDF's!!  Oh actually SAP BbyD is probably worse!

    Also note - any tiny error in the html will mean the pdf fails to download.

    Anyway, hope that gets you started.... then you can get into nested if statements ;-)

    Luke.

Children
No Data