Skip to content

Commit 31f7f24

Browse files
committedMay 26, 2023
Charge, Contact,...
1 parent f326744 commit 31f7f24

24 files changed

+460
-90
lines changed
 

‎Test/intf.ZUGFeRDAccountingAccountTypeCodes.UnitTests.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎Test/intf.ZUGFeRDAdditionalReferencedDocumentTypeCodes.UnitTests.pas

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file
@@ -28,8 +28,8 @@ TZUGFeRDAdditionalReferencedDocumentTypeCodeTest = class
2828
public
2929
[Test]
3030
procedure TestFromString;
31-
[Test]
32-
procedure TestEnumValueToString;
31+
//[Test]
32+
//procedure TestEnumValueToString;
3333
[Test]
3434
procedure TestEnumToString;
3535
end;
@@ -73,22 +73,22 @@ procedure TZUGFeRDAdditionalReferencedDocumentTypeCodeTest.TestEnumToString;
7373
Assert.AreEqual('65536', Value);
7474
end;
7575

76-
procedure TZUGFeRDAdditionalReferencedDocumentTypeCodeTest.TestEnumValueToString;
77-
var
78-
Value: string;
79-
begin
80-
Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.ReferenceDocument);
81-
Assert.AreEqual('916', Value);
82-
83-
Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.InvoiceDataSheet);
84-
Assert.AreEqual('130', Value);
85-
86-
Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.PriceSalesCatalogueResponse);
87-
Assert.AreEqual('50', Value);
88-
89-
Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.Unknown);
90-
Assert.AreEqual('65536', Value);
91-
end;
76+
//procedure TZUGFeRDAdditionalReferencedDocumentTypeCodeTest.TestEnumValueToString;
77+
//var
78+
// Value: string;
79+
//begin
80+
// Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.ReferenceDocument);
81+
// Assert.AreEqual('916', Value);
82+
//
83+
// Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.InvoiceDataSheet);
84+
// Assert.AreEqual('130', Value);
85+
//
86+
// Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.PriceSalesCatalogueResponse);
87+
// Assert.AreEqual('50', Value);
88+
//
89+
// Value := TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(TZUGFeRDAdditionalReferencedDocumentTypeCode.Unknown);
90+
// Assert.AreEqual('65536', Value);
91+
//end;
9292

9393
initialization
9494

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{* Licensed to the Apache Software Foundation (ASF) under one
2+
* or more contributor license agreements. See the NOTICE file
3+
* distributed with this work for additional information
4+
* regarding copyright ownership. The ASF licenses this file
5+
* to you under the Apache License, Version 2.0 (the
6+
* "License"); you may not use this file except in compliance
7+
* with the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.}
17+
18+
unit intf.ZUGFeRDContentCodes.UnitTests;
19+
20+
interface
21+
22+
uses
23+
DUnitX.TestFramework, intf.ZUGFeRDContentCodes;
24+
25+
type
26+
[TestFixture]
27+
TZUGFeRDContentCodesTest = class
28+
public
29+
[Test]
30+
procedure TestFromString;
31+
[Test]
32+
procedure TestEnumToString;
33+
end;
34+
35+
implementation
36+
37+
procedure TZUGFeRDContentCodesTest.TestFromString;
38+
begin
39+
Assert.AreEqual(TZUGFeRDContentCodes.EEV, TZUGFeRDContentCodesExtensions.FromString('EEV'));
40+
Assert.AreEqual(TZUGFeRDContentCodes.WEV, TZUGFeRDContentCodesExtensions.FromString('WEV'));
41+
Assert.AreEqual(TZUGFeRDContentCodes.VEV, TZUGFeRDContentCodesExtensions.FromString('VEV'));
42+
Assert.AreEqual(TZUGFeRDContentCodes.ST1, TZUGFeRDContentCodesExtensions.FromString('ST1'));
43+
Assert.AreEqual(TZUGFeRDContentCodes.ST2, TZUGFeRDContentCodesExtensions.FromString('ST2'));
44+
Assert.AreEqual(TZUGFeRDContentCodes.ST3, TZUGFeRDContentCodesExtensions.FromString('ST3'));
45+
Assert.AreEqual(TZUGFeRDContentCodes.Unknown, TZUGFeRDContentCodesExtensions.FromString('Unknown'));
46+
Assert.AreEqual(TZUGFeRDContentCodes.Unknown, TZUGFeRDContentCodesExtensions.FromString('Invalid'));
47+
end;
48+
49+
procedure TZUGFeRDContentCodesTest.TestEnumToString;
50+
begin
51+
Assert.AreEqual('EEV', TZUGFeRDContentCodesExtensions.EnumToString(TZUGFeRDContentCodes.EEV));
52+
Assert.AreEqual('WEV', TZUGFeRDContentCodesExtensions.EnumToString(TZUGFeRDContentCodes.WEV));
53+
Assert.AreEqual('VEV', TZUGFeRDContentCodesExtensions.EnumToString(TZUGFeRDContentCodes.VEV));
54+
Assert.AreEqual('ST1', TZUGFeRDContentCodesExtensions.EnumToString(TZUGFeRDContentCodes.ST1));
55+
Assert.AreEqual('ST2', TZUGFeRDContentCodesExtensions.EnumToString(TZUGFeRDContentCodes.ST2));
56+
Assert.AreEqual('ST3', TZUGFeRDContentCodesExtensions.EnumToString(TZUGFeRDContentCodes.ST3));
57+
Assert.AreEqual('Unknown', TZUGFeRDContentCodesExtensions.EnumToString(TZUGFeRDContentCodes.Unknown));
58+
end;
59+
60+
initialization
61+
62+
//I was hoping to use RTTI to discover the TestFixture classes, however unlike .NET
63+
//if we don't touch the class somehow then the linker will remove
64+
//the class from the resulting exe.
65+
//We could just do this:
66+
//TMyExampleTests.ClassName;
67+
//TExampleFixture2.ClassName;
68+
//which is enough to make the compiler link the classes into the exe, but that seems a
69+
//bit redundent so I guess we'll just use manual registration. If you use the
70+
//{$STRONGLINKTYPES ON} compiler directive then it will link the TestFixtures in and you
71+
//can use RTTI. The downside to that is the resulting exe will potentially much larger.
72+
//Not sure which version {$STRONGLINKTYPES ON} was introduced so we'll allow RTTI and
73+
//manual registration for now.
74+
75+
// TDUnitX.RegisterTestFixture(TZUGFeRDContentCodesTest);
76+
77+
end.

‎Test/intf.ZUGFeRDGlobalIDSchemeIdentifiers.UnitTests.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎Test/intf.ZUGFeRDQuantityCodes.UnitTests.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎Test/intf.ZUGFeRDTaxCategoryCodes.UnitTests.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎intf.ZUGFeRDAccountingAccountTypeCodes.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎intf.ZUGFeRDAdditionalReferencedDocumentTypeCodes.pas

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file
@@ -49,7 +49,7 @@ interface
4949
TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions = class
5050
public
5151
class function FromString(const s: string): TZUGFeRDAdditionalReferencedDocumentTypeCode;
52-
class function EnumValueToString(t: TZUGFeRDAdditionalReferencedDocumentTypeCode): string;
52+
//class function EnumValueToString(t: TZUGFeRDAdditionalReferencedDocumentTypeCode): string;
5353
class function EnumToString(t: TZUGFeRDAdditionalReferencedDocumentTypeCode): string;
5454
end;
5555

@@ -69,19 +69,20 @@ class function TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.FromString
6969
Result := TZUGFeRDAdditionalReferencedDocumentTypeCode.ReferenceDocument
7070
end;
7171

72-
class function TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(t: TZUGFeRDAdditionalReferencedDocumentTypeCode): string;
73-
begin
74-
Result := IntToStr(Integer(t));
75-
end;
72+
//class function TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumValueToString(t: TZUGFeRDAdditionalReferencedDocumentTypeCode): string;
73+
//begin
74+
// Result := IntToStr(Integer(t));
75+
//end;
7676

7777
class function TZUGFeRDAdditionalReferencedDocumentTypeCodeExtensions.EnumToString(t: TZUGFeRDAdditionalReferencedDocumentTypeCode): string;
7878
begin
79-
case t of
80-
TZUGFeRDAdditionalReferencedDocumentTypeCode.ReferenceDocument: Result := '916';
81-
TZUGFeRDAdditionalReferencedDocumentTypeCode.InvoiceDataSheet: Result := '130';
82-
TZUGFeRDAdditionalReferencedDocumentTypeCode.PriceSalesCatalogueResponse: Result := '50';
83-
else Result := '65536';
84-
end;
79+
Result := IntToStr(Integer(t));
80+
// case t of
81+
// TZUGFeRDAdditionalReferencedDocumentTypeCode.ReferenceDocument: Result := '916';
82+
// TZUGFeRDAdditionalReferencedDocumentTypeCode.InvoiceDataSheet: Result := '130';
83+
// TZUGFeRDAdditionalReferencedDocumentTypeCode.PriceSalesCatalogueResponse: Result := '50';
84+
// else Result := '65536';
85+
// end;
8586
end;
8687

8788
end.

‎intf.ZUGFeRDApplicableProductCharacteristic.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file
@@ -21,7 +21,7 @@ interface
2121

2222
type
2323
/// <summary>
24-
/// Zusätzliche Produkteigenschaft
24+
/// Zusätzliche Produkteigenschaft
2525
/// </summary>
2626
TZUGFeRDApplicableProductCharacteristic = class
2727
private

‎intf.ZUGFeRDAssociatedDocument.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎intf.ZUGFeRDBankAccount.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎intf.ZUGFeRDBaseReferencedDocument.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎intf.ZUGFeRDBuyerOrderReferencedDocument.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{* Licensed to the Apache Software Foundation (ASF) under one
1+
{* Licensed to the Apache Software Foundation (ASF) under one
22
* or more contributor license agreements. See the NOTICE file
33
* distributed with this work for additional information
44
* regarding copyright ownership. The ASF licenses this file

‎intf.ZUGFeRDCharge.pas

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{* Licensed to the Apache Software Foundation (ASF) under one
2+
* or more contributor license agreements. See the NOTICE file
3+
* distributed with this work for additional information
4+
* regarding copyright ownership. The ASF licenses this file
5+
* to you under the Apache License, Version 2.0 (the
6+
* "License"); you may not use this file except in compliance
7+
* with the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.}
17+
18+
unit intf.ZUGFeRDCharge;
19+
20+
interface
21+
22+
uses
23+
intf.ZUGFeRDTax;
24+
25+
type
26+
/// <summary>
27+
/// Abstract base class for the various types
28+
/// of charges
29+
/// </summary>
30+
TZUGFeRDCharge = class
31+
private
32+
FTax: TZUGFeRDTax;
33+
FAmount: Currency;
34+
public
35+
constructor Create;
36+
destructor Destroy; override;
37+
/// <summary>
38+
/// Tax that is applied to the charge
39+
/// </summary>
40+
/// <value></value>
41+
property Tax: TZUGFeRDTax read FTax write FTax;
42+
/// <summary>
43+
/// Monetary charge amount, presented in the respective currency
44+
/// </summary>
45+
/// <value></value>
46+
property Amount: Currency read FAmount write FAmount;
47+
end;
48+
49+
implementation
50+
51+
52+
{ TZUGFeRDCharge }
53+
54+
constructor TZUGFeRDCharge.Create;
55+
begin
56+
FTax := TZUGFeRDTax.Create;
57+
end;
58+
59+
destructor TZUGFeRDCharge.Destroy;
60+
begin
61+
if Assigned(FTax) then begin FTax.Free; FTax := nil; end;
62+
inherited;
63+
end;
64+
65+
end.

‎intf.ZUGFeRDContact.pas

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{* Licensed to the Apache Software Foundation (ASF) under one
2+
* or more contributor license agreements. See the NOTICE file
3+
* distributed with this work for additional information
4+
* regarding copyright ownership. The ASF licenses this file
5+
* to you under the Apache License, Version 2.0 (the
6+
* "License"); you may not use this file except in compliance
7+
* with the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.}
17+
18+
unit intf.ZUGFeRDContact;
19+
20+
interface
21+
22+
type
23+
/// <summary>
24+
/// Detail information of a contact person of e.g. a party
25+
/// </summary>
26+
TZUGFeRDContact = class
27+
private
28+
FName: string;
29+
FOrgUnit: string;
30+
FEmailAddress: string;
31+
FPhoneNo: string;
32+
FFaxNo: string;
33+
public
34+
/// <summary>
35+
/// Contact Name
36+
/// </summary>
37+
property Name: string read FName write FName;
38+
/// <summary>
39+
/// Contact organizational unit (with a party)
40+
/// </summary>
41+
property OrgUnit: string read FOrgUnit write FOrgUnit;
42+
/// <summary>
43+
/// Contact email address
44+
/// </summary>
45+
property EmailAddress: string read FEmailAddress write FEmailAddress;
46+
/// <summary>
47+
/// Contact phone number
48+
/// </summary>
49+
property PhoneNo: string read FPhoneNo write FPhoneNo;
50+
/// <summary>
51+
/// Contact fax number
52+
/// </summary>
53+
property FaxNo: string read FFaxNo write FFaxNo;
54+
end;
55+
56+
implementation
57+
58+
end.

0 commit comments

Comments
 (0)