Jump to content

DennisMidjord

Level 2 Member
  • Content count

    220
  • Joined

  • Last visited

  • Days Won

    3

DennisMidjord last won the day on November 24 2018

DennisMidjord had the most liked content!

Community Reputation

27 Excellent

About DennisMidjord

  • Rank
    Level 2 Member
  1. Is it possible to have regex validation on some fields from additionalfields.php?
  2. It can also be done using a hook. <?php $daysBeforeCancel = '60'; //Change this to how many days you want to wait for the system to cancel an invoice after the due date use WHMCS\Database\Capsule; add_hook('DailyCronJobPreEmail', 1, function($vars) { $command = 'GetInvoices'; $postData = array( 'status' => 'Overdue', 'limitnum' => '700', ); $results = localAPI($command, $postData); foreach ($results['invoices']['invoice'] as $cancelInvoice){ if(strtotime($cancelInvoice['duedate']) < strtotime($daysBeforeCancel)) { $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $cancelInvoice['id'], 'status' => 'Cancelled', ); $results = localAPI($command, $postData); }; } });
  3. Hi, We became aware of an issue with the Configurable Package Addon after updating to cPanel v76. After discussing with both cPanel and WHMCS about this, it seems to be a result of this change in cPanel: https://documentation.cpanel.net/display/CL/76+Change+Log When creating a new account that would be using the 'Custom' package (that doesn't exist in WHM), you'd get the following error: To fix the issue, you need to create the Custom package on each cPanel server in WHM. If you set everything to Unlimited and only have configured Disk Space in WHMCS, you'll end up with a cPanel account that has a limited disk space but unlimited resources of everything else. Make sure to set static values for every option in WHM that are not configurable by the Configurable Package Addon.
  4. DennisMidjord

    Hook to cancel invoices for terminated products

    //Updated to only target products of Hosting-type. <?php use WHMCS\Database\Capsule; add_hook('PreModuleTerminate', 1, function($vars) { $invoiceid = Capsule::table('tblinvoiceitems') ->where('relid', '=', $vars['params']['serviceid']) ->where('type','Hosting') ->orderBy('duedate', 'desc') ->first(); Capsule::table('tblinvoices') ->where('id', '=', $invoiceid->invoiceid) ->update(['Status' => 'Cancelled']); });
  5. DennisMidjord

    Sort by date and get latest

    Really? When I was messing with it, I did use value and it gave me the correct value from invoiceid, but I was just afraid that it wouldn't always work as intended. I only need the fvery first, and I thought that 'first' was the only way to achieve this. Thanks for the advise! We're only using this for game hosting, so there's really only type of product, but I'll update it anyways just to be sure.
  6. Don't know if this is the right category to post this in, but I thought I wanted to share this. It's a very small hook that cancels an invoice once the product gets terminated. //<?php use WHMCS\Database\Capsule; add_hook('PreModuleTerminate', 1, function($vars) { $invoiceid = Capsule::table('tblinvoiceitems') ->where('relid', '=', $vars['params']['serviceid']) ->orderBy('duedate', 'desc') ->first(); Capsule::table('tblinvoices') ->where('id', '=', $invoiceid->invoiceid) ->update(['Status' => 'Cancelled']); }); Any feedback is much appreciated.
  7. DennisMidjord

    Sort by date and get latest

    Nevermind, I figured it out. Results were returned as an object, so I had to to $invoiceid->invoiceid to show only the id of the invoice.
  8. DennisMidjord

    Sort by date and get latest

    Hi, I'm trying to get the date for the latest invoice for a specific product, but I have no luck. Can anyone tell me where I go wrong? $invoiceid = Capsule::table('tblinvoiceitems')->where('relid', 'xxxx')->orderBy('duedate', 'desc')->first();
  9. Is it possible to exclude a certain tld from having anything changed through the domain syncronization cron? .dk domains are managed through DK Hostmaster (the DK registry), and the status gets set to transferred away every time the cron runs. This makes it impossible for our clients to manage DNS for the domain. Currently we have a hook set to run after the cron job that sets the status to active manually.
  10. Hi, I'm wondering why the following email template serves as a receipt for payment. It says that payment failed, but also that the email serves as a receipt for the payment. I'm just going to change it, but I wonder why it's made like this.
  11. DennisMidjord

    Tracking pixel on Order Paid

    Hi, Any ideas how this could be accomplished? We need different tracking pixels on 'order complete' for different products. If client buys and pays for Product A, one pixel should be shown in the code. If client buys and pays for Product B, some other pixel should be shown. I'm trying to add this as a hook, but I'd really appreciate some help. It should also be said that the pixel should be visible on a page that will always be shown after client has paid for the invoice.
  12. Has anyone tried this? I'm really not a fan of this design. First, you select which webhosting package you need - and afterwards, it looks like you're ordering/transferring a domain. Can configureproductdomain.tpl be added to configureproduct.tpl without any issues?
  13. DennisMidjord

    Allow client to upgrade eg. disk space (cPanel)

    Can confirm that it's working. I also noticed that I already had a license for the addon, but too late... Now I have two 😁
  14. DennisMidjord

    Allow client to upgrade eg. disk space (cPanel)

    Response from WHMCS:
  15. DennisMidjord

    Run hook on specific domain order

    I don't think that'll work for us. We don't need to set the entire order as fraudulent, only the .dk domain. Would you care to take a quick glanse at this: It seems to work just fine, but I'm curious whether or not it will result in any problems.
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines