Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About mhermann

  • Rank

Recent Profile Visitors

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

  1. Yes it is the hexonet module. I opened a bug report. In case someone has the same issue: https://github.com/hexonet/whmcs-ispapi-registrar/issues/168
  2. Hi. I am getting this error every time domain sync runs at the sync isn't working anymore. Any idea? [WHMCS Application] ERROR: Error: Object of class WHMCS\Domains\Domain could not be converted to string in /MYPATHTOWHMCS//modules/registrars/ispapi/lib/sdk/src/APIClient.php:406 Stack trace: #0 /MYPATHTOWHMCS//modules/registrars/ispapi/lib/sdk/src/APIClient.php(406): preg_replace() #1 /MYPATHTOWHMCS//modules/registrars/ispapi/lib/sdk/src/APIClient.php(472): HEXONET\APIClient->flattenCommand() #2 /MYPATHTOWHMCS//modules/registrars/ispapi/lib/Ispapi.php(416): HEXONET\APIClient->request() #3 /MYPATHTOWHMCS//modules/registrars/ispapi/lib/DomainTransfer.php(76): WHMCS\Module\Registrar\Ispapi\Ispapi::call() #4 /MYPATHTOWHMCS//modules/registrars/ispapi/ispapi.php(3109): WHMCS\Module\Registrar\Ispapi\DomainTransfer::getSuccessLog() #5 /MYPATHTOWHMCS//vendor/whmcs/whmcs-foundation/lib/Module/AbstractModule.php(0): ispapi_TransferSync() #6 /MYPATHTOWHMCS//vendor/whmcs/whmcs-foundation/lib/Module/Registrar.php(0): WHMCS\Module\AbstractModule->call() #7 /MYPATHTOWHMCS//vendor/whmcs/whmcs-foundation/lib/Cron/Task/DomainTransferSync.php(0): WHMCS\Module\Registrar->call() #8 /MYPATHTOWHMCS//vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): WHMCS\Cron\Task\DomainTransferSync->__invoke() #9 /MYPATHTOWHMCS//vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): WHMCS\Scheduling\Task\AbstractTask->execute() #10 /MYPATHTOWHMCS//vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Scheduling\Task\AbstractTask->run() #11 /MYPATHTOWHMCS//vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Cron\Console\Command\AbstractCronCommand->executeCollection() #12 /MYPATHTOWHMCS//vendor/symfony/console/Command/Command.php(255): WHMCS\Cron\Console\Command\AbstractCronCommand->execute() #13 /MYPATHTOWHMCS//vendor/symfony/console/Application.php(912): Symfony\Component\Console\Command\Command->run() #14 /MYPATHTOWHMCS//vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand() #15 /MYPATHTOWHMCS//vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun() #16 /MYPATHTOWHMCS//crons123456/cron.php(0): Symfony\Component\Console\Application->run() #17 {main} {"exception":"[object] (Error(code: 0): Object of class WHMCS\\Domains\\Domain could not be converted to string at /MYPATHTOWHMCS//modules/registrars/ispapi/lib/sdk/src/APIClient.php:406)"} []
  3. I just fixed the issue for us. I will share the code with you. Just save it into an extra file income_by_product_yearly.php in the module/report folder <?php //Modifizierte income_by_product.php von Max //Ausgabe nach Jahren nicht mehr nach Monaten //16.02.2021 use Illuminate\Database\Query\Builder; use WHMCS\Carbon; use WHMCS\Database\Capsule; if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } //$pmonth = str_pad((int)$month, 2, "0", STR_PAD_LEFT); $year = $year; $reportdata["title"] = "Income by Product for " . $year; $reportdata["description"] = "This report provides a breakdown per product/service of invoices paid in a given month. Please note this excludes overpayments & other payments made to deposit funds (credit), and includes invoices paid from credit added in previous months, and thus may not match the income total for the month."; $reportdata["currencyselections"] = true; $reportdata["tableheadings"] = array("Product Name","Units Sold","Value"); $products = $addons = array(); $dateRange = Carbon::create( $year, 1, 1 ); # Loop Through Products $result = Capsule::table('tblinvoiceitems') ->join('tblinvoices', 'tblinvoices.id', '=', 'tblinvoiceitems.invoiceid') ->join('tblhosting', 'tblhosting.id', '=', 'tblinvoiceitems.relid') ->join('tblclients', 'tblclients.id', '=', 'tblinvoices.userid') ->whereBetween( 'tblinvoices.datepaid', [ $dateRange->startOfYear()->toDateTimeString(), $dateRange->endOfYear()->toDateTimeString(), ] ) ->where(function (Builder $query) { $query->where('tblinvoiceitems.type', 'Hosting') ->orWhere('tblinvoiceitems.type', 'Setup') ->orWhere('tblinvoiceitems.type', 'like', 'ProrataProduct%'); }) ->where('currency', $currencyid) ->groupBy('tblhosting.packageid') ->select( [ Capsule::raw('tblhosting.packageid as packageId'), Capsule::raw('COUNT(*) as unitsSold'), Capsule::raw('SUM(tblinvoiceitems.amount) as amount') ] )->get(); foreach ($result as $data) { $products[$data->packageId] = [ 'amount' => $data->amount, 'unitssold' => $data->unitsSold, ]; } $result = Capsule::table('tblinvoiceitems') ->join('tblinvoices', 'tblinvoices.id', '=', 'tblinvoiceitems.invoiceid') ->join('tblhosting', 'tblhosting.id', '=', 'tblinvoiceitems.relid') ->join('tblclients', 'tblclients.id', '=', 'tblinvoices.userid') ->whereBetween( 'tblinvoices.datepaid', [ $dateRange->startOfYear()->toDateTimeString(), $dateRange->endOfYear()->toDateTimeString(), ] ) ->where('tblinvoiceitems.type', 'PromoHosting') ->where('currency', $currencyid) ->groupBy('tblhosting.packageid') ->select( [ Capsule::raw('tblhosting.packageid as packageId'), Capsule::raw('COUNT(*) as unitsSold'), Capsule::raw('SUM(tblinvoiceitems.amount) as amount') ] ) ->get(); foreach ($result as $data) { $products[$data->packageId]["amount"] += $data->amount; } # Loop Through Addons $result = Capsule::table('tblinvoiceitems') ->join('tblinvoices', 'tblinvoices.id', '=', 'tblinvoiceitems.invoiceid') ->join('tblhostingaddons', 'tblhostingaddons.id', '=', 'tblinvoiceitems.relid') ->join('tblclients', 'tblclients.id', '=', 'tblinvoices.userid') ->whereBetween( 'tblinvoices.datepaid', [ $dateRange->startOfYear()->toDateTimeString(), $dateRange->endOfYear()->toDateTimeString(), ] ) ->where('tblinvoiceitems.type', 'Addon') ->where('currency', $currencyid) ->groupBy('tblhostingaddons.addonid') ->select( [ Capsule::raw('tblhostingaddons.addonid as addonId'), Capsule::raw('COUNT(*) as unitsSold'), Capsule::raw('SUM(tblinvoiceitems.amount) as amount') ] )->get() ->all(); foreach ($result as $data) { $addons[$data->addonId] = [ 'amount' => $data->amount, 'unitssold' => $data->unitsSold, ]; } $total = 0; $itemtotal = 0; $firstdone = false; $result = Capsule::table('tblproducts') ->join( 'tblproductgroups', 'tblproductgroups.id', '=', 'tblproducts.gid' ) ->orderBy('tblproductgroups.order') ->orderBy('tblproducts.order') ->orderBy('tblproducts.name') ->get( [ 'tblproducts.id', 'tblproducts.name', Capsule::raw('`tblproductgroups`.`name` as groupname') ] ) ->all(); foreach ($result as $data) { $pid = $data->id; $group = $data->groupname; $prodname = $data->name; if ($group!=$prevgroup) { $total += $itemtotal; if ($firstdone) { $reportdata["tablevalues"][] = array('','<strong>Sub-Total</strong>','<strong>'.formatCurrency($itemtotal).'</strong>'); $chartdata['rows'][] = array('c'=>array(array('v'=>$prevgroup),array('v'=>$itemtotal,'f'=>formatCurrency($itemtotal)))); } $reportdata["tablevalues"][] = array("**<strong>$group</strong>"); $itemtotal = 0; } $amount = $products[$pid]["amount"]; $number = $products[$pid]["unitssold"]; $itemtotal += $amount; if (!$amount) $amount="0.00"; if (!$number) $number="0"; $amount = formatCurrency($amount); $reportdata["tablevalues"][] = array($prodname,$number,$amount); $prevgroup = $group; $firstdone = true; } $total += $itemtotal; $reportdata["tablevalues"][] = array('','<strong>Sub-Total</strong>','<strong>'.formatCurrency($itemtotal).'</strong>'); $chartdata['rows'][] = array('c'=>array(array('v'=>$group),array('v'=>$itemtotal,'f'=>formatCurrency($itemtotal)))); $reportdata["tablevalues"][] = array("**<strong>Addons</strong>"); $itemtotal = 0; $result = Capsule::table('tbladdons') ->orderBy('name') ->get( [ 'id', 'name', ] ) ->all(); foreach ($result as $data) { $addonid = $data->id; $prodname = $data->name; $amount = $addons[$addonid]["amount"]; $number = $addons[$addonid]["unitssold"]; $itemtotal += $amount; if (!$amount) $amount="0.00"; if (!$number) $number="0"; $amount = formatCurrency($amount); $reportdata["tablevalues"][] = array($prodname,$number,$amount); $prevgroup = $group; } $itemtotal += $addons[0]["amount"]; $number = $addons[0]["unitssold"]; $amount = $addons[0]["amount"]; if (!$amount) $amount="0.00"; if (!$number) $number="0"; $reportdata["tablevalues"][] = array('Miscellaneous Custom Addons',$number,formatCurrency($amount)); $total += $itemtotal; $reportdata["tablevalues"][] = array('','<strong>Sub-Total</strong>','<strong>'.formatCurrency($itemtotal).'</strong>'); $chartdata['rows'][] = array('c'=>array(array('v'=>"Addons"),array('v'=>$itemtotal,'f'=>formatCurrency($itemtotal)))); $itemtotal = 0; $reportdata["tablevalues"][] = array("**<strong>Miscellaneous</strong>"); $data = Capsule::table('tblinvoiceitems') ->join('tblinvoices', 'tblinvoices.id', '=', 'tblinvoiceitems.invoiceid') ->join('tblclients', 'tblclients.id', '=', 'tblinvoices.userid') ->whereBetween( 'tblinvoices.datepaid', [ $dateRange->startOfYear()->toDateTimeString(), $dateRange->endOfYear()->toDateTimeString(), ] ) ->where('tblinvoiceitems.type', 'Item') ->where('tblclients.currency', $currencyid) ->first( [ Capsule::raw('COUNT(*) as number'), Capsule::raw('SUM(tblinvoiceitems.amount) as amount') ] ); $itemtotal += $data->amount; $number = $data->number; $amount = $data->amount; if (!$amount) $amount="0.00"; if (!$number) $number="0"; $reportdata["tablevalues"][] = array('Billable Items',$number,formatCurrency($amount)); $data = Capsule::table('tblinvoiceitems') ->join('tblinvoices', 'tblinvoices.id', '=', 'tblinvoiceitems.invoiceid') ->join('tblclients', 'tblclients.id', '=', 'tblinvoices.userid') ->whereBetween( 'tblinvoices.datepaid', [ $dateRange->startOfYear()->toDateTimeString(), $dateRange->endOfYear()->toDateTimeString(), ] ) ->where('tblinvoiceitems.type', '') ->where('tblclients.currency', $currencyid) ->first( [ Capsule::raw('COUNT(*) as number'), Capsule::raw('SUM(tblinvoiceitems.amount) as amount') ] ); $itemtotal += $data->amount; $number = $data->number; $amount = $data->amount; $reportdata["tablevalues"][] = array('Custom Invoice Line Items',$number,formatCurrency($amount)); $total += $itemtotal; $reportdata["tablevalues"][] = array('','<strong>Sub-Total</strong>','<strong>'.formatCurrency($itemtotal).'</strong>'); $chartdata['rows'][] = array('c'=>array(array('v'=>"Miscellaneous"),array('v'=>$itemtotal,'f'=>formatCurrency($itemtotal)))); $total = formatCurrency($total); $chartdata['cols'][] = array('label'=>'Days Range','type'=>'string'); $chartdata['cols'][] = array('label'=>'Value','type'=>'number'); $args = array(); $args['legendpos'] = 'right'; $reportdata["footertext"] = $chart->drawChart('Pie',$chartdata,$args,'300px'); $reportdata["yearspagination"] = true;
  4. Sorry so dumm.... I created an email template of type notification. With type general ID was the userid so it is working now.
  5. Thanks for the reply brian. That is what I ended up doing. Here is the code in case anyone needs it: use WHMCS\View\Menu\Item as MenuItem; //Payment-Type Menü ausblenden add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Billing'))) { $primaryNavbar->getChild('Billing')->removeChild('Payment Methods'); } }); //Payment-Type Menü ausblenden add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account')->removeChild('Payment Methods'); } });
  6. Hi everyone. I am trying to send a client email with a custom template. $command = 'SendEmail'; $postData = array( 'messagename' => '***mytemplatename***', 'id' => 10052, 'customvars' => base64_encode(serialize($customvars)), ); return $results = localAPI($command, $postData); It returns success but I get the following activity-log-entry: "Email Sending Failed - No recipients provided for message (Subject: ***mysubject*** )" Any idea?
  7. Hi, due to one of the latest updates the new payment methods option shows up in the client area. It is in english, but I guess that is just a missing language file. My problem: We don't have any payment-gateway that is accepting creditcards. So why would we provide a form to enter credit-card-data? Can I disable that? And can I add a selfmade payment-module capturing bank-account data? Like for direct debit? I can't find the option to add a new gateway to one of these groups. THanks
  8. Hi everyone. I went through the documentation of building a merchant gateway in the dev docs. What I didn't find. I need some options to be selectable by the client when selecting the gateway during the checkout process. How do I add the client area options to the merchant gateway? Thanks!
  9. @zitu4life You are talking about a different problem. In your case: Every email from your network goes to spam folders. In my case and as I believe in davids case only WHMCS mails go to spam-folders. Every other email from my network is going into inboxes as expected.
  10. I had some issues in the beginning as well SMTP Base64 Port 587 TLS Worked for me
  11. Hi David, when I send the same e-mail, same adresse, same IP, same content from outlook instead of WHMCS it works. It must be a WHMCS problem. I ended up signing up for the AWS Mail Gateway. It's free up to a certain amount and somehow that is working. I don't know if Amazon is changing the mail headers or just has a much better reputation. However. Result: It is working now. Another anoying WHMCS-situation ended (without the help of WHMCS - of course 😉 )
  12. Hi. No we are using regular postfix on the same host sending several thounsand mails each day which don't end up in spam-folders. MX-Toolbox shows no errors for the domain and the mailserver.
  13. Everything is setup as you suggested. I also checked the mail.log and it is showing a correct sasl-auth.
  • 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