webERP Forum
company logo on invoice - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: How To ? (http://www.weberp.org/forum/forumdisplay.php?fid=6)
+--- Thread: company logo on invoice (/showthread.php?tid=376)



company logo on invoice - dampfbahn54 - 10-11-2012

First of all: webERP is absolutly great - I set up a system for my company in Switzerland and most of all, it is a perfect usable system !

there are two little things, I can't find a solution yet:

1. if I print an invoice, the company logo is much to big sized - I do not found a possibility to hide it (as possible i.e. on delivery notes). It ist possible to hide the logo on invoices or can the printed size be changed (to arround a quarter) - I can't select the invoice by the report generator;

2. by insert a first fixed asset positions, it is not possible to modify the data set - after pressing the change button, simply nothing is displayed on the screen. Do I make a mistake at this point ?

The next challange will be to integrate a web shop based on a Joomla extension.

Thanks a lot - and all the best !

Alex



RE: company logo on invoice - phil - 10-12-2012

Hi Alex,

Yes it is easy to change the invoice format - first you need to identify if you are using portrait or landscape invoices - you can choose in the configuration. If you are using landscape invoices then you need to look at the script:

includes/PDFTransHeader.inc - at line 10:
Code:
$pdf->addJpegFromFile($_SESSION['LogoFile'],$Page_Width/2 -120,$YPos-40,0,60);

All you need to do is edit this line as necessary for your logo. (If you are using the portrait invoice then you need to be looking at includes/PDFTransPageHeader_Portrait.inc - which is very similar)

What is happenning is that the pdf class function $pdf->addJpegFromFile() (in the file includes/class.pdf.php) is being used to place the logo on the invoice. This function takes the following parameters:

addJpegFromFile($img,$XPos,$YPos,$Width=0,$Height=0,$Type='')

Where $img is the file name of the logo image as a .jpg

$XPos is the X - horizontal position of the logo accross the page - where 0 is the far left of the page and 842 is the far right edge (if your page is A4 landscape - it is 595 if the invoice is portrait). By taking $Page_Width/2 -120 this is putting the logo 120 over to the left of centre. As $Page_Width/2 is the centre of the page. The units are pdf points.

$YPos is the Y - vertical position of the logon up the page - where 0 is the very bottom edge and 595 is the very top (for A4 landscape). The script keeps track of where it is in a variable also called $YPos so it is putting the logo 40 points below the current position of $YPos.

By entering a number of $Height - this sets the height of the logo and the width is recalculated based on the same aspect ratio. In the default script we entered a number for $Width of 60 and the $Height is recalculated (as we entered a zero). If you set the $Height and $Width the apect ratio is altered.

When you have made alterations to any script, you need to keep a copy elsewhere so you have a record of any scripts you have altered - so when you upgrade you know what you need to do to have the system sing for you.

There is a bug with the SelectAsset.php script - I will resolve this over the coming weekend and Exson will do a new release once a couple of such issues have been resolved.


RE: company logo on invoice - dampfbahn54 - 10-12-2012

Hi Phil

thank you for your reply.

After knowing where to search, I changed the code to have the companys logo in a proper size instead of the printed company name on the left, in both ways, landscape and portrait.

Further more it seems to be possible, to arrange also all the other lists in the same way (/includes/PDF*header.inc).

best regards

Alex







RE: company logo on invoice - phil - 10-13-2012

Glad you now understand the power that is yours with webERP - it really is all possible now.
This is why we took such pains to ensure the code is approachable.