Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/15/2018 in all areas

  1. Hi All, I hope the following can help you. What I do in the meantime is moving the services etc over to the new client and close the old client. In my case we don't need to move everything. The services are important for us to be on the new client. Thus I used the code below, although it is not a complete script moving everything you might want to move, it did it for us, and can maybe help others. I commented the update queries with -- for me not to run it by accident ? . find below: --blesta move services from one client to another. (the values entered was for my testing) /*Step 01*/ use billing; set @var_id_value_from=1195; /*from client code, not id*/ set @var_id_value_to=1205; /*to client code, not id*/ set @var_id_from=0; SELECT `id` into @var_id_from FROM `clients` where `id_value` = @var_id_value_from limit 1; set @var_id_to=0; SELECT `id` into @var_id_to FROM `clients` where `id_value` = @var_id_value_to limit 1; select @var_id_value_from, @var_id_value_to, @var_id_from, @var_id_to; SELECT * FROM `clients` where `id` = @var_id_from; SELECT * FROM `clients` where `id` = @var_id_to; SELECT * FROM `services` where `client_id` = @var_id_from; SELECT * FROM `services` where `client_id` = @var_id_to; --update services set `client_id` = @var_id_to where client_id = @var_id_from; /*skip this only for testing*/ select * from service_fields where service_id in(324); /* no action needed */ select * from service_changes where service_id in(324); /* no action needed */ select * from service_options where service_id in(324); /* no action needed */ select * from log_services where service_id in(324); /* no action needed */ select * from package_pricing where pricing_id in(33); /* no action needed */ select * from packages where id in(26); /* no action needed */ select * from pricings where id in(33); /* no action needed */ /*Step 02*/ select * from client_packages where client_id = @var_id_from; /*change client_id from to */ --update client_packages set `client_id` = @var_id_to where client_id = @var_id_from; /* assuming that the clients's currency, and tax status is the same, and you want to move all services from one client to another then you can do the invoices and transactions as well */ /*Step 03*/ select * from support_tickets where client_id = @var_id_from; /* service_id in(324); *//*code = 9462313;*/ /* change client_id from old client id to new client id (not client_id_value) */ /* the support_tickets are linked to support_replies which are linked to contacts that are linked to the current client. if you want to move the support tickets related to the service_id, I will suggest moving the contact first to the new client. but the contact is linked to a lot of tables. For my purpose I deside to leave the support_tickets at the old client and just make the support_tickets.service_id = null */ --update support_tickets set client_id = @var_id_to where client_id = @var_id_from; /* should I or not, in regards to the comment above? */ select * from support_replies where ticket_id in(select ticket_id from support_tickets where service_id in(324)); /* no action needed if not moving the tickets with services to new client*/ /*Step 04*/ select * from service_invoices where service_id in(324); /* no action needed */ select * from invoices where client_id = @var_id_from; /* id in (37106,38781);*/ /* change client_id from old client id to new client id (not client_id_value) */ -- update invoices set client_id = @var_id_to where client_id = @var_id_from; select * from invoice_lines where invoice_id in(37106,38781); /* no action needed */ select * from invoices_recur where `client_id` = @var_id_from; /* change cleint_id fom old client to new client */ --update invoices_recur set client_id = @var_id_to where client_id = @var_id_from; /*Step 05*/ select * from transaction_applied where transaction_id in(select id from transactions where client_id = @var_id_from); /* no action needed */ select * from transactions where client_id = @var_id_from; /* change old client_id to new client_id. make transactions.account_id = null if account not account will not also be moved to new client, like in my case */ --update transactions set transactions.account_id = null, client_id = @var_id_to where client_id = @var_id_from; Then I closed the old duplicated client in Blesta. have fun! ?
    1 point
  2. The AdminManagePlugin controller is a special controller (see docs for reference) that loads the plugin management controller from /admin/settings/company/plugins/manage/PLUGIN_ID/ in Blesta. If you want your mapping to be managed similarly, you should create methods in AdminManagePlugin to do so, and use GET arguments to request your specific AdminManagePlugin method (e.g. "AdminManagePlugin::refresh" is called when visiting admin/settings/company/plugins/manage/PLUGIN_ID/?action=refresh). If you want to manage your plugin elsewhere, such as from its own page, you can certainly do so however you'd like, as the plugin's controllers can be requested directly at their own URI, e.g. /admin/plugin/feed_reader/my_controller/my_method/
    1 point
  3. Thanks for the report, we'll take a look. CORE-2594
    1 point
×
×
  • Create New...