softwerkab / fortnox-csharp-api-sdk

.NET SDK for Fortnox API.
MIT License
52 stars 64 forks source link

Fixed casting issues in Order Entity #240

Closed Khungersumit closed 2 years ago

Khungersumit commented 2 years ago

Please complete this PR :)

Could not convert string to decimal: API_NORIGHT. Path 'Order.ContributionPercent', line 1, position 360.' Could not convert string to decimal: API_NORIGHT. Path 'Order.ContributionValue', line 1, position 360.'

Could not convert string to decimal: API_NORIGHT. Path 'Order.OrderRows[0].ContributionPercent', line 1, position 2304.'

Khungersumit commented 2 years ago

image

richardrandak commented 2 years ago

How does this value work?

..I see a problem.. if we change this to string, same logic could be applied to all the non-string model properties

Khungersumit commented 2 years ago

Hi @richardrandak

This seems to be an issue from Fortnox, they shouldn't allow setting a string value in "ContributionPercent".

I used the following workaround for this. "Just for this API I made a HttpClient request separately and used a custom obj return type" for all other requests I used your SDK :)