softwerkab / fortnox-csharp-api-sdk

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

Set API_BLANK on InvoiceRow.Account #217

Closed mnmabj closed 2 years ago

mnmabj commented 2 years ago

Since account is a nullable long in the nuget, is there some other way to tell Fortnox that you want the account to be empty and not null? We add extra into to the invoice with textrows, and if the account is null fortnox will use the default account number instead, and if that accountnumber require that you must have a costcenter you get a error that tells you that a invoicerow with a accountnumber lacks costcenter.

Would there be possible to use 0 or -1 as API_BLANK?

We can "solve" it by adding account and costcenter to the textrows, but that will create extra rows with no info in some reports in Fortnox.

richardrandak commented 2 years ago

Unfortunately, using API_BLANK is not possible in order to have typed properties. However, I believe using account number 0 in the invoice row would work fine for your case. It will not be replaced by a default account.

iamdanthedev commented 2 years ago

Setting 0 for VAT and InvoiceRow.Account works perfectly, the resulting row in Fortnox shows them as empty

image