Sage SDO - TransactionPost.AllocatePayment not allocating the full amount to purchase invoice for foreign currency with different exchange rate

Hey,

We are seeing some differences when paying a purchase invoice which is in a foreign currency when using the UI compared to using the SDO. The purchase payment is at a different exchange rate to the purchase invoice.

When creating the purchase invoice and completing the payment via the UI, we are seeing that the purchase payment's full net amount being allocated to the purchase invoice. The purchase credit note for the currency revaluation is then being created with the difference of the purchase payment and purchase invoice. The purchase invoice then is fully paid and marked as such.

When using the SDO, we are doing the same scenario and allocate the purchase payment's full net amount to the purchase invoice. However, in Sage it is allocating only part of the purchase payment. It is then creating a purchase credit note for the currency revaluation, with the remaining amount of the purchase payment, which is then allocated to the purchase invoice. This leaves the purchase invoice under paid and not marked as "Paid in full", with a remaining amount left on the purchase payment.

For example, here are some we created (exported from the Transaction screen):

Created via the SDO
No Type Account Nominal Dept Project Details Date Posted Date Due On Ref Ex.Ref Exchange Rate Foreign Gross Net Tax T/C Paid Amount Paid Bank Bank Rec Date VAT VAT Rtn No.
1373 PI USD001 7400 0 20/06/2022 11/07/2022 20/07/2022 1.300000 50.00 38.46 0.00 T1 N 36.76 - N -
1374 PP USD001 1201 0 25/06/2022 11/07/2022 1.360000 50.00 36.76 0.00 T9 N 35.14 - - -
1375 PC USD001 7906 0 Currency Reval 1.62 to PI 1373 25/06/2022 11/07/2022 25/06/2022 REVAL 1.000000 0.00 1.62 0.00 T9 Y 1.62 - - -

Created via the UI
No Type Account Nominal Dept Project Details Date Posted Date Due On Ref Ex.Ref Exchange Rate Foreign Gross Net Tax T/C Paid Amount Paid Bank Bank Rec Date VAT VAT Rtn No.
1383 PI USD001 5000 1 LP200 Laser Printer Toner 14/07/2022 14/07/2022 13/08/2022 47 1.300000 50.00 38.46 0.00 T0 Y 38.46 - N -
1384 PP USD001 1201 0 Purchase Payment 14/07/2022 14/07/2022 1.360000 50.00 36.76 0.00 T9 Y 36.76 - - -
1385 PC USD001 7906 0   Currency Reval 1.70 to PI 1383 14/07/2022 14/07/2022 14/07/2022 REVAL   1.000000 0.00 1.70 0.00 T9 Y 1.70 -   - -

Here's a screenshot of the allocate call, where we are allocating £36.76 (The full net amount of the purchase payment) to the purchase invoice. So, as we are allocating the full amount, I would expect that full amount to be allocated to the invoice. Also, with the currency revaluation taking place on the purchase invoice amount, and not removing part of the amount allocated by the purchase payment.

Is there anything we need to do to get it to work the same as UI does or is this an issue with the SDO?

Let me know if you need any more detail or anything isn't clear.

Thanks :)