Jump to content

Renewal Invoice Currency Conversion - wrong invoices generated


Abdullah

Recommended Posts

Hello,

i don´t know if this is only me, but using v5.1.2 automatic currency conversion for Invoices is broken and we have all wrong invoices.

Steps to replicate:-

Default currency - USD

Client Account Preferred Currency - INR

Package Currency - USD

Package price override - INR

 

Now, say the package is override priced INR200 , but the renewal invoice is generated for [200USD equivalent] INR14,873

 

 

 

Anyone else can reproduce & confirm ?

Link to comment
Share on other sites

Confirmed.

Try updating app/models/invoices.php around line 1528 from:


                $items[] = [
                    'service_id' => $service_id,
                    'qty' => $item->qty,
                    'amount' => $this->Currencies->convert(
                        $item->price,
                        $service->package_pricing->currency,
                        $currency,
                        Configure::get('Blesta.company_id')
                    ),
                    'description' => $item->description,
                    'tax' => !empty($item->taxes)
                ];

To


                $items[] = [
                    'service_id' => $service_id,
                    'qty' => $item->qty,
                    'amount' => $this->Currencies->convert(
                        $item->price,
                        $service->override_currency ?? $service->package_pricing->currency,
                        $currency,
                        Configure::get('Blesta.company_id')
                    ),
                    'description' => $item->description,
                    'tax' => !empty($item->taxes)
                ];

I've created CORE-4441 to handle this.

Link to comment
Share on other sites

19 hours ago, Jono said:

Confirmed.

Try updating app/models/invoices.php around line 1528 from:


                $items[] = [
                    'service_id' => $service_id,
                    'qty' => $item->qty,
                    'amount' => $this->Currencies->convert(
                        $item->price,
                        $service->package_pricing->currency,
                        $currency,
                        Configure::get('Blesta.company_id')
                    ),
                    'description' => $item->description,
                    'tax' => !empty($item->taxes)
                ];

To


                $items[] = [
                    'service_id' => $service_id,
                    'qty' => $item->qty,
                    'amount' => $this->Currencies->convert(
                        $item->price,
                        $service->override_currency ?? $service->package_pricing->currency,
                        $currency,
                        Configure::get('Blesta.company_id')
                    ),
                    'description' => $item->description,
                    'tax' => !empty($item->taxes)
                ];

I've created CORE-4441 to handle this.

Thanks for confirming! I will try 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...