Jump to content

Adding Custom Fields Option To Invoices


deydod

Recommended Posts

Hi

 

I've been doing some customization on Blesta's invoices to meet local requirements. One of the requirements is that if you sell something in USD you have to show the value and rate in local currency. So basically I have to keep the rate in the invoice' custom field for the day when it is created.

I've already created a component that will fetch the rates from the right source, however do you think this is something that can be integrated?

 

If you are not going to integrate such feature, can you point me to the right direction to customize invoices and have custom field?

Link to comment
Share on other sites

How do you determine what the 'local' currency is? Local to you or local to the client? Presumably you already know what the local currency is, so it should only be a matter of converting from the invoice currency to the local currency using the exchange rate. If you don't want this value to change as exchange rates change over time, then you will need to store it.

 

You may want to look at creating a plugin that ties into the Invoices.add and Invoices.edit events.

 

I would imagine that you could create a plugin that defines a new database table that references an invoice and defines a field for the currency (and price if you need it). Then your plugin can be used to fetch that information when viewing the invoice so that it can be displayed.

 

The last part, where you must fetch/display the additional information would require you to update core code to integrate it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...