We are having a strange issue when creating Purchase Invoice Draft via DI API. This seemed like a bug to me and I wanted to get your opinion and ask for a possible workaround.
We are setting line Currency and Rate fields according to specific date and rate since all these lines contains employee expenses. However, in the cases we set “Currency” to “USD” and Rate to some “#.###” formatted value we are having an error that says “Rate in row should have matched the document rate”.
Here are the facts so far;
- We don’t have any issue with other currencies and it even does work if I set a new US American Dollar currency with different code.
- As I debugged the code I noticed that If I set Document Currency and Rate to the same value with Line Currency and Rate it works fine. But of course I can’t use this as a workaround because this doesn’t work when there are multiple lines records.
- Not giving any DocDate doesn't change the error. But if I enter the same date with currency it works fine since the rates are matching. But again it is not applicable as a workaround since this doesn’t work when there are multiple lines records.
- I tried different rounded values for line rate like 3.0, 3.01 but it also didn't change the outcome.
Obviously Document has "USD" as default currency and it is giving this error if a "USD" line rate doesn't match the document rate but the behavior didn't seemed normal to me. Since code works fine with other currencies I tried setting the document rate to some other currency at the beginning but it also didn't work.
I will also open a SR and share sample project that produces the error.
Please let me know if you have any idea about the issue since it is urgent for us.