wpovernight / woocommerce-pdf-invoices-packing-slips

Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.
https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/
Other
99 stars 47 forks source link

Export Invoices to new currency #878

Open maltfield opened 1 week ago

maltfield commented 1 week ago

This ticket is a feature request to add a way for this plugin to export an invoice in a different currency.

Why?

My store is in USD, but I have some customers in the EU that like to pay with SEPA transfer.

Currently I'm downloading the invoice in this plugin, opening the PDF in Libreoffice Draw, and manually editing the values before sending the invoice to the customer. I would prefer if I could just have this plugin automatically update invoice (eg update the numerical line items, update the currency symbol, etc) of the invoice at the time I download it.

How?

Currently my workflow is:

  1. Download invoice from wordpress
  2. Open invoice PDF in LibreOffice Draw
  3. Get current mid-market rate for USD -> EUR https://www.xe.com/currencyconverter/convert/?From=USD&To=EUR
  4. Find & Replace all $ to
  5. Loop through every line item and multiply the numerical value in the PDF by the mid-market rate obtained in step [3], rounding to the nearest hundredth decimal value.
  6. Calculate the new total price, and update the Total field's numerical value.
  7. Update the invoice header to include our business bank account's IBAN number

Basically, I'd want ^ this process implemented in PHP, with the following constraints:

  1. Fetching the mid-market currency rates should be done by the client, not the server (to support hardened servers where firewalls and WP_HTTP_BLOCK_EXTERNAL block the server from initiating requests)
  2. Javascript shouldn't be required (eg use <noscript> to add an input where the user can enter the exchange rate)
maltfield commented 1 week ago

Would the devs be open to a PR for this feature? If so, please point me to the relevant files & functions that you think would need to be edited, and do let me know if you have any ideas regarding UI or otherwise.

maltfield commented 1 week ago

I'm also curious if it might make more sense to achieve this with a plugin that allows me to change the currency of an order:

maltfield commented 1 week ago

See also:

alexmigf commented 1 week ago

Hi @maltfield

We are working on adding compatibility between our Professional extension and the Curcy multi-currency plugin. Could you please reach out to us via email so we can discuss this further?

maltfield commented 1 week ago

@alexmigf I could email you, but wouldn't it be better to have the conversation publicly here on GitHub, so others can read it and join the discussion?

alexmigf commented 1 week ago

@maltfield Thanks for your feedback! We're glad to see interest in multi-currency conversion. Currently, we’re planning to include this feature in the paid version of the plugin, as it wasn't part of our initial vision for the free version. However, we’ll discuss it internally and evaluate how we can enhance the free version in the future. Feel free to share any additional ideas here, as community input is always valuable!