Jump to content
sokalsondha

cron not generating monthly invoice

Recommended Posts

hello

thanks for reading my text. i have whmcs latest version and what is the issue is i can see the cron not generating the monthly invoice. i have a customer who have an active product due at 08/08/2020

but i cant understand why the cron is not generating the invoice when its suppose to be generate 14 days earlier.

but if i click on the customer dashboard generate due invoice i can see system create the invoice for that client.

so can someone guide me what can be issue??

i can see in the logs

image.thumb.png.08f1b192d8993ef16f1134437cf664c0.png

 

but i can't find any issue at all 😞

dont know what to do

 

just to let you know i have customized pdf invoice . is that giving any issue?

 

thanks a million in advance.

please stay safe

 

Share this post


Link to post
Share on other sites
Posted (edited)

There was the same issue with my WHMCS so first I checked WHMCS System Health Status. Cronjob was showing as warning so I found that cronjob is actually skip it when cronjob time on the panel / server does not match with your WHMCS cronjob set time.

 

Go to WHMCS Admin >> Setup >> Automation Setting. Make sure that Scheduling time and your server cronjob time is same. Manually run cronjob and check WHMCS Health Status. Cronjob should be shown in green status.

 

(On your server, Time of cronjob should be same as WHMCS cronjob time you set in Automation settings)

Edited by DewlanceHosting

Share this post


Link to post
Share on other sites
8 hours ago, DewlanceHosting said:

(On your server, Time of cronjob should be same as WHMCS cronjob time you set in Automation settings)

This is not recommended, we recommend the cronjob be set to execute every 5 minutes. This ensures the cron can handle tasks throughout the day and will then process the daily tasks at the time set under Automation Settings.

We have further details on this in our docs here:

https://docs.whmcs.com/Crons

Share this post


Link to post
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.


  • Similar Content

    • By sokalsondha
      Hello everyone
      Can you help me something on this please.
       
      In my invoice list I have changed the button name from Unpaid to Make-Payment. Because what I want is when my customer click on this make payment button it will be take them direct to payment page instead of viewinvoice page..
      Because I have put a button to download the pdf invoice so my customer can download the pdf invoice if they want to see it.
      But I really need to skip the viewinvoice page. 
      So if I have PayPal as a payment method for that invoice then when client click on that Make-Payment button it will be take them to PayPal directly.
       
      Can someone help me with the code in the template file.
       
      Thanks a million in advance
      Please see the current invoice list page
       

    • By tldagent
      Hey all. Have a question about domain names and the sync cron. Many of my domains are in ResellerClub and none of the domain expiration dates sync. I used to get notifications in the cron emails and since the last update. I'm using WHMCS 7.10.2

      Is there something I may have missed? In my email I get (thedomainname): In Sync but that's it. Some show expired in WHMS but they aren't in ResellerClub.

      Thanks in advance for pointing me in a direction to get this working. I've searched all over for answers. TY.
    • By Mark Coates
      hi all
      i have noticed that my automation emails from my site are duplicated twice. these emails can be from the orders, new signup's, product renewals and ticket rules like auto close ect.
      the only emails which are not duplicated are the ones i do manually like going to a client and clicking send mail and the mass mail feature.
      does anyone have any ideas on this? i originally thought about there being 2 cron jobs active for some reason but no there is only 1.
       
      Thanks
      mark
    • By sokalsondha
      Hello everyone.
      i hope everyone is doing great. i need again some help from the community. hope someone correct my invoicepdf tpl file so it can complete my demand.
      i have done some modify but  i can't understand how to fix some more.
       
      i want to make my invoice like this

       
      and this is my current code. its already modified mostly
       
      <?php
      # Logo
      $logoFilename = 'placeholder.png';
      if (file_exists(ROOTDIR . '/assets/img/logo.png')) {
          $logoFilename = 'logo.png';
      } elseif (file_exists(ROOTDIR . '/assets/img/logo.jpg')) {
          $logoFilename = 'logo.jpg';
      }
      $pdf->Ln(5);
      $pdf->SetFont($pdfFont, 'B', 15);
      $pdf->SetFillColor(255);
      $pdf->SetFont($pdfFont, '', 16);
      $pdf->Cell(100, 6, "My Bill Summary", 0, 1, 'L', '1');
      $pdf->Image(ROOTDIR . '/assets/img/' . $logoFilename, 120, 25, 75);
      # Company Details
      $pdf->SetXY(15, 70);
      $pdf->SetFont($pdfFont, '', 13);
      foreach ($companyaddress as $addressLine) {
          $pdf->Cell(180, 4, trim($addressLine), 0, 1, 'R');
          $pdf->SetFont($pdfFont, '', 9);
      }
      if ($taxCode) {
          $pdf->Cell(180, 4, $taxIdLabel . ': ' . trim($taxCode), 0, 1, 'R');
      }
      $pdf->Ln(5);
      # Clients Details
      $pdf->SetXY(15, 70);
      $pdf->SetFont($pdfFont, 'B', 10);
      $pdf->SetFont($pdfFont, '', 9);
      if ($clientsdetails["companyname"]) {
          $pdf->Cell(0, 4, $clientsdetails["companyname"], 0, 1, 'L');
          $pdf->Cell(0, 4, Lang::trans('invoicesattn') . ': ' . $clientsdetails["firstname"] . ' ' . $clientsdetails["lastname"], 0, 1, 'L');
      } else {
          $pdf->Cell(0, 4, $clientsdetails["firstname"] . " " . $clientsdetails["lastname"], 0, 1, 'L');
      }
      $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["postcode"], 0, 1, 'L');
      $pdf->Cell(0, 4, $clientsdetails["country"], 0, 1, 'L');
      if (array_key_exists('tax_id', $clientsdetails) && $clientsdetails['tax_id']) {
          $pdf->Cell(0, 4, $taxIdLabel . ': ' . $clientsdetails['tax_id'], 0, 1, 'L');
      }
      $pdf->Ln(10);
      $pdf->Ln(10);
      $pdf->Ln(10);
      # Header Bar
      /**
       * Invoice header
       *
       * You can optionally define a header/footer in a way that is repeated across page breaks.
       * For more information, see http://docs.whmcs.com/PDF_Invoice#Header.2FFooter
       */
      $pdf->SetFont($pdfFont, 'B', 15);
      $pdf->SetFillColor(239);
      $pdf->SetFont($pdfFont, '', 12);
      if ($customfields) {
          foreach ($customfields as $customfield) {
              $pdf->Cell(125, 6, $customfield['fieldname'] . ':                                                            ' . $customfield['value'], 0, 1, 'L', '1');
          }
      }
      $pdf->Cell(125, 6, "Invoice Number " . ':                                                               ' . $invoiceid, 0, 1, 'L', '1');
      $pdf->Cell(125, 6, "Bill Issue Date" . ':                                                              ' . $datecreated, 0, 1, 'L', '1');
      $pdf->Cell(125, 6, "Billing Period" . ':                                                              ' . $datecreated, 0, 1, 'L', '1');
      $pdf->Ln(10);
                                           
      $startpage = $pdf->GetPage();
      # Invoice Items
      $tblhtml = '<table width="70%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0">
          <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;">
              <td width="80%">' . Lang::trans('invoicesdescription') . '</td>
              <td width="20%">' . Lang::trans('quotelinetotal') . '</td>
          </tr>';
      foreach ($invoiceitems as $item) {
          $tblhtml .= '
          <tr bgcolor="#fff">
              <td align="left">' . nl2br($item['description']) . '<br /></td>
              <td align="center">' . $item['amount'] . '</td>
          </tr>';
      }
      $tblhtml .= '
          <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
              <td align="right">' . Lang::trans('invoicessubtotal') . '</td>
              <td align="center">' . $subtotal . '</td>
          </tr>';
      if ($taxname) {
          $tblhtml .= '
          <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
              <td align="right">' . $taxrate . '% ' . $taxname . '</td>
              <td align="center">' . $tax . '</td>
          </tr>';
      }
      if ($taxname2) {
          $tblhtml .= '
          <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
              <td align="right">' . $taxrate2 . '% ' . $taxname2 . '</td>
              <td align="center">' . $tax2 . '</td>
          </tr>';
      }
      $tblhtml .= '
          <tr height="30" bgcolor="#efefef" style="font-weight:bold;">
              <td align="right">' . Lang::trans('invoicescredit') . '</td>
              <td align="center">' . $credit . '</td>
          </tr>
          <tr height="30" bgcolor="#efefef" style="font-weight:bold;font-size:14px;">
              <td align="right">' . "Total Amount Due" . '</td>
              <td align="center">' . $total . '</td>
          </tr>
      </table>';
      $pdf->writeHTML($tblhtml, true, false, false, false, '');
      $pdf->Ln(5);
      if ($status == 'Unpaid'){
      $html = "<h2 style=\"color:red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please pay by ${duedate} </h2>";
      $pdf->writeHTML($html, true, false, false, false, '');
      $pdf->Ln(10);
      $pdf->SetFont($pdfFont, 'B', 15);
      $pdf->SetFillColor(239);
      $pdf->SetFont($pdfFont, '', 10);
      $pdf->Cell(125, 6, "Failure to pay your account in full may result in loss of service.", 0, 1, 'L', '1');
      $pdf->Cell(125, 6, "Reactivation of your service could take up to 7 days and will incur a fee. ", 0, 1, 'L', '1');
      $pdf->Ln(10);
      }
      # Notes
      if ($notes) {
          $pdf->Ln(5);
          $pdf->SetFont($pdfFont, '', 8);
          $pdf->MultiCell(170, 5, Lang::trans('invoicesnotes') . ': ' . $notes);
      }
      /**
       * Invoice footer
       */
      ============================
      can someone please correct the code so my pdf invoice will be looks same like the image i provide
       
       
      thanks everyone and plesae stay safe
    • By eubanksto
      I have two accounts that don't have a credit card on file. (They were lost during a migration somehow). And I don't know what's causing those accounts to be delivered an email EVERY day that says "We tried to bill your card but you don't have one on file."
      What is the setting that's causing this?
      The only things I suspect are 2 settings in automation.
      1. "Retry every week for..." was set to 0 (but I thought that meant disable not every day.
      2. The "Send invoice payment reminder" for 2nd and 3rd were both set to 0 also. But those specifically say 0 to disable.
      I don't feel like either of those should behave that way though.
  • 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