softwerkab / fortnox-csharp-api-sdk

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

Voucher is part of SupplierInvoiceSubset in api reference but not in c# sdk #143

Closed johanneslundsten closed 3 years ago

johanneslundsten commented 3 years ago

Hello, I'm to get connected vouchers from an Invoice

In the api ref i found that there is a list of vouchers in the list view of supplier invoice. https://developer.fortnox.se/documentation/resources/supplier-invoices/

But I cannot find it in the sdk: https://github.com/FortnoxAB/csharp-api-sdk/blob/965ac84f6d6d990faeacc3023234153a510f1044/FortnoxSDK/Entities.Subsets/SupplierInvoiceSubset.cs

Is this by design or is it missing?

Best Regards Johannes

richardrandak commented 3 years ago

Hello Johannes! I assume it is a new property, but you are right. I noticed it last week and actually added it just yesterday to the SDK as pre-release. You can check 4.0.5-alpha NuGet. Let me know if that works for you.

The thing is, it seems little inconsistent and I am not sure how to make it clear in SDK to not confuse the consumers. For instance, if you do booking of an supplier invoice, the response does not contains the Vouchers field. Instead, it contains the VoucherNumber, VoucherSeries and VoucherYear properties. I marked these three properties as "obsolete" just to warn the user about this weird behavior.

johanneslundsten commented 3 years ago

Thank you for your quick response! I'll check it out and come back to you in a few days

Regards Johannes