Custom field in invoice template

Discussion in 'Styling and Customization Questions' started by Juan Carlos Solís, Jul 30, 2015.

  1. Juan Carlos Solís

    Juan Carlos Solís New Member

    Joined:
    May 29, 2013
    Messages:
    15
    Likes Received:
    3
    Hello to everybody.

    Does anyone know how to add a custom field to an invoice template?

    Thank you in advance.

    Regards!
     
    #1
  2. CE-Sreenath

    CE-Sreenath Moderator

    Joined:
    Aug 27, 2011
    Messages:
    81
    Likes Received:
    2
    Hey Juan,

    You can add this by editing \modules\billing\models\PDFInvoice.php and then the respective template to use the value. Basically you need to get the custom field there in PDFInvoice.php from a user instance, then assign it to a variable of the template, and then in the template use the value. This is in the similar way as you pass the other values to the template.
     
    #2
  3. Juan Carlos Solís

    Juan Carlos Solís New Member

    Joined:
    May 29, 2013
    Messages:
    15
    Likes Received:
    3
    Thank you Sreenath.

    I don't have a lot of knowledge in programming, but I'll check out how the current templates are passing the values to see how could I retrieve a custom field.

    I appreciate your help.

    Regards!
     
    #3
    shahidi likes this.

Share This Page