softwerkab / fortnox-csharp-api-sdk

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

Set Financial Year VoucherFileConnection #175

Closed erda08de closed 3 years ago

erda08de commented 3 years ago

Hello.

I have an odd issue. When connecting a Voucherfile to a Voucher the voucherfile is attached to a Voucher on a previous Financial Year. How do I set Financial Year when connecting VoucherFileConnection:

Dim item As New Entities.VoucherFileConnection item.VoucherNumber = FortNoxVoucherNumber item.VoucherSeries = FortNoxVoucherSeries 'item.VoucherYear = FortNoxFinancialYear item.FileId = file.Id Dim newFile = connector.Create(item)

item.VoucherYear is ReadOnly?

/Daniel

erda08de commented 3 years ago

I got a reply from a fortnox that it is possible to set VoucherYear by adding a financialyeardate in the querystring. How is that possible to solve via SDK?

Ex https://api.fortnox.se/3/voucherfileconnections/?financialyeardate=2020-01-01 där ni skickar in fösta datumet i räkenskapsåret.

richardrandak commented 3 years ago

Hi, it seems like the SDK does not support it. I will need to add the parameter to the Create method. Maybe also to the Update method

Can you try specifying the year's id by parameter financialyear if it works as well? E.g. https://api.fortnox.se/3/voucherfileconnections/?financialyear=1

erda08de commented 3 years ago

Richard How do I get access to the url via SDK?

Connector has ha HttpClient but I can't find the Url parameter?

/Daniel

richardrandak commented 3 years ago

No, you can't do it in the SDK. You can try it by Postman. Nevermind, I will check it when fixing this issue. Is it urgent, or can you wait for next week?

erda08de commented 3 years ago

Hello.

It not urgent the issue is solved temporary by setting selected/default financial year in the GUI.

Many thanks /Daniel

tis 28 sep. 2021 kl. 19:07 skrev richardrandak @.***>:

No, you can't do it in the SDK. You can try it by Postman. Nevermind, I will check it when fixing this issue. Is it urgent, or can you wait for next week?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FortnoxAB/csharp-api-sdk/issues/175#issuecomment-929415437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWDOTX3YHVZOAERXKZPMELUEHY4JANCNFSM5E5T3L2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

richardrandak commented 3 years ago

I added optional parameter to Create method for specifying financial year id. I will publish a new NuGet soon. Also changed VoucherNumber and Year properties to long? to match the types with the other entities to avoid neccessary conversions