-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
intf.ZUGFeRDElectronicAddressSchemeIdentifiers.pas
430 lines (373 loc) · 14.8 KB
/
intf.ZUGFeRDElectronicAddressSchemeIdentifiers.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
{* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.}
unit intf.ZUGFeRDElectronicAddressSchemeIdentifiers;
interface
uses System.Classes, System.SysUtils;
type
/// <summary>
/// For a reference see:
/// https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/
/// </summary>
TZUGFeRDElectronicAddressSchemeIdentifiers = (
/// <summary>
/// Unknown means, we have a problem ...
/// </summary>
Unknown = 0,
/// <summary>
/// EAN Location Code
/// </summary>
EanLocationCode = 0088,
/// <summary>
/// Leitweg-ID
/// </summary>
LeitwegID = 0204,
/// <summary>
/// Hungary VAT number
/// </summary>
HungaryVatNumber = 9910,
/// <summary>
/// Austria VAT number
/// </summary>
AustriaVatNumber = 9914,
/// <summary>
/// Andorra VAT number
/// </summary>
AndorraVatNumber = 9922,
/// <summary>
/// Albania VAT number
/// </summary>
AlbaniaVatNumber = 9923,
/// <summary>
/// Bosnia and Herzegovina VAT number
/// </summary>
BosniaAndHerzegovinaVatNumber = 9924,
/// <summary>
/// Belgium VAT number
/// </summary>
BelgiumVatNumber = 9925,
/// <summary>
/// Bulgaria VAT number
/// </summary>
BulgariaVatNumber = 9926,
/// <summary>
/// Switzerland VAT number
/// </summary>
SwitzerlandVatNumber = 9927,
/// <summary>
/// Cyprus VAT number
/// </summary>
CyprusVatNumber = 9928,
/// <summary>
/// Czech Republic VAT number
/// </summary>
CzechRepublicVatNumber = 9929,
/// <summary>
/// Germany VAT number
/// </summary>
GermanyVatNumber = 9930,
/// <summary>
/// Estonia VAT number
/// </summary>
EstoniaVatNumber = 9931,
/// <summary>
/// United Kingdom VAT number
/// </summary>
UnitedKingdomVatNumber = 9932,
/// <summary>
/// Greece VAT number
/// </summary>
GreeceVatNumber = 9933,
/// <summary>
/// Croatia VAT number
/// </summary>
CroatiaVatNumber = 9934,
/// <summary>
/// Ireland VAT number
/// </summary>
IrelandVatNumber = 9935,
/// <summary>
/// Liechtenstein VAT number
/// </summary>
LiechtensteinVatNumber = 9936,
/// <summary>
/// Lithuania VAT number
/// </summary>
LithuaniaVatNumber = 9937,
/// <summary>
/// Luxemburg VAT number
/// </summary>
LuxemburgVatNumber = 9938,
/// <summary>
/// Latvia VAT number
/// </summary>
LatviaVatNumber = 9939,
/// <summary>
/// Monaco VAT number
/// </summary>
MonacoVatNumber = 9940,
/// <summary>
/// Montenegro VAT number
/// </summary>
MontenegroVatNumber = 9941,
/// <summary>
/// Macedonia, of the former Yugoslav Republic VAT number
/// </summary>
MacedoniaVatNumber = 9942,
/// <summary>
/// Malta VAT number
/// </summary>
MaltaVatNumber = 9943,
/// <summary>
/// Netherlands VAT number
/// </summary>
NetherlandsVatNumber = 9944,
/// <summary>
/// Poland VAT number
/// </summary>
PolandVatNumber = 9945,
/// <summary>
/// Portugal VAT number
/// </summary>
PortugalVatNumber = 9946,
/// <summary>
/// Romania VAT number
/// </summary>
RomaniaVatNumber = 9947,
/// <summary>
/// Serbia VAT number
/// </summary>
SerbiaVatNumber = 9948,
/// <summary>
/// Slovenia VAT number
/// </summary>
SloveniaVatNumber = 9949,
/// <summary>
/// Slovakia VAT number
/// </summary>
SlovakiaVatNumber = 9950,
/// <summary>
/// San Marino VAT number
/// </summary>
SanMarinoVatNumber = 9951,
/// <summary>
/// Turkey VAT number
/// </summary>
TurkeyVatNumber = 9952,
/// <summary>
/// Holy See (Vatican City State) VAT number
/// </summary>
HolySeeVatNumber = 9953,
/// <summary>
/// Swedish VAT number
/// </summary>
SwedishVatNumber = 9955,
/// <summary>
/// French VAT number
/// </summary>
FrenchVatNumber = 9957,
/// <summary>
/// Belgian Crossroad Bank of Enterprises
/// </summary>
BelgianCrossroad = 9956,
/// <summary>
/// German Leitweg ID
/// </summary>
GermanLeitwegID = 9958,
/// <summary>
/// Employer Identification Number (EIN, USA)
/// </summary>
EmployerIdentificationNumber = 9959,
/// <summary>
/// O.F.T.P. (ODETTE File Transfer Protocol)
/// </summary>
AN = 999999,
/// <summary>
/// X.400 address for mail text
/// </summary>
AQ = 999998,
/// <summary>
/// AS2 exchange
/// </summary>
AS_ = 999997,
/// <summary>
/// File Transfer Protocol
/// </summary>
AU = 999996,
/// <summary>
/// Electronic mail
/// </summary>
EM = 999995
);
TZUGFeRDElectronicAddressSchemeIdentifiersExtensions = class
public
class function FromString(s: string): TZUGFeRDElectronicAddressSchemeIdentifiers;
class function EnumToString(c: TZUGFeRDElectronicAddressSchemeIdentifiers): string;
end;
implementation
{ TZUGFeRDElectronicAddressSchemeIdentifiersExtensions }
class function TZUGFeRDElectronicAddressSchemeIdentifiersExtensions.EnumToString(
c: TZUGFeRDElectronicAddressSchemeIdentifiers): string;
begin
case c of
TZUGFeRDElectronicAddressSchemeIdentifiers.EanLocationCode: Result := '0088';
TZUGFeRDElectronicAddressSchemeIdentifiers.LeitwegID: Result := '0204';
TZUGFeRDElectronicAddressSchemeIdentifiers.HungaryVatNumber: Result := '9910';
TZUGFeRDElectronicAddressSchemeIdentifiers.AustriaVatNumber: Result := '9914';
TZUGFeRDElectronicAddressSchemeIdentifiers.AndorraVatNumber: Result := '9922';
TZUGFeRDElectronicAddressSchemeIdentifiers.AlbaniaVatNumber: Result := '9923';
TZUGFeRDElectronicAddressSchemeIdentifiers.BosniaAndHerzegovinaVatNumber: Result := '9924';
TZUGFeRDElectronicAddressSchemeIdentifiers.BelgiumVatNumber: Result := '9925';
TZUGFeRDElectronicAddressSchemeIdentifiers.BulgariaVatNumber: Result := '9926';
TZUGFeRDElectronicAddressSchemeIdentifiers.SwitzerlandVatNumber: Result := '9927';
TZUGFeRDElectronicAddressSchemeIdentifiers.CyprusVatNumber: Result := '9928';
TZUGFeRDElectronicAddressSchemeIdentifiers.CzechRepublicVatNumber: Result := '9929';
TZUGFeRDElectronicAddressSchemeIdentifiers.GermanyVatNumber: Result := '9930';
TZUGFeRDElectronicAddressSchemeIdentifiers.EstoniaVatNumber: Result := '9931';
TZUGFeRDElectronicAddressSchemeIdentifiers.UnitedKingdomVatNumber: Result := '9932';
TZUGFeRDElectronicAddressSchemeIdentifiers.GreeceVatNumber: Result := '9933';
TZUGFeRDElectronicAddressSchemeIdentifiers.CroatiaVatNumber: Result := '9934';
TZUGFeRDElectronicAddressSchemeIdentifiers.IrelandVatNumber: Result := '9935';
TZUGFeRDElectronicAddressSchemeIdentifiers.LiechtensteinVatNumber: Result := '9936';
TZUGFeRDElectronicAddressSchemeIdentifiers.LithuaniaVatNumber: Result := '9937';
TZUGFeRDElectronicAddressSchemeIdentifiers.LuxemburgVatNumber: Result := '9938';
TZUGFeRDElectronicAddressSchemeIdentifiers.LatviaVatNumber: Result := '9939';
TZUGFeRDElectronicAddressSchemeIdentifiers.MonacoVatNumber: Result := '9940';
TZUGFeRDElectronicAddressSchemeIdentifiers.MontenegroVatNumber: Result := '9941';
TZUGFeRDElectronicAddressSchemeIdentifiers.MacedoniaVatNumber: Result := '9942';
TZUGFeRDElectronicAddressSchemeIdentifiers.MaltaVatNumber: Result := '9943';
TZUGFeRDElectronicAddressSchemeIdentifiers.NetherlandsVatNumber: Result := '9944';
TZUGFeRDElectronicAddressSchemeIdentifiers.PolandVatNumber: Result := '9945';
TZUGFeRDElectronicAddressSchemeIdentifiers.PortugalVatNumber: Result := '9946';
TZUGFeRDElectronicAddressSchemeIdentifiers.RomaniaVatNumber: Result := '9947';
TZUGFeRDElectronicAddressSchemeIdentifiers.SerbiaVatNumber: Result := '9948';
TZUGFeRDElectronicAddressSchemeIdentifiers.SloveniaVatNumber: Result := '9949';
TZUGFeRDElectronicAddressSchemeIdentifiers.SlovakiaVatNumber: Result := '9950';
TZUGFeRDElectronicAddressSchemeIdentifiers.SanMarinoVatNumber: Result := '9951';
TZUGFeRDElectronicAddressSchemeIdentifiers.TurkeyVatNumber: Result := '9952';
TZUGFeRDElectronicAddressSchemeIdentifiers.HolySeeVatNumber: Result := '9953';
TZUGFeRDElectronicAddressSchemeIdentifiers.SwedishVatNumber: Result := '9955';
TZUGFeRDElectronicAddressSchemeIdentifiers.FrenchVatNumber: Result := '9957';
TZUGFeRDElectronicAddressSchemeIdentifiers.BelgianCrossroad: Result := '9956';
TZUGFeRDElectronicAddressSchemeIdentifiers.GermanLeitwegID: Result := '9958';
TZUGFeRDElectronicAddressSchemeIdentifiers.EmployerIdentificationNumber: Result := '9959';
TZUGFeRDElectronicAddressSchemeIdentifiers.AN: Result := 'AN';
TZUGFeRDElectronicAddressSchemeIdentifiers.AQ: Result := 'AQ';
TZUGFeRDElectronicAddressSchemeIdentifiers.AS_: Result := 'AS';
TZUGFeRDElectronicAddressSchemeIdentifiers.AU: Result := 'AU';
TZUGFeRDElectronicAddressSchemeIdentifiers.EM: Result := 'EM';
else
Result := '0000';
end;
end;
class function TZUGFeRDElectronicAddressSchemeIdentifiersExtensions.FromString(
s: string): TZUGFeRDElectronicAddressSchemeIdentifiers;
begin
if SameText(s,'0088') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.EanLocationCode else
if SameText(s,'0204') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.LeitwegID else
if SameText(s,'9910') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.HungaryVatNumber else
if SameText(s,'9914') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.AustriaVatNumber else
if SameText(s,'9922') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.AndorraVatNumber else
if SameText(s,'9923') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.AlbaniaVatNumber else
if SameText(s,'9924') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.BosniaAndHerzegovinaVatNumber else
if SameText(s,'9925') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.BelgiumVatNumber else
if SameText(s,'9926') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.BulgariaVatNumber else
if SameText(s,'9927') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.SwitzerlandVatNumber else
if SameText(s,'9928') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.CyprusVatNumber else
if SameText(s,'9929') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.CzechRepublicVatNumber else
if SameText(s,'9930') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.GermanyVatNumber else
if SameText(s,'9931') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.EstoniaVatNumber else
if SameText(s,'9932') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.UnitedKingdomVatNumber else
if SameText(s,'9933') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.GreeceVatNumber else
if SameText(s,'9934') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.CroatiaVatNumber else
if SameText(s,'9935') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.IrelandVatNumber else
if SameText(s,'9936') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.LiechtensteinVatNumber else
if SameText(s,'9937') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.LithuaniaVatNumber else
if SameText(s,'9938') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.LuxemburgVatNumber else
if SameText(s,'9939') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.LatviaVatNumber else
if SameText(s,'9940') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.MonacoVatNumber else
if SameText(s,'9941') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.MontenegroVatNumber else
if SameText(s,'9942') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.MacedoniaVatNumber else
if SameText(s,'9943') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.MaltaVatNumber else
if SameText(s,'9944') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.NetherlandsVatNumber else
if SameText(s,'9945') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.PolandVatNumber else
if SameText(s,'9946') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.PortugalVatNumber else
if SameText(s,'9947') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.RomaniaVatNumber else
if SameText(s,'9948') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.SerbiaVatNumber else
if SameText(s,'9949') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.SloveniaVatNumber else
if SameText(s,'9950') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.SlovakiaVatNumber else
if SameText(s,'9951') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.SanMarinoVatNumber else
if SameText(s,'9952') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.TurkeyVatNumber else
if SameText(s,'9953') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.HolySeeVatNumber else
if SameText(s,'9955') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.SwedishVatNumber else
if SameText(s,'9957') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.FrenchVatNumber else
if SameText(s,'9956') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.BelgianCrossroad else
if SameText(s,'9958') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.GermanLeitwegID else
if SameText(s,'9959') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.EmployerIdentificationNumber else
if SameText(s,'AN') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.AN else
if SameText(s,'AQ') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.AQ else
if SameText(s,'AS') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.AS_ else
if SameText(s,'AU') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.AU else
if SameText(s,'EM') then
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.EM else
Result := TZUGFeRDElectronicAddressSchemeIdentifiers.Unknown;
end;
end.