Hi All,
I have a requirement to get the sum of the total amount field of all related Invoices to an Order record.
for that I am using the fetch aggregation for Sum in a plugin.
When I add/delete/update an Invoice with total amount, this plugin getting trigger.
This is working fine and triggering as I expected but problem is , Order Currency and base currency are different.It is giving me the result after converting it in exchange rate.I don't want to get it in converted way, I need the original value before converting it.
How can I get this?
Example :-
I have two currencies in system
GBP and Euro.
GBP is the base currency of the organisation and Euro is custom currency and having the Exchange rate of 1.1600.
I have an Order in CRM which is using Custom currency Euro .I want to put total amount sum of all related Invoice to the total amount field of Order. for that I have wrote one plugin and triggering perfectly.
Order have 3 invoices in Euro Currency with value
1000,500 and 700 euro in their respected total Amount field.
But I am getting the result 1896.51 while updating invoice instead of 2200 (1000+500+700).
this is equal to the sum/exchange rate (2200/1.16), I don't want this result, i want 2200.
is there any way to resolve it?
any help much appreciated.