Jump to content

Jono

Blesta Developers
  • Posts

    376
  • Joined

  • Last visited

  • Days Won

    37

Posts posted by Jono

  1. On 5/20/2022 at 3:05 AM, Himax said:

    Any news?

    On plugins/import_manager/components/migrators/whmcs/whmcs_migrator.php line 751 change

                        $this->local->insert('invoices_recur_created', $vars);

    To

                        $this->local->duplicate('invoice_recur_id', '=', $recurring_id)->insert('invoices_recur_created', $vars);

    tblinvoiceitems must have records with a duplicate invoiceid-relid pair.  Not sure if there's a valid reason for that.

  2. Hi there, just to throw in an update.  I'm testing this yesterday and today.  Unable to reproduce by simply doing an import with a billable item with multiple invoices.  I'll look more into the code and your report to see what specific set of circumstances causes the error.

  3. Confirmed.

    Try updating app/models/invoices.php around line 1528 from:

    
                    $items[] = [
                        'service_id' => $service_id,
                        'qty' => $item->qty,
                        'amount' => $this->Currencies->convert(
                            $item->price,
                            $service->package_pricing->currency,
                            $currency,
                            Configure::get('Blesta.company_id')
                        ),
                        'description' => $item->description,
                        'tax' => !empty($item->taxes)
                    ];

    To

    
                    $items[] = [
                        'service_id' => $service_id,
                        'qty' => $item->qty,
                        'amount' => $this->Currencies->convert(
                            $item->price,
                            $service->override_currency ?? $service->package_pricing->currency,
                            $currency,
                            Configure::get('Blesta.company_id')
                        ),
                        'description' => $item->description,
                        'tax' => !empty($item->taxes)
                    ];

    I've created CORE-4441 to handle this.

  4. This query should do the trick:

    UPDATE acl_acl INNER JOIN acl_aco ON acl_aco.id = acl_acl.aco_id SET acl_acl.permission = 'allow' WHERE acl_aco.alias = 'admin_system_staff' AND acl_acl.action = 'editgroup' AND acl_acl.aro_id = 1;

    Then you can visit admin/settings/system/staff/editgroup/1/ to make sure all appropriate permissions are enabled.

  5. 3 hours ago, Blesta Addons said:

    Hello Jono,

    i have recorded a video and sent it to you in PM. as you can see it has the service_id filled, tested 3 times and the same result.

    I was able to reproduce by performing an upgrade in the admin interface (not able to replicate in client interface).  To resolve change app/controllers/admin_clients.php around line 5656 from:

                                $invoice_data = $this->makeInvoice(
                                    $client,
                                    $serviceChange,
                                    $pricing->currency,
                                    true,
                                    $service->id
                                );

    To

                                $invoice_data = $this->makeInvoice(
                                    $client,
                                    $serviceChange,
                                    $pricing->currency,
                                    true,
                                    null
                                );

    Cheers :)

  6. On 7/9/2021 at 4:47 AM, Blesta Addons said:

    it was by core, no extra plugin, the blesta used is 4.10.2 .

    Here's a video of a basic test that I performed on a 4.10.2 installation.  https://www.loom.com/share/40f5cd5005cb4799976f603b5175f1b8  As you can see, a queued upgrade created an invoice with no invoice_lines.service_id set.  Do you have any suggestions for what I might do differently to reproduce your issue?

  7. This error occurs when the new Domain Manager plugin is not install.  To resolve, install the Domain Manager or perform the following code changes:

    In core/Pricing/Modifier/Type/Description/Type/Domain/Domains.php around line 232 replace:

            try {
                Loader::loadModels($this, ['Domains.DomainsTlds']);
    
                $tld = $this->DomainsTlds->getByPackage($package_id);
                $package = (isset($tld->tld) ? $tld->tld : $package);
            } catch (Throwable $e) {
                // Nothing to do
            }

    With

            Loader::loadModels($this, ['PluginManager']);
            if ($this->PluginManager->isInstalled('domains', \Configure::get('Blesta.company_id'))) {
                Loader::loadModels($this, ['Domains.DomainsTlds']);
    
                $tld = $this->DomainsTlds->getByPackage($package_id);
                $package = (isset($tld->tld) ? $tld->tld : $package);
            }


    In core/Pricing/Presenter/Items/Service/ServiceDataItems.php around line 139 replace:

            try {
                Loader::loadModels($this, ['Domains.DomainsTlds']);
    
                $tld = $this->DomainsTlds->getByPackage($packageId);
    
                if (isset($tld->tld)) {
                    $fields['_data']['item_type'] = 'domain';
                }
            } catch (Throwable $e) {
                // Nothing to do
            }

    With

            Loader::loadModels($this, ['PluginManager']);
            if ($this->PluginManager->isInstalled('domains', \Configure::get('Blesta.company_id'))) {
                Loader::loadModels($this, ['Domains.DomainsTlds']);
    
                $tld = $this->DomainsTlds->getByPackage($packageId);
                if (isset($tld->tld)) {
                    $fields['_data']['item_type'] = 'domain';
                }
            }



    In core/Pricing/Presenter/Items/Service/ServiceItems.php around line 118 replace:

            try {
                Loader::loadModels($this, ['Domains.DomainsTlds']);
    
                $tld = $this->DomainsTlds->getByPackage($packageId);
    
                if (isset($tld->tld)) {
                    $fields['_data']['item_type'] = 'domain';
                }
            } catch (Throwable $e) {
                // Nothing to do
            }

    With

            Loader::loadModels($this, ['PluginManager']);
            if ($this->PluginManager->isInstalled('domains', \Configure::get('Blesta.company_id'))) {
                Loader::loadModels($this, ['Domains.DomainsTlds']);
    
                $tld = $this->DomainsTlds->getByPackage($packageId);
                if (isset($tld->tld)) {
                    $fields['_data']['item_type'] = 'domain';
                }
            }

     

  8. On 7/6/2021 at 4:30 PM, Blesta Addons said:

    from Edit invoice, i can see the ASTERISK that has a url to the service, so invoice_lines.service_id is set.

    These upgrades are performed through the core?  What version of Blesta are you running?  My installation does not link invoice lines from an upgrade to the service through invoice_lines.service_id so I've gotta figure out why yours does.

  9. 1 minute ago, Blesta Addons said:

    we still facing it. and i can't believe is impossible to reproduce, any client made a upgrade of service, then he didn't pay the upgrade, the service is suspended when the invoice are on overdue date, upgrade here are from package a to package b or by adding config add-on.

    just yesterday i have unsuspended a service that was suspended due to non payment of the upgrade invoice. can i fetch any info in database to send it to you?

     

    Thanks for the quick response, I'm headed out of the office, but I'll take a look first thing tomorrow morning.  Are you able to identify the invoice for the upgrade in the database and see if the invoice_lines.service_id is set? That seems like the only way this could happen.

  10. I have been unable to reproduce, and looking at the code it shouldn't be possible (either in the latest version or 4.10).  Invoices for upgrades do not set the invoice_lines.service_id field.  The query to select services to suspend does an inner join on invoice_lines.service_id., so it doesn't seem possible.

    That being said, I'm definitely willing to test again if you have specific steps to reproduce.  If so, please provide :)

  11. Happy to report some progress on this via CORE-4294. I had a quick question for those concerned.  Should summary/invoice line items show the full price as in this screen shot:

    tax-subtracted-in-totals.png.a227c4a8f57c8109d429d19dfe628934.png

    Or should they have the tax subtracted as in this screen shot (note that the full price is shown when selecting the items regardless)

    tax-subtracted-in-line-items.thumb.png.e7da8bb0b8be0ea83d37a8fb5b3fdb3f.png

  12. 2 minutes ago, Blesta Addons said:

    it has some effects in inherit classes or methods for Uri with client prefix?

    Controllers can inherit the ClientController class regardless of whether they are accessed via the client_uri.  The ->base_uri is modified, but that shouldn't have an affect on the plugin related links.  The only issue would come when a plugin was using ->base_uri to link to a core client controller.

  13. 38 minutes ago, Blesta Addons said:

    finally, the client prefix exist for something, if not it should be removed.

    In the core files, the client URI is mapped to client controllers, so for the core it has a purpose.  As far as I can tell, it doesn't have a purpose related to plugins, except a visual cue that lets the user know they are in the client interface.

×
×
  • Create New...