Jump to content

V7.6.1 invoice template function not uses by cron


Nona

Recommended Posts

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

Link to comment
Share on other sites

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 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated