Skip to content

Commit

Permalink
Fix contract row property types
Browse files Browse the repository at this point in the history
  • Loading branch information
richardrandak committed Oct 2, 2020
1 parent abf1fbc commit a8e8121
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void Test_ContractAccrual_CRUD()
InvoiceRows = new List<ContractInvoiceRow>()
{
new ContractInvoiceRow()
{ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "6", Price = "1000", VAT = "0"}
{ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 6, Price = 1000, VAT = 0}
},
PeriodStart = new DateTime(2020, 01, 1),
PeriodEnd = new DateTime(2020, 03, 20)
Expand Down Expand Up @@ -132,7 +132,7 @@ public void Test_ContractAccrual_Find()
InvoiceRows = new List<ContractInvoiceRow>()
{
new ContractInvoiceRow()
{ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "6", Price = "1000", VAT = "0"}
{ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 6, Price = 1000, VAT = 0}
},
PeriodStart = new DateTime(2020, 01, 1),
PeriodEnd = new DateTime(2020, 03, 20)
Expand Down
12 changes: 6 additions & 6 deletions FortnoxAPILibrary.Tests/ConnectorTests/ContractTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public void Test_Contract_CRUD()
Language = Language.English,
InvoiceRows = new List<ContractInvoiceRow>()
{
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "10"},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "20"},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "15"}
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 10},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 20},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 15}
},
PeriodStart = new DateTime(2020, 01, 01),
PeriodEnd = new DateTime(2020, 03, 01)
Expand Down Expand Up @@ -106,9 +106,9 @@ public void Test_Contract_Find()
Language = Language.English,
InvoiceRows = new List<ContractInvoiceRow>()
{
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "10"},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "20"},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = "15"}
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 10},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 20},
new ContractInvoiceRow(){ ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 15}
},
PeriodStart = new DateTime(2020, 01, 01),
PeriodEnd = new DateTime(2020, 03, 01)
Expand Down
14 changes: 7 additions & 7 deletions FortnoxAPILibrary/Entities/Contracts/ContractInvoiceRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ public class ContractInvoiceRow
///<summary> Contribution Percent </summary>
[ReadOnly]
[JsonProperty]
public string ContributionPercent { get; private set; }
public decimal ContributionPercent { get; private set; }

///<summary> Contribution Value </summary>
[ReadOnly]
[JsonProperty]
public string ContributionValue { get; private set; }
public decimal ContributionValue { get; private set; }

///<summary> Cost center code </summary>
[JsonProperty]
public string CostCenter { get; set; }

///<summary> Delivered quantity </summary>
[JsonProperty]
public string DeliveredQuantity { get; set; }
public decimal DeliveredQuantity { get; set; }

///<summary> Description </summary>
[JsonProperty]
public string Description { get; set; }

///<summary> Discount amount </summary>
[JsonProperty]
public string Discount { get; set; }
public decimal Discount { get; set; }

///<summary> AMOUNT / PERCENT </summary>
[JsonProperty]
Expand All @@ -51,7 +51,7 @@ public class ContractInvoiceRow

///<summary> Unit price </summary>
[JsonProperty]
public string Price { get; set; }
public decimal Price { get; set; }

///<summary> Project code </summary>
[JsonProperty]
Expand All @@ -60,14 +60,14 @@ public class ContractInvoiceRow
///<summary> Row amount </summary>
[ReadOnly]
[JsonProperty]
public string Total { get; private set; }
public decimal Total { get; private set; }

///<summary> Code of unit </summary>
[JsonProperty]
public string Unit { get; set; }

///<summary> Vat percent code </summary>
[JsonProperty]
public string VAT { get; set; }
public decimal VAT { get; set; }
}
}
2 changes: 1 addition & 1 deletion FortnoxAPILibrary/FortnoxAPILibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8</LangVersion>
<PackageId>Fortnox.NET.SDK</PackageId>
<Version>3.4.0-alpha</Version>
<Version>3.4.0</Version>
<Authors>Richard Randak</Authors>
<Company>Softwerk AB</Company>
<Description>Official .NET SDK for Fortnox API. This package is on behalf of Fortnox AB developed and maintained by Softwerk AB. For more information please visit our repository on Github.</Description>
Expand Down

0 comments on commit a8e8121

Please sign in to comment.