softwerkab / fortnox-csharp-api-sdk

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

Wrong VAT on some articles #302

Closed CyrilPorseland closed 4 months ago

CyrilPorseland commented 5 months ago

Hi,

We have customers that have 0% VAT on some articles but the ArticleConnector shows 25%.

If fetch the articles in Postman the API shows correct VAT with 0% (see picture).

image

We also had one article in our Fortnox test with 12% that SDK showed 25% and there I saved the article with 6% and then back to 12% and now its okey. Same here, postman showed 12% all the time.

We are running on Nuget 4.3.6 but also tested with 4.3.15 with same result.

Richard, please contact me at email or Team at cyril.porseland@joboffice.se to get a AccessToken valid for one hour so you can test this by yourself against our customer.

CyrilPorseland commented 4 months ago

Is there nobody that can investigate this issue?

CyrilPorseland commented 4 months ago

After a lot of investigation I found the error. It´s Fortnox regular API that has an error.

A list of articles at https://api.fortnox.se/3/articles gives the VAT in a string and it seems like it´s always "25" for all articles.

{ "@url":"https://api.fortnox.se/3/articles/NOS-151FH", "ArticleNumber":"NOS-151FH", "Description":"NOS 100% ÅTERBRUK BESLAG", "DisposableQuantity":"0", "EAN":"", "Housework":false, "PurchasePrice":"0", "SalesPrice":"0", "QuantityInStock":"0", "ReservedQuantity":"0", "StockPlace":null, "StockValue":"0", "Unit":"st", "VAT":"25", "WebshopArticle":false }

If fetch one article at at https://api.fortnox.se/3/articles/NOS-151FH the properties is a integer and shows correct value of 0% VAT.

{ "Article": { "@url": "https://api.fortnox.se/3/articles/NOS-151FH", "ArticleNumber": "NOS-151FH", "Bulky": false, "ConstructionAccount": 0, "Depth": 0, "Description": "NOS 100% ÅTERBRUK BESLAG", "DisposableQuantity": 0, "EAN": "", "EUAccount": 3058, "EUVATAccount": 3056, "ExportAccount": 3055, "Height": 0, "Housework": false, "HouseworkType": null, "Active": true, "Manufacturer": null, "ManufacturerArticleNumber": "", "Note": "", "PurchaseAccount": 4020, "PurchasePrice": 0, "QuantityInStock": 0, "ReservedQuantity": 0, "SalesAccount": 3020, "StockGoods": false, "StockPlace": null, "StockValue": 0, "StockWarning": null, "SupplierName": null, "SupplierNumber": null, "Type": "STOCK", "Unit": "st", "VAT": 0, "WebshopArticle": false, "Weight": 0, "Width": 0, "Expired": false, "SalesPrice": 0, "CostCalculationMethod": "LAST_RELEASED_INBOUND", "StockAccount": null, "StockChangeAccount": null, "DirectCost": 0, "FreightCost": 0, "OtherCost": 0, "DefaultStockPoint": "LAGER", "DefaultStockLocation": null, "CommodityCode": null } }

I close this issue and contact Fortnox.