Jump to content

Renewal Invoice Currency Conversion - wrong invoices generated


Recommended Posts

Posted

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 ?

Posted
35 minutes ago, Jono said:

Just to confirm, you have set an override price/currency on the service?

Hi Jono,

 

Yes, I have set override price & currency to 200 INR

Posted

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.

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...