Just added a small extension to allow many invoice addresses for a contact based on relationships

Közzétéve
2018-06-08 10:04
Written by
ErikHommel - member of the CiviCRM community - view blog guidelines

I have just published the Invoice Address API (https://civicrm.org/extensions/invoice-address-api).

The development of the extension was funded by Domus Medica vzw. They are a membership organization specifically for GP's (general practitioner) in Flanders and Brussels.

Their members log in on the website and have to be able to renew their membership, buy a new membership, buy products and training, buy job adverts and register for events. When it comes to paying they need to be able to select an invoice address for this specific occassion. That could be their own private address, but also the address of their employer or the address of the co-operative group they are part of, or the address of their own company.

The extension provides an API: InvoiceAddress Get (with parameter contact_id) that will return all the available invoice addresses for the contact.

In the background the API will do the following:
* it will retrieve the billing addresses of the contact_id passed as parameter.
* it will retrieve all the relationships of the contact and check if the relationship type has been allowed as an invoice address relationship type (check the Settings section below).
* if the relationship is allowed, the billing addresses of the related contacts will be retrieved
* it will return all the found addresses
* the fields that will be returned depend on the settings (check the Settings section below)

The extension also introduces a specific relationship type Invoice Address From/For which can be used for exceptional cases where an address has to be available as an invoice address without any logical reason :-). Check further documentation at https://lab.civicrm.org/ErikHommel/invoiceaddressapi

Filed under

Comments

Getting a 404 at https://lab.civicrm.org/ErikHommel/invoiceaddressapi

Apologies, moved to https://lab.civicrm.org/extensions/invoiceaddressapi

This sounds interesting but am struggling to imagine the workflow - any chance of some screenshots. And any further documentation to then allow the 'user' to see and select their various addresses?

Hi Pete,

it is a bit of a technical thing, so there are hardly any screenshots worth sharing apart from the settings one which is already here: https://civicrm.org/extensions/invoice-address-api.

I hope this explains it a little more:

On the website the member of the organisation decides to renew his membership or register for an event. When it comes to invoicing, the member decides that he does not want to get the invoice but it should go to his company or the group he/she is part of. So the member needs to have the ability to add another invoice address than his/her own address without changing his/her own address. But I do not want the ability to just add any address....

So on the CiviCRM side I have set the Invoice Address API settings and decide that the employer/employee relationship and the is member of working group relationship are available. The website form then calls the InvoiceAddress Get API and a list of possible invoice addresses is returned which will consist of:

  • his/her own billing address
  • the billing address of the employer (if there is any)
  • the billing address of the working group (if there is any)

That is all it does. Clearer now?