Question: Created By First And Last Name For Pdf Invoice

Created By First And Last Name For Pdf Invoice

I was tasked to put the clerk's (user's) name on the invoice. In views/sales/view_invoice_modal.php it was simply adding this: ''' echo '<br /> ' . lang('clerk') . ': ' . $created_by->first

SS

Scott Smith

Asked
I was tasked to put the clerk's (user's) name on the invoice. In views/sales/view_invoice_modal.php it was simply adding this:

'''
echo '<br /> ' . lang('clerk') . ': ' . $created_by->first_name . ' ' . substr($created_by->last_name,0,1);
'''

Which does not work in view/sales/view_invoice.php because it seems $created_by is not created for the non-modal invoice.

Is there (hopefully) a simply cure for this?
  • MS

    Mian Saleem

    Answered
    Hello,

    You can add `$this->data['created_by'] = $this->site->getUser($inv->user_id);` around line 690 in `pdf` method of `app/controllers/Sales.php`.

    Thank you
  • SS

    Scott Smith

    Answered
    Perfect! I had a feeling it would be a simple thing.

    Thank you!
  • Login to Reply