Jump to content

Recommended Posts

Posted

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?

Posted

Hi naja7host

 

I am aware that it should be possible and I already have custom template for pdf invoices. However this field should be populated on invoice creation. Do you have any idea where to start? Are there any hooks?

Posted

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.

Posted

Tyson has made a shela for you .

Plugin that will tie to event invoice and store the invoice id and the rate exchange in a separate table .

Then in invoice view you should look to database and fetche the rate correspondinf to the invoice and print it .

That all i think .

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...