Jump to content

Swehoster

Senior Member
  • Content Count

    43
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Swehoster

  • Rank
    Level 2 Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi. Since we use the "Client Group" feature it would be great if we could use support departments for only certain groups. Has someone created a hook or have any idea on how to accomplish this? Best regards Fredrik
  2. Is there no one that can give me something to test? I really need to stop the hook for 3 services.
  3. Thank you. We have a module that runs just fine. When this is done we have a hook that do some extra stuff after the module is run. It's this that I would like to skip for 3 services, while running for all other services.
  4. Thank you Brian. I tried that but it when I run module create on order with that pid it still provisioned the AfterModuleCreate. I just can't understand why this doesn't work?
  5. It runs on every hosting service at the moment. I would like to exclude a couple of produtcs that don't need this to be run.
  6. Hi, I need help with a hook "AfterModuleCreate". I need it to skip running on certain products. I've tried with the following: add_hook("AfterModuleCreate",0,"runFeatureHook",""); if (!($vars['params']['pid'] === '123') || ($vars['params']['pid'] === '124') || ($vars['params']['pid'] === '125')) { function runFeatureHook($vars) { my-function } } Best regards Fredrik
  7. I noticed that the rounding only happens as a "view", in the DB the actual price still exist, not rounded.
  8. I don't think the enforced Euro in Sweden will be for a long time. I can modify the comma but that still sends the data for invoices and make the invoice display the comma.
  9. This is should be implemented for the invoice total. We transfer the invoicing to an external system to generate the printed invoices and in some case other as well. This is not only for the client view. It could be a solution to remove the comma, I'll look into it.
  10. Thank you. Regarding the rounding that's fine. Every store in Sweden work like this. There is online or physical. I just think it's strange since the feature is in place for a certain currency format but not the rest. It should be a checkbox to enable it on every format instead. If I use it in cart I'll get a faulty value on invoice? And what happens with all current clients?
  11. Hi, That's not the problem here. We would like the final total to be rounded, 99,49 = 99 and 99,50 = 100. I can use your formula but the rounding doesn't work. It only work with 1,234
  12. Hi, We need to have a rounding feature for making the invoices better. I know there is a feature if I choose the currency format 1,234 in WHMCS but that doesn't work in Sweden or many other countries. We need to use the format 123,45. We writ one thousand as 1000 NOT 1,000. Our clients call us in 5 seconds and wonder why they should pay only 1 (one) sek instead of 1000 (one thousand). Does anyone know if this can be accomplished by a hook or something? We only use 1 currency. I've followed this request, https://requests.whmcs.com/topic/rounding-invoice-total-due-amount-to-the-nearest-decimal But WHMCS say that my request isn't on the agenda.
  13. Thank you Brian, I'll save this.
  14. In our case it works just fine. But how would I be able to use that kind of query in the "Capsule"? It would be great to know how to use your "status IN ("Active", "Grace", "Redemption", "Expired")" Regards Fredrik
  15. Thank you all. I finally managed to get it running with the following code. <?php // ************************************************************************* // * Generate invoices for client domains with certain registrar. // * // * CreateInvoice: // * https://developers.whmcs.com/api-reference/createinvoice/ // * Interacting with the Database: // * https://developers.whmcs.com/advanced/db-interaction/ // * GetTLDPricing: // * https://developers.whmcs.com/api-reference/gettldpricing/ // * // ************************************************************************* // * @author Fredrik Hallgren // * @copyright Ballou Internet Services AB 2019 // * @version WHMCS Version: 7.7.1 // ************************************************************************* use WHMCS\ClientArea; use WHMCS\Database\Capsule; define('CLIENTAREA', false); require __DIR__ . '/init.php'; //### Get pricing $tldPrices = localAPI('GetTLDPricing', ['currencyId' => '1']); //### Get UserID & Domains foreach (Capsule::table('tbldomains')->select('userid','domain')->where([['registrar', '=', 'theregistrar'],['status', '=', 'Active']])->get() as $domains) { $oneDomain = ['domain' => $domains->domain, 'price' => getRenewPrice($tldPrices, $domains->domain)]; $invoiceData[$domains->userid][] = $oneDomain; } //### Get domains per user and create array foreach($invoiceData as $userId => $domains) { $postData = array( 'userid' => $userId, 'status' => 'Unpaid', 'sendinvoice' => '1', 'paymentmethod' => 'paypal', 'taxrate' => '25.00', 'date' => date('Y-m-d'), 'duedate' => date('Y-m-d', strtotime('+30 day')), 'autoapplycredit' => '0', ); $index = 0; foreach ($domains as $domain) { $index++; $postData['itemdescription' . $index] = 'Renewal of domain: ' . $domain['domain']; $postData['itemamount' . $index] = $domain['price']; $postData['itemtaxed' . $index] = '1'; } $results = localAPI('CreateInvoice', $postData); } //### Get price per TLD (add discount here if needed) function getRenewPrice($tldPrices, $domain) { $tld = ltrim(strstr($domain, '.'), '.'); return $tldPrices["pricing"][$tld]["renew"]["1"]; } ?>
×
×
  • 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