Nona Posted January 16, 2023 Share Posted January 16, 2023 Hello, in my invoice template I have a function for some customers get other text, not the text in general setup. if ( $userid == '58' || $userid == '102' || $userid == '50' || $userid == '295' || $userid == '281') { if (!class_exists('MYPDF')) { class MYPDF extends TCPDF { public function Header() { global $_LANG; global $invoicenum; $this->Image(ROOTDIR.'/templates/avantwhmcs/img/logo.png', 169, 8); $this->SetXY(5,10); } public function Footer() { global $_LANG; $this->SetY(-20); $this->SetFont('freesans', '', 10); $this->writeHTMLCell(0, 0, $this->GetX(), $this->GetY(), '<table> <tr> <td><span style="color: #000000;"><b>'.$_LANG['invoicesaccountowner'].'Account Owner: xx</b></span></td> <td><span style="color: #000000;"><b>'.$_LANG['invoicesbankaddress'].'Bank: xx</b></span></td> </tr> <tr> <td><span style="color: #000000;"><b>IBAN: xx</b></span></td> <td><span style="color: #000000;"><b>xx. xx</b></span></td> </tr> <tr> <td><span style="color: #000000;"><b>SWIFT/BIC: xx</b></span></td> <td><span style="color: #000000;"><b>DE-xx, xx</b></span></td> </tr> </table>', 0, 1, false, true, 'C'); } } } } else { if (!class_exists('MYPDF')) { class MYPDF extends TCPDF { public function Header() { global $_LANG; global $invoicenum; $this->Image(ROOTDIR.'/templates/avantwhmcs/img/logo.png', 169, 8); $this->SetXY(5,10); } public function Footer() { global $_LANG; $this->SetY(-20); $this->SetFont('freesans', '', 10); $this->writeHTMLCell(0, 0, $this->GetX(), $this->GetY(), '<table> <tr> <td><span style="color: #ff0000;"><b>'.$_LANG['invoicesaccountowner'].' Bank transfer:</b></span></td> <td><span style="color: #ff0000;"><b>'.$_LANG['invoicesbankaddress'].' Bankueberweisung:</b></span></td> </tr> <tr> <td><span style="color: #ff0000;"><b>Please contact support</b></span></td> <td><span style="color: #ff0000;"><b>Bitte kontaktieren Sie den Support</b></span></td> </tr> <tr> <td><span style="color: #ff0000;"><b>Ticket or e-Mail - support@xxx.com</b></span></td> <td><span style="color: #ff0000;"><b>Ticket oder e-Mail - support@xxx.com</b></span></td> </tr> </table>', 0, 1, false, true, 'C'); } } } } this works fine, if I klick on download or send to custumer. But if the CRON create the invoice and send it to the Customer, its not working. can someone help me to understand why? thank you 0 Quote Link to comment Share on other sites More sharing options...
AladdinJ Posted January 16, 2023 Share Posted January 16, 2023 the cron job only creates the invoice your tpl job views the invoice, so in logic, there is should not be a problem .. I got an idea you make check what deffrence bitween invoice created by cron and another one in database so later you may can make hook to edit the invoce created by cron to fix it's problem 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.