Jump to content

Swehoster

Senior Member
  • Content count

    42
  • Joined

  • Last visited

Everything posted by Swehoster

  1. Swehoster

    How to skip some products AfterModuleCreate

    Is there no one that can give me something to test? I really need to stop the hook for 3 services.
  2. 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
  3. Swehoster

    How to skip some products AfterModuleCreate

    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. Swehoster

    How to skip some products AfterModuleCreate

    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. Swehoster

    How to skip some products AfterModuleCreate

    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. Swehoster

    Rounding Invoice Total

    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.
  7. Swehoster

    Rounding Invoice Total

    I noticed that the rounding only happens as a "view", in the DB the actual price still exist, not rounded.
  8. Swehoster

    Rounding Invoice Total

    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. Swehoster

    Rounding Invoice Total

    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. Swehoster

    Rounding Invoice Total

    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. Swehoster

    Rounding Invoice Total

    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. Swehoster

    Generate invoices API

    Thank you Brian, I'll save this.
  13. Swehoster

    Generate invoices API

    Hi all. I'm in need of generating a one time invoice for about 2000 clients. It is for their domains with a certain registrar. Clients can have more than one domain and therefore there should only be one invoice with multiple domains in that case. I get domain prices and info from tbldomainpricing and tbldomains. I'm having problem with setting all together as a foreach loop around the CreateInvoice function in WHMCS. Can anyone guide me in the right direction it would be most appreciated. I've attached a test file as well. /Fredrik transfer_generate_invoice.php
  14. Swehoster

    Generate invoices API

    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. Swehoster

    Generate invoices API

    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"]; } ?>
  16. Hi. We are trying to create a custom registrar module. We have had a look at different modules to see that we get all functions correct. One thing we have found is "injectDomainObjectIfNecessary". I just don't need what it does The only problem we still have is for IDN domains. All of the special characters are removed and converted to regular. Any help to understand this or get around it would be most helpful. Best regards Fredrik
  17. Swehoster

    Smarty plugin path

    Hi, We have some custom made smarty modifiers/plugins. Before (prior to whmcs6.*) we put them in /includes/classes/Smarty/plugins, but now they don't seem to get picked up by Smarty. It feels wrong to put them in /vendor/smarty/smarty/libs/plugins because vendor is something that is handled by composer. Are there another directory configured for custom made smarty plugins? Or are there any way to configure smarty via whmcs to add another directory for plugins? //Mattias (I have created a ticket and will update when I get feedback from there)
  18. Swehoster

    data feed & windows server status

    Any news here? Is there a chance to get the files and test them? Best regards
  19. Swehoster

    limit one product per customer

    It looks like it is working on clients but not new visitors or unregistered clients/visitors.
  20. Swehoster

    limit one product per customer

    Hi. This worked great. Now on the latest version 5.2.13 I think it is not any more. I just can't say why but the check isn't done. Anyone that has experienced the same issue? Best regards
  21. Swehoster

    Invoices not set to paid

    when the payment have swedish "ören" (like cent in Euros). Somebody who have an idea of what the problem is?
  22. Swehoster

    Invoices not set to paid

    We are trying to do it automatically, but we have to set the not rounded invoices to paid manually. No we havn´t tried other currencies, do you think it might be that?
  23. Swehoster

    Can't upgrade / downgrade Products?

    We have the same issue, with products which aren´t setuped like onetime. We belive that something went wrong when we migrated the data from our previous systems...
×

Important Information

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