Skip to content

Commit 4ceda2a

Browse files
Merge branch 'master' into maintenance/reducedIntellisenseWarnings_correctedSomeComments
2 parents 894781b + 639ac5b commit 4ceda2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+9516
-9516
lines changed

ZUGFeRD.Test/ZUGFeRD22Tests.cs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void TestComment()
6666
desc.TaxBasisAmount = 9.9m;
6767
desc.TaxTotalAmount = 9.9m * 0.19m;
6868
desc.GrandTotalAmount = 9.9m * 1.19m;
69-
desc.DuePayableAmount = 9.9m * 1.19m;
69+
desc.DuePayableAmount = 9.9m * 1.19m;
7070
}
7171

7272

@@ -1028,7 +1028,7 @@ public void TestLoadingSepaPreNotification()
10281028

10291029
Assert.AreEqual("DE98ZZZ09999999999", invoiceDescriptor.PaymentMeans.SEPACreditorIdentifier);
10301030
Assert.AreEqual("REF A-123", invoiceDescriptor.PaymentMeans.SEPAMandateReference);
1031-
Assert.AreEqual(PaymentMeansTypeCodes.SEPADirectDebit, invoiceDescriptor.PaymentMeans.TypeCode);
1031+
Assert.AreEqual(PaymentMeansTypeCodes.SEPADirectDebit, invoiceDescriptor.PaymentMeans.TypeCode);
10321032
Assert.AreEqual(1, invoiceDescriptor.DebitorBankAccounts.Count);
10331033
Assert.AreEqual("DE21860000000086001055", invoiceDescriptor.DebitorBankAccounts[0].IBAN);
10341034

@@ -1424,7 +1424,7 @@ public void TestPartyExtensions()
14241424
// Check the output in the XML for Comfort.
14251425
// REM: In Comfort only ID, GlobalID, Name, and SpecifiedLegalOrganization are allowed.
14261426

1427-
desc.Payee = new Party()
1427+
desc.Payee = new Party()
14281428
{
14291429
ID = new GlobalID(null, "SL1001"),
14301430
Name = "Max Mustermann"
@@ -1459,12 +1459,12 @@ public void TestPartyExtensions()
14591459

14601460

14611461
[TestMethod]
1462-
public void TestShipTo()
1462+
public void TestShipTo()
14631463
{
14641464

14651465
InvoiceDescriptor desc = this._InvoiceProvider.CreateInvoice();
14661466

1467-
desc.ShipTo = new Party()
1467+
desc.ShipTo = new Party()
14681468
{
14691469
ID = new GlobalID(null, "SL1001"),
14701470
GlobalID = new GlobalID(GlobalIDSchemeIdentifiers.GLN, "MusterGLN"),
@@ -1629,11 +1629,11 @@ public void TestParty_WithTaxRegistration()
16291629
City = "Musterstadt",
16301630
Country = CountryCodes.DE,
16311631
CountrySubdivisionName = "Hessen"
1632-
};
1633-
1632+
};
1633+
16341634
desc.AddShipToTaxRegistration("DE123456789", TaxRegistrationSchemeID.VA);
16351635

1636-
desc.Invoicee = new Party()
1636+
desc.Invoicee = new Party()
16371637
{
16381638
Name = "Invoicee",
16391639
ContactName = "Max Mustermann",
@@ -1784,8 +1784,8 @@ public void TestOrderInformation()
17841784
s.Close();
17851785

17861786
MemoryStream ms = new MemoryStream();
1787-
desc.Save(ms, ZUGFeRDVersion.Version23, Profile.Extended);
1788-
1787+
desc.Save(ms, ZUGFeRDVersion.Version23, Profile.Extended);
1788+
17891789
ms.Seek(0, SeekOrigin.Begin);
17901790
StreamReader reader = new StreamReader(ms);
17911791
string text = reader.ReadToEnd();
@@ -1940,10 +1940,10 @@ public void TestWriteAndReadExtended()
19401940
desc.AddLogisticsServiceCharge(10m, "Logistics service charge", TaxTypes.AAC, TaxCategoryCodes.AC, 7m);
19411941

19421942
desc.GetTradePaymentTerms().FirstOrDefault().DueDate = timestamp.AddDays(14);
1943-
desc.AddInvoiceReferencedDocument("RE-12344", timestamp, InvoiceType.PartialInvoice);
1944-
1945-
1946-
//set additional LineItem data
1943+
desc.AddInvoiceReferencedDocument("RE-12344", timestamp, InvoiceType.PartialInvoice);
1944+
1945+
1946+
//set additional LineItem data
19471947
var lineItem = desc.TradeLineItems.FirstOrDefault(i => i.SellerAssignedID == "TB100A4");
19481948
Assert.IsNotNull(lineItem);
19491949
lineItem.Description = "This is line item TB100A4";
@@ -2092,7 +2092,7 @@ public void TestWriteAndReadExtended()
20922092
Assert.AreEqual(timestamp.AddDays(14), loadedInvoice.BillingPeriodEnd);
20932093

20942094
//TradeAllowanceCharges
2095-
Assert.AreEqual(loadedInvoice.GetTradeAllowances().Count, 0);
2095+
Assert.AreEqual(loadedInvoice.GetTradeAllowances().Count, 0);
20962096
var tradeAllowanceCharge = loadedInvoice.GetTradeCharges().FirstOrDefault(i => i.Reason == "Reason for charge");
20972097
Assert.IsNotNull(tradeAllowanceCharge);
20982098
Assert.IsTrue(tradeAllowanceCharge.ChargeIndicator);
@@ -2250,8 +2250,8 @@ public void TestNoBICIDForDebitorFinancialInstitution()
22502250
{
22512251
DateTime issueDateTime = DateTime.Today;
22522252

2253-
InvoiceDescriptor desc = this._InvoiceProvider.CreateInvoice();
2254-
//PayerSpecifiedDebtorFinancialInstitution
2253+
InvoiceDescriptor desc = this._InvoiceProvider.CreateInvoice();
2254+
//PayerSpecifiedDebtorFinancialInstitution
22552255
desc.AddDebitorFinancialAccount("DE02120300000000202051", "MYBIC");
22562256

22572257
MemoryStream ms = new MemoryStream();
@@ -2915,10 +2915,10 @@ public void TestPaymentTermsXRechnungStructuredEndsWithLineBreak()
29152915
string text = reader.ReadToEnd();
29162916

29172917
ms.Seek(0, SeekOrigin.Begin);
2918-
Assert.AreEqual(InvoiceDescriptor.GetVersion(ms), ZUGFeRDVersion.Version23);
2919-
2920-
2921-
// Act
2918+
Assert.AreEqual(InvoiceDescriptor.GetVersion(ms), ZUGFeRDVersion.Version23);
2919+
2920+
2921+
// Act
29222922
ms.Seek(0, SeekOrigin.Begin);
29232923
InvoiceDescriptor loadedInvoice = InvoiceDescriptor.Load(ms);
29242924

@@ -2951,8 +2951,8 @@ public void TestPaymentTermsSingleCardinalityXRechnungStructured()
29512951
desc.AddTradePaymentTerms(description, null, PaymentTermsType.Skonto, 14, 2.25m);
29522952

29532953
MemoryStream ms = new MemoryStream();
2954-
desc.Save(ms, ZUGFeRDVersion.Version23, Profile.XRechnung);
2955-
2954+
desc.Save(ms, ZUGFeRDVersion.Version23, Profile.XRechnung);
2955+
29562956
ms.Seek(0, SeekOrigin.Begin);
29572957
StreamReader reader = new StreamReader(ms);
29582958
string text = reader.ReadToEnd();
@@ -2987,7 +2987,7 @@ public void TestPaymentTermsSingleCardinalityXRechnungStructured()
29872987
Assert.IsTrue(match.Success);
29882988
Assert.AreEqual(match.Groups[1].Value, "SKONTO");
29892989
Assert.AreEqual(match.Groups[2].Value, "14");
2990-
Assert.AreEqual(match.Groups[3].Value, "2.25");
2990+
Assert.AreEqual(match.Groups[3].Value, "2.25");
29912991
}
29922992

29932993

@@ -3040,8 +3040,8 @@ and follow the required line-based syntax.
30403040
[TestMethod]
30413041
public void TestPaymentTermsMultiCardinalityXRechnungStructured()
30423042
{
3043-
DateTime timestamp = DateTime.Now.Date;
3044-
3043+
DateTime timestamp = DateTime.Now.Date;
3044+
30453045
var desc = _InvoiceProvider.CreateInvoice();
30463046
desc.GetTradePaymentTerms().Clear();
30473047
desc.AddTradePaymentTerms(String.Empty, null, PaymentTermsType.Skonto, 14, 2.25m);
@@ -3152,8 +3152,8 @@ public void TestSingleXRechnungStructuredManually()
31523152
public void TestOfficialXRechnungFileForPaymentTerms()
31533153
{
31543154
string path = @"..\..\..\..\documentation\xRechnung\XRechnung 3.0.1\xrechnung-3.0.1-schematron-2.0.1\generated\cii-br-de-18-freespace-test-869-identity.xml";
3155-
path = _makeSurePathIsCrossPlatformCompatible(path);
3156-
3155+
path = _makeSurePathIsCrossPlatformCompatible(path);
3156+
31573157
Stream s = File.Open(path, FileMode.Open);
31583158
InvoiceDescriptor desc = InvoiceDescriptor.Load(s);
31593159
s.Close();
@@ -3450,9 +3450,9 @@ public void TestApplicableTradeDeliveryTermsIsNull()
34503450

34513451
Assert.AreEqual(Profile.Extended, loadedInvoice.Profile);
34523452
Assert.IsNull(loadedInvoice.ApplicableTradeDeliveryTermsCode);
3453-
} // !TestSellerOrderReferencedDocument()
3454-
3455-
3453+
} // !TestSellerOrderReferencedDocument()
3454+
3455+
34563456
[TestMethod]
34573457
public void TestInvoiceExemptions()
34583458
{
@@ -3583,14 +3583,14 @@ public void TestLoadingInvoiceType()
35833583
{
35843584
// load standrd invoice
35853585
string path = @"..\..\..\..\demodata\zugferd21\zugferd_2p1_EXTENDED_Warenrechnung-factur-x.xml";
3586-
path = _makeSurePathIsCrossPlatformCompatible(path);
3586+
path = _makeSurePathIsCrossPlatformCompatible(path);
35873587
InvoiceDescriptor desc = InvoiceDescriptor.Load(path);
35883588

35893589
Assert.AreEqual(desc.Type, InvoiceType.Invoice);
35903590

35913591
// load correction
35923592
path = @"..\..\..\..\documentation\zugferd23en\Examples\4. EXTENDED\EXTENDED_Rechnungskorrektur\factur-x.xml";
3593-
path = _makeSurePathIsCrossPlatformCompatible(path);
3593+
path = _makeSurePathIsCrossPlatformCompatible(path);
35943594
desc = InvoiceDescriptor.Load(path);
35953595

35963596
Assert.AreEqual(desc.Type, InvoiceType.Correction);
Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
1-
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
18-
*/
19-
using System;
20-
using System.Collections.Generic;
21-
using System.Linq;
22-
using System.Text;
23-
using System.Threading.Tasks;
24-
25-
namespace s2industries.ZUGFeRD
26-
{
27-
/// <summary>
28-
/// Reference documents are supposed to hold additional data you might want to show on item level.
29-
///
30-
/// Reference documents are used e.g. for commissions on item level
31-
/// </summary>
32-
public class AdditionalReferencedDocument : BaseReferencedDocument
33-
{
34-
/// <summary>
35-
/// External document location
36-
/// BT-124, BT-X-28
37-
/// </summary>
38-
public string URIID { get; set; }
39-
40-
/// <summary>
41-
/// Referenced position
42-
/// BT-X-29
43-
/// </summary>
44-
public string LineID { get; set; }
45-
46-
/// <summary>
47-
/// Type of the reference document
48-
/// BT-17-0, BT-18-0, BT-122-0, BT-X-30
49-
/// </summary>
50-
public AdditionalReferencedDocumentTypeCode? TypeCode { get; set; }
51-
52-
/// <summary>
53-
/// Reference documents are strongly typed, specify ReferenceTypeCode to allow easy processing by invoicee
54-
/// BT-18-1
55-
/// </summary>
56-
public ReferenceTypeCodes? ReferenceTypeCode { get; set; }
57-
58-
/// <summary>
59-
/// Description of document
60-
/// BT-123, BT-X-299
61-
/// </summary>
62-
public string Name { get; set; }
63-
64-
/// <summary>
65-
/// An attached document embedded as binary object or sent together with the invoice.
66-
/// BT-125
67-
/// </summary>
68-
public byte[] AttachmentBinaryObject { get; set; } = null;
69-
70-
/// <summary>
71-
/// Filename of attachment
72-
/// BT-125-2
73-
/// </summary>
74-
public string Filename { get; set; }
75-
76-
/// <summary>
77-
/// MimeType of the attached document embedded as binary object.
78-
/// BT-125-1
79-
/// </summary>
80-
public string MimeType => MimeTypeMapper.GetMimeType(Filename);
81-
}
82-
}
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq;
22+
using System.Text;
23+
using System.Threading.Tasks;
24+
25+
namespace s2industries.ZUGFeRD
26+
{
27+
/// <summary>
28+
/// Reference documents are supposed to hold additional data you might want to show on item level.
29+
///
30+
/// Reference documents are used e.g. for commissions on item level
31+
/// </summary>
32+
public class AdditionalReferencedDocument : BaseReferencedDocument
33+
{
34+
/// <summary>
35+
/// External document location
36+
/// BT-124, BT-X-28
37+
/// </summary>
38+
public string URIID { get; set; }
39+
40+
/// <summary>
41+
/// Referenced position
42+
/// BT-X-29
43+
/// </summary>
44+
public string LineID { get; set; }
45+
46+
/// <summary>
47+
/// Type of the reference document
48+
/// BT-17-0, BT-18-0, BT-122-0, BT-X-30
49+
/// </summary>
50+
public AdditionalReferencedDocumentTypeCode? TypeCode { get; set; }
51+
52+
/// <summary>
53+
/// Reference documents are strongly typed, specify ReferenceTypeCode to allow easy processing by invoicee
54+
/// BT-18-1
55+
/// </summary>
56+
public ReferenceTypeCodes? ReferenceTypeCode { get; set; }
57+
58+
/// <summary>
59+
/// Description of document
60+
/// BT-123, BT-X-299
61+
/// </summary>
62+
public string Name { get; set; }
63+
64+
/// <summary>
65+
/// An attached document embedded as binary object or sent together with the invoice.
66+
/// BT-125
67+
/// </summary>
68+
public byte[] AttachmentBinaryObject { get; set; } = null;
69+
70+
/// <summary>
71+
/// Filename of attachment
72+
/// BT-125-2
73+
/// </summary>
74+
public string Filename { get; set; }
75+
76+
/// <summary>
77+
/// MimeType of the attached document embedded as binary object.
78+
/// BT-125-1
79+
/// </summary>
80+
public string MimeType => MimeTypeMapper.GetMimeType(Filename);
81+
}
82+
}

0 commit comments

Comments
 (0)