Jump to content

Synister

Member
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Synister

  1. How would I add the Service ID to the Invoice Created and Credit Card Invoice Created Templates?
  2. I'm completely clueless on how to do this.
  3. 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,
  4. 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.
  5. Thanks Brian. I couldn't remember where I got it Just know it works
  6. 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); } } } });
  7. Thank brian! your a superstar. Ive learned a lot just from reading your replies to topics.
  8. Ok I think I got it <body oncopy="return false" oncut="return false" onpaste="return false">
  9. NO Im not using the Cpanel Overview.tpl Im using a custom provisioning module at this time.
  10. 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.
  11. Is there a way to prevent a client from Copy and Pasting when submitting a Ticket or replying?
  12. 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?
  13. 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>", )); });
  14. 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(); });
  15. 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 )); });
  16. 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.
  17. 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)]); }); .
  18. How would this be done? Doesn't that just change the Username?
  19. 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
  20. Hello, Id like to remove 0, O, I, l from the passwords that are generated for the service.. Is this possible?
  21. Yes. He recently updated it after my request. Thank you
  22. How could this be configured to only Accept Orders that are under $21.00 USD?
×
×
  • 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