JohnnyL Posted March 18, 2017 Share Posted March 18, 2017 Hi WHMCS Gurus! Im in need of some help, this might be easy peazy for some of you. But i don't know what to add to the lines. Currently my this upper corner looks like this: BUT I want to add some of the lines in the invoice to look like this: How can i accomplish this? BIG THANK YOU in advance! Johnny 0 Quote Link to comment Share on other sites More sharing options...
JohnnyL Posted March 19, 2017 Author Share Posted March 19, 2017 Anyone??? Any help is welcome! Much appreciated ! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 21, 2017 Share Posted March 21, 2017 Johnny, the first part is easy, the second part will take a little work... so for removing the due date, you just remove the line below from invoicepdf.tpl... $pdf->Cell(0, 6, Lang::trans('invoicesdatedue') . ': ' . $duedate, 0, 1, 'L', '1'); for the second half, I don't know whether you need this to work in multiple languages - i'm going to assume just one language as one of your terms isn't mentioned in the language files (seems to be a mix of Dutch and Danish!).. if you need the solution to be multilingual, then you'd need to use Language Overrides - as i've used for Payment Method... $create = new DateTime($datecreated); $due = new DateTime($duedate); $days = $create->diff($due); $pdf->Cell(0, 6, 'Betalingstermijn: ' . $days->days . ' ' . Lang::trans('days'), 0, 1, 'L', '1'); $pdf->Cell(0, 6, Lang::trans('paymentmethod') . ': ' . $paymentmethod, 0, 1, 'L', '1'); 0 Quote Link to comment Share on other sites More sharing options...
JohnnyL Posted March 21, 2017 Author Share Posted March 21, 2017 Johnny, the first part is easy, the second part will take a little work... so for removing the due date, you just remove the line below from invoicepdf.tpl... $pdf->Cell(0, 6, Lang::trans('invoicesdatedue') . ': ' . $duedate, 0, 1, 'L', '1'); for the second half, I don't know whether you need this to work in multiple languages - i'm going to assume just one language as one of your terms isn't mentioned in the language files (seems to be a mix of Dutch and Danish!).. if you need the solution to be multilingual, then you'd need to use Language Overrides - as i've used for Payment Method... $create = new DateTime($datecreated); $due = new DateTime($duedate); $days = $create->diff($due); $pdf->Cell(0, 6, 'Betalingstermijn: ' . $days->days . ' ' . Lang::trans('days'), 0, 1, 'L', '1'); $pdf->Cell(0, 6, Lang::trans('paymentmethod') . ': ' . $paymentmethod, 0, 1, 'L', '1'); AWESOME Brian!! Its indeed just 1 language! that's Dutch. Ill give that code a try! will reply with the results. 0 Quote Link to comment Share on other sites More sharing options...
JohnnyL Posted March 21, 2017 Author Share Posted March 21, 2017 Brian! Ive tested the code, Whenever i copy paste the whole code under $pdf->Cell(0, 6, Lang::trans('invoicesdatecreated') . ': ' . $datecreated, 0, 1, 'L', '1'); Im getting a white screen when opening the PDF. But whenever i remove these lines; $create = new DateTime($datecreated); $due = new DateTime($duedate); $days = $create->diff($due); It works, but it doesnt show the actuall number days.. See screenshot: https://gyazo.com/9a1b4b7dadd097ad0e62266632bdc717 How to fix that part? Big thank you for the reply and help! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 22, 2017 Share Posted March 22, 2017 those lines that you removed should work in any PHP version later than 5.3? try the following instead.... $diffdays = floor(abs((strtotime($datecreated))-(strtotime($duedate)))/86400); $pdf->Cell(0, 6, 'Betalingstermijn: ' . $diffdays . ' ' . Lang::trans('days'), 0, 1, 'L', '1'); $pdf->Cell(0, 6, Lang::trans('paymentmethod') . ': ' . $paymentmethod, 0, 1, 'L', '1'); if you still get a white screen, then goto setup -> general settings -> other -> display errors and tick the box - and it should then tell you where the error is. 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.