Synister
Member-
Posts
27 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Hotfixes
Everything posted by Synister
-
How would I add the Service ID to the Invoice Created and Credit Card Invoice Created Templates?
-
I'm completely clueless on how to do this.
-
Im wanting it in the HTML invoice and PDF Invoice. Either the Service username or Service ID. Service ID would probably be better and more secure since it does not show any part of the login info. Kind of like in the attached image,
-
Is there a way to include the Service Username on the invoice? This would help clients who have multiple services know which one they are renewing.
-
Yes it works for Cron as well
-
Thanks Brian. I couldn't remember where I got it Just know it works
-
I use this and it works fine. <?php use WHMCS\Database\Capsule; add_hook('PreModuleTerminate', 1, function($vars) { $invoices = Capsule::table('tblinvoiceitems') ->where('relid', $vars['params']['serviceid']) ->where('type', '!=', 'GroupDiscount') ->get(); logActivity('Auto Cancel Invoice: Starting...'); foreach($invoices as $key){ $invoiceIDs = Capsule::table('tblinvoices') ->where('id', $key->invoiceid) ->where('status', 'Unpaid') ->value('id'); $invoiceLine = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceIDs) ->where('relid', $vars['params']['serviceid']) ->value('id'); $invoiceLines = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceIDs) ->get(); $description = Capsule::table('tblinvoiceitems') ->where('relid', $vars['params']['serviceid']) ->where('invoiceid', $invoiceIDs) ->value('description'); $discountLine = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceIDs) ->where('type', 'GroupDiscount') ->where('description', 'like', '% '.$description.'%') ->value('id'); if($invoiceIDs){ logActivity('Auto Cancel Invoice: Invoice ' . $invoiceIDs . ' has had a line removed. This invoice previously had ' . count($invoiceLines) . ' lines.'); if(count($invoiceLines) > 1){ $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoiceIDs, 'deletelineids' => array($invoiceLine), ); $results = localAPI($command, $postData); }elseif(count($invoiceLines) == 1){ logActivity('Auto Cancel Invoice: Invoice ' . $invoiceIDs . ' has been cancelled because the product was terminated.'); $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoiceIDs, 'status' => 'Cancelled', ); $results = localAPI($command, $postData); } if(count($invoiceLines) <= 2 && Capsule::table('tblinvoiceitems')->where('invoiceid', $invoiceIDs)->where('type', 'LateFee')->get()){ logActivity('Auto Cancel Invoice: Invoice ' . $invoiceIDs . ' has been cancelled because the only line was a Late Fee.'); $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoiceIDs, 'status' => 'Cancelled', ); $results = localAPI($command, $postData); } if($discountLine){ logActivity('Auto Cancel Invoice: Invoice ' . $invoiceIDs . ' had a Group Discount. This has been removed.'); $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoiceIDs, 'deletelineids' => array($discountLine), ); $results = localAPI($command, $postData); } } } });
-
What Im actually trying to do is prevent clients from copy/paste their username/password into the ticket area. So maybe just way to prevent in on the overview.tpl file would work, since currently that is the only place the username and password are visible. I get tickets where clients say their username/password do not work. But then they copy and paste it into the ticket which allows them to send the correct username and password. However that is not the username and password they are typing. Usually happens when the username or password contains " Il0O" in them. I want to prevent them from being able to copy/paste it when then would require them to type it and then my staff could see the exact error they are doing when typing their username and password. It might not be a good idea to limit the ticket area due to there may be a error or something they would need to copy/paste in the future.
-
Client Area panel only If Client has active Service
Synister replied to Synister's question in Building Modules
Thank Brian. That did the trick. -
Client Area panel only If Client has active Service
Synister replied to Synister's question in Building Modules
Today while testing this a little further I noticed this. If Client has never ordered any products the Panel does not show. If Client has and Products (Active/Canceled/ Terminated) The panel shows. How can I get it to only show if a client has a product that is active? -
Client Area panel only If Client has active Service
Synister replied to Synister's question in Building Modules
Thank you. Works perfectly -
Client Area panel only If Client has active Service
Synister replied to Synister's question in Building Modules
I removed the move to front, still no luck. Now it wont show up on either Active or No Active Product clients. I turned on display error and nothing showed. <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $client = Menu::context('client'); $activeorders = $client->orders->where('status','Active')->count(); if ($client && $activeorders > 0) { $fraudPanel = $homePagePanels->addChild('account status', array( 'label' => 'Account Status', 'icon' => 'fas fa-user-shield', 'extras' => array( 'color' => 'blue', ), 'bodyHtml' => "<p>Account Status: <strong>Premium Account</strong></p>", )); }); -
Client Area panel only If Client has active Service
Synister replied to Synister's question in Building Modules
Ok that did not work. Even adding the code on the Post you shared did not work. It shows if client has active product, but if client does not have active product they get a OOPS page. Below is what I used just to see if it would work. It is from the link you shared. <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $client = Menu::context('client'); $activeorders = $client->orders->where('status','Active')->count(); if ($client && $activeorders > 0) { $fraudPanel = $homePagePanels->addChild('account status', array( 'label' => 'Account Status', 'icon' => 'fas fa-user-shield', 'extras' => array( 'color' => 'blue', ), 'bodyHtml' => "<p>Account Status: <strong>Premium Account</strong></p>", )); } // Showing to First Panel $fraudPanel->moveToFront(); }); -
Im wanting to add a custom Client Area Panel but only want it to show if client has a active service. If not active service or service is Canceled, Terminated, Pending, ETC I dont want the panel to show. is this possible? <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $ServiceMessage = <<<EOT <p> PANNEL MESSAGE HERE </p> EOT; $homePagePanels->addChild('servmsg', array( 'label' => 'PANEL TITLE HERE', 'icon' => 'fa-exclamation-triangle', 'order' => 10, 'extras' => array( 'color' => 'pomegranate', 'btn-link' => 'http://button.link.here', // button link - CHANGE THIS 'btn-text' => 'BUTTON TITLE HERE', 'btn-icon' => 'fa-arrow-right', ), 'bodyHtml' => $ServiceMessage, 'footerHtml' => 'Thank You for Choosing Us.', // bottom message )); });
-
Adding back the Manage button on product page.
Synister replied to Chris74's topic in Developer Corner
Nice, Thanks Ive been wanting to add a manage button/icon back for awhile. Question. Is there a way to make the Service List default to Active Service on top/Inactive Service on bottom. -
Remove 0, O, I, l from Auto generated password for Service
Synister replied to Synister's topic in Developer Corner
I tried this and it still does not use only the selected letters for the password <?php /** * Stronger Password Generator for WHMCS Provisioning v1 * * @package WHMCS * @copyright Katamaze * @link https://katamaze.com * @author Davide Mantenuto <info@katamaze.com> */ use WHMCS\Database\Capsule; add_hook('OverrideModuleUsernameGeneration', 1, function($vars) { $password = substr(str_shuffle('0123456789'), 0, $length = '10'); Capsule::table('tblhosting')->where('id', $vars['params']['serviceid'])->update(['password' => Encrypt($password)]); }); . -
Remove 0, O, I, l from Auto generated password for Service
Synister replied to Synister's topic in Developer Corner
How would this be done? Doesn't that just change the Username? -
Remove 0, O, I, l from Auto generated password for Service
Synister replied to Synister's topic in Developer Corner
I have tried v1 and v2 and it doesn't effect the password. I even tried setting it so it only generated 1234567890 to test it and when ran a test account and the Password still had mixed letters. Using 7.10.2 -
Yes. He recently updated it after my request. Thank you
-
How could this be configured to only Accept Orders that are under $21.00 USD?
