Jump to content

Chris van der Westhuizen

Members
  • Content count

    32
  • Joined

  • Last visited

  • Days Won

    2

Chris van der Westhuizen last won the day on March 23

Chris van der Westhuizen had the most liked content!

About Chris van der Westhuizen

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. Chris van der Westhuizen

    [Merge Clients] - How It Should Work ;)

    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! 🙂
  2. Chris van der Westhuizen

    adding pages to plugin with own module, view and controller and actions

    Thank you Tyson. I'll go with the docs option. thus will use admin/settings/company/plugins/manage/PLUGIN_ID/?action=refreshmappings or addmappings etc.
  3. Hi all. I am trying to add a page to the Feed reader plugin I called Mapping. The functionality of the current feed reader plugin default page and add url sub page is what I am trying to use with a custom table for mapping purposes with another application. I cannot seem to get the basics working. And that is to have a mappings controller, module and view, and language file, with a button on the main form next to the + icon for adding a new feed. I did work through the documentation but for a .net developer I am a little dumbstruck with the PHP. I do believe I have the potential to manage once I can get the above mentioned to work. I am a person whom is eager to help. Currently I am in need of help. 🙂 What I did so far: I use the debugger plugin for debugging. plugins/feed_reader/controllers/admin_manage_plugin.php I copied to admin_manage_plugin_mappings.php and change all naming to the appropriate mappings naming. e.g. the word feed to mapping etc. plugins/feed_reader/language/en_us/feed_reader_feeds.php I copied to feed_reader_mappings.php and change all the naming to the appropriate mappings naming. plugins/feed_reader/language/en_us/feed_reader_manage_plugin.php I copied to feed_reader_manage_plugin_mappings.php and change all the naming to the appropriate mappings naming plugins/feed_reader/models/feed_reader_feeds.php I copied to feed_reader_mappings.php and change all teh naming to appropriate mappings naming. plugins/feed_reader/views/default/admin_manage_plugin.pdt to admin_manage_plugin_mappings.pdt and change the naming inside accordingly. plugins/feed_reader/views/default/admin_manage_plugin_add.pdt to admin_manage_plugin_mappings_add.pdt and change the naming inside accordingly e.g. in the admin_manage_plugin_mappings.php file the "class AdminManagePlugin extends AppController" becomes "class AdminManagePluginMappings extends AppController" and "FeedReaderFeeds" becomes "FeedReaderMappings" etc. I am trying to manually change the url to maybe show something by changing in the browser the "http://localhost/blesta/index.php/admin/settings/company/plugins/manage/10/" to "http://localhost/blesta/index.php/admin/settings/company/plugins/manage/10/mappings/" or "http://localhost/blesta/index.php/admin/settings/company/plugins/manage/10/mappings/?action=add" and some other combinations. Maybe I don't understand how it work 🙂 I will change the the queries and so on, but will do so once I manage to at lease see the Mappings button and the content of the new mappings view. I unfortunately cannot find an appropriate example through all the other plugin sources. I am wondering what I am missing? accept for my brain at this stage hahahahahaha. Kind Regards Chris
  4. Chris van der Westhuizen

    [Plugin] The Debugger

    Thank you Blesta Addons. I've received you email, logged in, and found the link now. 🙂
  5. Chris van der Westhuizen

    [Plugin] The Debugger

    Hi Blesta Addons. I registered for the free stuff on your site but can still not download the debugger. I log on to https://blesta-addons.com/ Then click on store tab / store / Plugins / The debugger Tools , thus https://blesta-addons.com/plugin/store/main/item/16/ ...and that is that. There is no option to download it. I logged a ticket 16 days ago in this regards at blesta-addons with no anwer yet. thus in the meentime worked on the Blesta EER Diagram. How do I go about?
  6. Hi Blesta Addons. I registered for the free stuff on your site but can still not download the debugger.

    I log on to https://blesta-addons.com/
    Then click on store tab / store / Plugins / The debugger Tools , and that is that.  There is no option to download it.

    How do I go about?

  7. Chris van der Westhuizen

    database diagram

    Thank you Paul for the quick response. Okey. The semi-good news is, I sent the semi-final version by email to you. I have a few more questions there, and as soon as we can have that sorted then newbies on Blesta, like me, can advance fast 🙂
  8. Chris van der Westhuizen

    database diagram

    Hi Paul, files left the building 🙂 See your email box. I hope you will like my spiderweb compilation 🙂
  9. Chris van der Westhuizen

    database diagram

    Hi Paul, my thought too, that's why I did not post it. I'll email you tomorrow South African time (GM+2) when I'm back at work.
  10. Chris van der Westhuizen

    database diagram

    Thank you Tyson. I completed as complete as possible the EER_Diagram on MySQL Workbench, but do have +/- 10 relationships I am not sure about. Should I attach the wbs, sql, pdf copy of the layout with the questions here, or should I rather email these files first that we upload them here when done, or make them part of the documentation? I think if I had something like this, I would have been on the road to success long ago. I'm not complaining, Thank you very much for the current documentation it helped me very much, as well as this forum. 🙂
  11. Chris van der Westhuizen

    [Merge Clients] - How It Should Work ;)

    Thanks Blesta Addons, I'll keep in touch.
  12. Chris van der Westhuizen

    database diagram

    i did create an EER Diagram using MySQL Workbench's Reverse Engineer option, but it is not linking the table fields. Although the naming of the tables and sub tables and fields is self explanatory, I am not sure if I should link an id of id_value field to an appropriate table without investigation, because there is no primary foreign key relations on the diagram, thus not in the db.
  13. Chris van der Westhuizen

    database diagram

    Does someone have a blesta database diagram showing primary/foreign key relations etc.? It will save me time composing one for quick reference while developing modules/plugings. Kind regards Chris
  14. Chris van der Westhuizen

    [Merge Clients] - How It Should Work ;)

    Hi Blesta Addons Do you have a solution already, or should I write something to accomplish that according to your steps? Because we also sits with a lot of duplicate clients after importing from some whmcs systems which is messing up our billing and invoicing.
  15. Chris van der Westhuizen

    Wrong pdf invoice attached to receiving client's email

    While Invoices generate, and staff resend a failed invoice/mail at the same time, all of those emails that went out received the correct email header and body but the wrong content in the attachment. I noticed that the datetime fields of those emails in the log_emails table with the wrong attachment sent out have exactly the same date datetime on the second. So from now on we will not resubmit mails manually for invoices that we create while the system is busy generating e.g. month-end invoices. I did not look at the programming, but would suggest that a client id or user id be incorporated while generating the temporary pdf record. If that is the problem? Kind regards Chris
×