Menu

#15 Company logo on invoice

Next_Release
open
nobody
None
2013-12-25
2013-12-14
urugamai
No

Logo next to my company details would be nice. I did it by adding the following lines to '.../invoices/report/InvoiceReport.php' (sorry not in diff format but not sure what format you would actually want fixes in). (Also, I suspect the embedded html in the code will stuff up the viewing of this but hopefully it is enough to get the idea).

  • $str .= "
    ";
  • $str .= "['logo']}\\" width=70 height=70>";
  • $str .= "
  • "; $str .= "

    {$companyRec['name']}"."
    ";^M

    $str .= "{$companyRec['address1']}";^M
    if ($companyRec['address2'] <> '')^M
    $str .= ", {$companyRec['address2']}";^M
    $str .= "
    {$companyRec['city']} {$companyRec['state']} {$companyRec['postalcode']}

    ";^M

    • $str .= "
    ";

Discussion

  • urugamai

    urugamai - 2013-12-14

    Lets try that code stuff again - sorry...

               $str .= "<table><tr><td>";
                $str .= "<img src=\"/tems/{$companyRec['logo']}\" width=70 height=70></img>";
                $str .= "</td><td>";
                $str .= "<h2>{$companyRec['name']}"."<br>";^M
                $str .= "{$companyRec['address1']}";^M
                if ($companyRec['address2'] <> '')^M
                        $str .= ", {$companyRec['address2']}";^M
                $str .= "<br>{$companyRec['city']} {$companyRec['state']} {$companyRec['postalcode']}</h2>";^M
                $str .= "</td></tr></table>";
    
     
  • urugamai

    urugamai - 2013-12-25

    The above didnt come out on the PDF version and after much investigating I have altered the process to use a text field to reference the url to the image. Means the image must be pre-copied to the images folder but I suspect you can come up with a better solution in due course.
    Attached is a patch for AFTER the above changes.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.