logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Fulcrum Developer  
#1 Posted : Thursday, October 10, 2024 3:41:10 PM(UTC)
Fulcrum Developer

Rank: Member

Groups: Registered
Joined: 8/29/2024(UTC)
Posts: 14
United States

Thanks: 3 times
Hi,

Why is the amount field precision to 2 decimal places but the unit cost to more than that.



Here's an example to illustrate my point. I'm creating an A/P invoice with the following create DTO:

{
"companyId": 2147470000,
"vendorId": 2147469945,
"date": "2024-10-09T12:32:03.48Z",
"invoiceNumber": "test",
"dueDate": "2024-11-08T12:32:03.48Z",
"amount": 274.9999,
"lines": [
{
"salesItemId": 2147469938,
"description": "test",
"quantity1": 33,
"quantity2": 0,
"unitCost": 8.3333,
"amount": 274.9999,
"notation": "633922"
}
]
}

but I get the error:

{
"message": "Invalid Request",
"errors": [
{
"key": "DatabaseError",
"message": "The selected row has incomplete data"
}
]
}

when I decrease the precision of the amount field like so:

{
"companyId": 2147470000,
"vendorId": 2147469945,
"date": "2024-10-09T12:32:03.48Z",
"invoiceNumber": "test",
"dueDate": "2024-11-08T12:32:03.48Z",
"amount": 274.9999,
"lines": [
{
"salesItemId": 2147469938,
"description": "test",
"quantity1": 33,
"quantity2": 0,
"unitCost": 8.33333,
"amount": 274.99,
"notation": "633922"
}
]
}

(notice that amount is now 274.99 instead of 274.9999)

My request is successful (200 status code).

aarony  
#2 Posted : Thursday, October 10, 2024 4:01:06 PM(UTC)
aarony

Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 2/28/2018(UTC)
Posts: 53
Location: Red Wing, MN

Was thanked: 4 time(s) in 4 post(s)
In CenterPoint all extended amounts (qty x unit cost/price) are rounded to 2 decimal places.
However, unit costs and prices can be configured to use up to 8 decimal places.

The error response could be more helpful though, so I will make a note of that.

Regards,

- Aaron.
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.