简体   繁体   中英

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

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 ie 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM