Getting exception 'Non-zero amount must be rounded to whole currency' Sage 50 C# WPF?

131 views Asked by At

When I try to add an amount in AmountPaid field & if the amount = 55.23 then it throws an exception with stated text "Non-zero amount must be rounded to whole currency"

I tried AmountPaid = Match.Ceiling(amount) which changes the 55.23 to 56 which works great, but I want to make it as it is i.e 55.23 The thing which I understood is that the DB of Sage50 2020 is not allowing amount with decimal places.

invoiceLine.AmountPaid = item.amount

I think this error is only with .Net SDK which Sage 50 2020 provided to us. The suggestion will also be appreciated. Thanks in advance

1

There are 1 answers

0
Belak On

We ran into this recently pushing data to Sage 50 (v2022) via the Sage API dlls. We were trying to create an invoice for an item and setting the quantity with decimal values (2 in our case). The item's stocking unit in Sage 50 hadn't been set so it was defaulting to on the invoice. Sage seems disable use of decimals for quantities on items without a stocking unit set. I understand your question seems related to the extendPrice/Amount, but we were receiving the same error message.

FIX: We had the customer set the stocking unit to LB for that item and we were able to send the invoice with decimal quantities.