davet Posted July 17, 2008 Share Posted July 17, 2008 How do I customize the printable and/or PDF invoice? I need to be able to customize it so i can print it and mail it in a double-windowed envelope. Any help is greatly appreciated. 0 Quote Link to comment Share on other sites More sharing options...
penguin Posted July 17, 2008 Share Posted July 17, 2008 You can edit the includes/pdfconfig.php file and fully customise the PDF invoices from there 0 Quote Link to comment Share on other sites More sharing options...
davet Posted July 17, 2008 Author Share Posted July 17, 2008 ok i see. I figured out how to move the logo and how to justify my company address to the left instead of right. Does anyone have any advice as to how i can move my company address down about 1/2" ? How about moving the customer's address down about 1" ? I tried playing around with the settings but just can't figure it out. 0 Quote Link to comment Share on other sites More sharing options...
magga Posted July 17, 2008 Share Posted July 17, 2008 If you put in $pdf->Ln() before it, it should move it down. You can also put a number in the brackets to move it down a certain number of lines. 0 Quote Link to comment Share on other sites More sharing options...
davet Posted July 17, 2008 Author Share Posted July 17, 2008 Thanks! That worked perfect. I also found the docs at http://wiki.whmcs.com/PDF_Invoice which are very helpful. Does anyone know how to add # of days past due to the invoice? I don't see this as a variable in the documentation. Is there some php code which can take the current date and figure out how many days past due the invoice is and only display "PAST DUE X DAYS" if it is past due? 0 Quote Link to comment Share on other sites More sharing options...
davet Posted July 18, 2008 Author Share Posted July 18, 2008 also for those that need help with the php aspect in regrards to the php/pdf code here's a good article at Generating PDF with PHP 0 Quote Link to comment Share on other sites More sharing options...
magga Posted July 20, 2008 Share Posted July 20, 2008 Plus here which gives you all the commands: http://www.fpdf.org/ 0 Quote Link to comment Share on other sites More sharing options...
davet Posted July 23, 2008 Author Share Posted July 23, 2008 does anyone know how to show "PAST DUE X DAYS" if the invoice is past due? 0 Quote Link to comment Share on other sites More sharing options...
juiced Posted July 25, 2008 Share Posted July 25, 2008 Hi, This may be the solution you need. http ://www.justjuiced .co.nz/invoice/ 0 Quote Link to comment Share on other sites More sharing options...
leew87 Posted November 17, 2008 Share Posted November 17, 2008 hi does any one know how i can get the Company details and invoice to display in line with each other just on different sides of the page i am trying to create a page that looks like this www.illit.co.uk/ILLITInvoice.pdf 0 Quote Link to comment Share on other sites More sharing options...
striddy Posted November 17, 2008 Share Posted November 17, 2008 does any one know how i can get the Company details and invoice to display in line with each other just on different sides of the page Here is a handy information resource. http://www.fpdf.org/ 0 Quote Link to comment Share on other sites More sharing options...
leew87 Posted November 17, 2008 Share Posted November 17, 2008 thanks for the reply david i have just checked on your link i have got the font colour changed and most of the text in correct postition but still need to get the company address and client address on the same row and when i try to add a new page for the terms and conditions i dont get anything at all i wonder if you can help?? <?php # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',5,5); # Header Bar $pdf->Ln(4); $invoiceprefix = $_LANG["invoicenumber"]; /* ** This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice ** if ($status!="Paid") { $invoiceprefix = $_LANG["proformainvoicenumber"]; } */ $pdf->SetFont('Arial','B',14); $pdf->SetFillColor(255,255,255); $pdf->Cell(0,8,$invoiceprefix.$invoicenum,0,1,'R','1'); $pdf->SetFont('Arial','',12); $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.$datecreated.'',0,1,'R','1'); $pdf->Ln(5); # Company Details $pdf->SetFont('Arial','',12); $pdf->Cell(0,6,$companyname,0,1,'R'); $pdf->SetFont('Arial','',10); for ( $i = 0; $i <= 4; $i += 1) { $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R'); } # Clients Details $pdf->SetFont('Arial','B',12); $pdf->Cell(0,4,$_LANG["invoicesinvoicedto"],0,1); $pdf->SetFont('Arial','',10); if ($clientsdetails["companyname"]) { $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L'); $pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else { $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } $pdf->SetFont('Arial','',10); $pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L'); if ($clientsdetails["address2"]) { $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L'); } $pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'L'); $pdf->Cell(0,4,$clientsdetails["country"],0,1,'L'); $pdf->Ln(10); # Invoice Table $pdf->SetDrawColor(200); $pdf->SetFont('Arial','B',12); $pdf->SetFillColor(63,63,63); $pdf->SetTextColor(117,188,232); $pdf->Cell(130,7,$_LANG["invoicesdescription"],1,0,'C','1'); $pdf->Cell(40,7,$_LANG["invoicesamount"],1,0,'C','1'); $pdf->Ln(); $pdf->SetFont('Arial','',11); $pdf->SetFillColor(255,255,255); $pdf->SetTextColor(0); foreach ($invoiceitems AS $item) { if (strlen($item["description"])>75) { $pdf->Cell(130,6,substr($item["description"],0,75),1); $pdf->Cell(40,6,$currencysymbol.$item["amount"],1,0,'C'); $pdf->Ln(); $pdf->Cell(130,6,substr($item["description"],75),1); $pdf->Cell(40,6,"",1,0,'C'); } else { $pdf->Cell(130,6,$item["description"],1); $pdf->Cell(40,6,$currencysymbol.$item["amount"],1,0,'C'); } $pdf->Ln(); } $pdf->SetFont('Arial','B',12); $pdf->SetTextColor(117,188,232); $pdf->Cell(130,7,$_LANG["invoicessubtotal"],1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$subtotal,1,0,'C','1'); $pdf->Ln(); /* Add VAT Tax to the invoice un comment this if ($taxrate!="0.00") { $pdf->Cell(130,7,$taxrate."% ".$taxname,1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$tax,1,0,'C','1'); $pdf->Ln(); } if ($taxrate2!="0.00") { $pdf->Cell(130,7,$taxrate2."% ".$taxname2,1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$tax2,1,0,'C','1'); $pdf->Ln(); } */ $pdf->Cell(130,7,$_LANG["invoicescredit"],1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$credit,1,0,'C','1'); $pdf->Ln(); $pdf->Cell(130,7,$_LANG["invoicestotal"],1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$total,1,0,'C','1'); $pdf->Ln(); $pdf->Ln(); # Invoice Notes if ($notes) { $pdf->SetFont('Arial','',10); $pdf->SetTextColor(200); $pdf->MultiCell(170,5,$_LANG["invoicesnotes"].": $notes"); } # Invoice Status $pdf->SetXY(45,90); if ($status=="Cancelled") { $statustext = $_LANG["invoicescancelled"]; $pdf->SetTextColor(245,245,245); } elseif ($status=="Unpaid") { $statustext = $_LANG["invoicesunpaid"]; $pdf->SetTextColor(204,0,0); } elseif ($status=="Paid") { $statustext = $_LANG["invoicespaid"]; $pdf->SetTextColor(153,204,0); } $pdf->SetFont('Arial','B',40); $pdf->Cell(120,20,strtoupper($statustext),0,0,'C'); # New Page for T&Cs function ChapterTitle($num,$label) { //Arial 12 $pdf->SetFont('Arial','',; //Background color $pdf->SetFillColor(255,255,255); //Title $pdf->Cell(0,6,"Chapter $num : $label",0,1,'C',true); //Line break $pdf->Ln(4); } function ChapterBody($file) { //Read text file $f=fopen($file,'r'); $txt=fread($f,filesize($file)); fclose($f); //Times 12 $pdf->SetFont('Times','',10); //Output justified text $pdf->MultiCell(0,5,$txt); $pdf->Ln(); } function PrintChapter($num,$title,$file) { $pdf->AddPage(); $pdf->ChapterTitle($num,$title); $pdf->ChapterBody($file); } $pdf=new PDF(); $title='Terms & Conditions'; $pdf->SetTitle($title); $pdf->SetAuthor('ILL IT Solutions'); $pdf->PrintChapter(1,'Terms & Conditions','T&C.txt'); $pdf->Output(); ?> regards 0 Quote Link to comment Share on other sites More sharing options...
striddy Posted November 17, 2008 Share Posted November 17, 2008 Read up on Cell() You can position with that command. http://www.fpdf.org/en/doc/cell.htm 0 Quote Link to comment Share on other sites More sharing options...
leew87 Posted November 17, 2008 Share Posted November 17, 2008 i still cant get a extra page for the terms and conditions when i use the $pdf->AddPage(); i get nothing displayin at all on looking at my link for the invoice i am trying to create do you think it is possiable 0 Quote Link to comment Share on other sites More sharing options...
leew87 Posted November 17, 2008 Share Posted November 17, 2008 i have read up on the cell command and it is being used but can not seem to get them to link up the coding i am using is # Company Details $pdf->SetFont('Arial','',12); $pdf->Cell(0,6,$companyname,0,1,'R'); $pdf->SetFont('Arial','',10); for ( $i = 0; $i <= 4; $i += 1) { $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R'); } # Clients Details $pdf->SetFont('Arial','B',12); $pdf->Cell(0,4,$_LANG["invoicesinvoicedto"],0,1); $pdf->SetFont('Arial','',10); if ($clientsdetails["companyname"]) { $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L'); $pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else { $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } $pdf->SetFont('Arial','',10); $pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L'); if ($clientsdetails["address2"]) { $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L'); } $pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'L'); $pdf->Cell(0,4,$clientsdetails["country"],0,1,'L'); $pdf->Ln(10); 0 Quote Link to comment Share on other sites More sharing options...
lanquest Posted December 8, 2008 Share Posted December 8, 2008 Are there any self proclaimed pro's in here that can put an end to everyone's missery here 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted December 8, 2008 Share Posted December 8, 2008 Nah... no suicide bombers are allowed here. nor would we want them. 0 Quote Link to comment Share on other sites More sharing options...
graniteweb Posted February 4, 2009 Share Posted February 4, 2009 For the WHMCS team.... After seeing a significant number of posts regarding PDF invoices and users having troubles customizing their invoices, I figured I would mention this. We have a custom PDF library we picked up from a ditched project and did a bunch of rewrites to resurrect it and fine-tune the output formatting for use with reports and invoices in our ecommerce software. The library accepts HTML files and outputs them to PDF format. It would seem that this might be a whole lot more useful for WHMCS to incorporate such a library as it would allow users to work with a smarty template instead of a PHP script to edit the formatting of their invoice. We have this library working well with HTML pages containing nested tables and various formatting applied. Shouldn't be much trouble to integrate with WHMCS. Please let me know if you're interested and I will put in a support ticket to discuss further. 0 Quote Link to comment Share on other sites More sharing options...
AxlF Posted February 4, 2009 Share Posted February 4, 2009 i would say, put in that support ticket. I don't know whether matt or anybody else of the team is reading this thread... 0 Quote Link to comment Share on other sites More sharing options...
kszpirak Posted February 5, 2009 Share Posted February 5, 2009 Okay so I noticed that the invoice item doesn't include the actual item description that I put in when I enter the product. Invoice just shows the name of the product / price. How can I show the full description of the item that is being billed for on the invoice. Thank you. 0 Quote Link to comment Share on other sites More sharing options...
graniteweb Posted February 6, 2009 Share Posted February 6, 2009 kszpirak, I posed that same question to WHMCS support and was told that it can be done via custom coding. 0 Quote Link to comment Share on other sites More sharing options...
bettysue Posted February 6, 2009 Share Posted February 6, 2009 I was afraid it would be something like that instead of having a smartfield or something to the current template. I had asked the same question in a different thread the end of January and still haven't received a reply on it. keeping my fingers crossed that someone knows how to do it and will assist those of us who are smarty and php unknowledgable. betty 0 Quote Link to comment Share on other sites More sharing options...
Inetbiz Posted February 12, 2009 Share Posted February 12, 2009 I don't see subject or keywords filled out and I too would like to see a blurb below to invoice details added. A standard text we can edit about invoice policy. I would also like to see the payment gateway and subscription ID whether it was auth trans ID & auth code or paypal trans ID 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.