Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Kian last won the day on May 25

Kian had the most liked content!

Community Reputation

235 Excellent

About Kian

  • Rank
    Senior Member

Recent Profile Visitors

8169 profile views
  1. As far as I know it should appear on new orders only.
  2. Setup > General Settings > Ordering> Only Auto Provision for Existing
  3. Order view, below "Order Items".
  4. I suppose you're using Setup > General Settings > Invoices > Store Client Data Snapshot. If so, you have to manually edit mod_invoicedata table from database like follows. The boring part is that the table doesn't have any index hence you can't edit "address1" on the fly with double-click. You'll need to... UPDATE `mod_invoicedata` SET `clientsdetails` = '{blabla}' WHERE `invoiceid` = '{invoice_id}'
  5. Change it like follows: if ($( "div[menuitemname='My Services Status Filter'] a[class='list-group-item active']").attr('menuitemname') != 'Active') { $("a#Primary_Sidebar-My_Services_Status_Filter-Active").trigger("click"); }
  6. As briand said, {ID} doesn't exist but if you print() and {debug} for sure you can find the ID somewhere. Anyway you can add as many auto-tags as you want with action hooks so that things like {ID}, {COUNTRY}, {CURRENCY} etc. will work.
  7. Invoice numbers (aka {NUMBER} and tblinvoices.invoicenum) are not part of Snapshots. I was saying that the only way to preserve this value is that you code an action hook that stores it somewhere. Basically I'm suggesting to extend the concept of "Client Data Snapshot" to invoice numbers. This way you always know what was the original number the proforma before it turned into an invoice. It sounds boring... well it is. The quickest workaround is to do what @VirtualWorldGlobal suggested. Get rid of {NUMBER} and use {ID} so that you can do the following.
  8. As far as I know this is not always true since it depends on how Auto-Tags have been used. {NUMBER} in fact doesn't always corresponds to tblinvoice.id (the number in the query string) because it can be freely changed from Tax Configuration > Next Invoice Number. You have two option here: Get rid of {NUMBER} and use ID, it never changes Snapshot invoice numbers
  9. <?php use WHMCS\Database\Capsule; add_hook('EmailPreSend', 1, function($vars) { $disallowedGroupID = '1'; // Insert Client Group ID $emailTemplates = array('Automated Password Reset', 'Password Reset Validation', 'Password Reset Confirmation'); // Email Templates to block if (in_array($vars['messagename'], $emailTemplates)) { if (!Capsule::select(Capsule::raw('SELECT id FROM tblclients WHERE id = "' . $vars['relid'] . '" AND groupid = "' . $groupid . '" LIMIT 1'))) { $output['abortsend'] = true; return $output; } } }); This will block any email template you want but at the moment I can't remember how to block Marketing & Sign-On emails.
  10. Nah, you don't need 2x cPanel and WHMCS. Begin by pointing both domains to your server IP with record A. This way you can reach WHMCS from .com and .fr in the same time. Lastly override current language in use depending on domain name (.com for english and .fr for french) but now comes the tricky part: logins. When a customer logs to his account you have to automatically log him on all domains. The Same goes for logouts. You need to use AutoAuth and play with "invisible" redirects... well it's quite complicated to explain. I can't even understand my own code 🤣 Anyway the real problem is that «AutoAuth is deprecated as of v7.10 will be removed in v8.1. Please utilize the CreateSsoToken API which is based WHMCS Single Sign-On» The idea of re-thinking this mess with a new method makes me feel sick to my stomach.
  11. There's no Companyname column in tblhosting table that's why you have an error.
  12. Oh 😞 You could try with Mass Payment that allows customers to pay multiple invoices at once also with credit. On paper it works but keep in mind that Mass Payment can't be used in some countries where the resulting invoice would be considered a billing error.
  13. Not in the strict sense but you could turn on Setup > General Settings > Credit > Automatic Credit Use to "to automatically apply available credit from a users credit balance to recurring invoices upon creation". Keep in mind that this feature will work for all your customers.
  14. How are you running your API function? Cron maybe?
  15. Begin by creating a file named as you prefer (eg. AbortCreate.php) in includes/hooks directory. The content of this file should be the following: <?php use WHMCS\Database\Capsule; add_hook('PreModuleCreate', 1, function($vars) { $Data = Capsule::select(Capsule::raw('SELECT t1.notes FROM tblorders AS t1 LEFT JOIN tblhosting AS t2 ON t1.id = t2.orderid WHERE t2.id = "' . $vars['params']['serviceid'] . '" AND t2.orderid != "0"')); if ($Data[0]->notes) { return array('abortcmd' => true); } }); Everytime Create function triggers, this hook looks for notes in the order. If the order has a note, it returns abortcmd true. This will stop the auto-provisioning of WHMCS. Keep in mind that you need further changes to my basic example. In fact unless at some point you remove the notes from the order, the script will keep aborting the provisioning.
  • 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