Using customer database from other application

I have all my customers’ contact info in a CRM application. I would find it very useful to somehow integrate my users into invoiceplane somehow.

I thought about using SQL views for this purpose. This way, invoiceplane would “see” all my up-to-date users without the need to create any in invoiceplane itself.

The thing is, I don’t know how invoiceplane handles things. Things like cascade delete / update and stuff like that comes to mind. I’m also concerned about future updates (table structure changes). Is there any reason to avoid using sql views? Could using views of user data break invoiceplane in any way?

I don’t think that we will change the client table in version 1. But I think that integrating another table will make a lot of work.

Kovah,

Thanks for your reply. I think creating the table wont be a problem. Drop the current user table and create a view with the same table columns as the (dropped) user table, with the same name. I think the maintenance and making sure nothing goes wrong will be the biggest headache. :stuck_out_tongue:

Can you let me know what happens with the related records (invoices, payments) if you delete a user currently in invoiceplane? Does it cascade delete all related records or do they stay?

Invoices or quotes pull out the user data via the client id. So just make sure the customer has the same ID in your own table than in the original InvoicePlane table.

That’s what I would try indeed. Should work. Still one thing unclear: what happens if I delete a customer (theoretically speaking, not that I would do it)? Then the invoice/quotes won’t find a related client - will it throw an error or just show an empty value?

I don’t know exactly but I would guess that it throws an error.