Skip to content

Commit

Permalink
Refactoring, documentation
Browse files Browse the repository at this point in the history
Added documentation to various classes,
cleanups
  • Loading branch information
stephanstapel committed Sep 5, 2020
1 parent bb2ac20 commit 162286e
Show file tree
Hide file tree
Showing 13 changed files with 1,588 additions and 96 deletions.
2 changes: 1 addition & 1 deletion ZUGFeRD-Test/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Application
{
internal void Run()
{
InvoiceDescriptor desc = _createNewInvoice();
InvoiceDescriptor desc = _createInvoice();
desc.Save("xrechnung.xml", ZUGFeRDVersion.Version21, Profile.XRechnung);

// --- ZUGFeRD 2.0x tests ---
Expand Down
8 changes: 8 additions & 0 deletions ZUGFeRD/AdditionalReferencedDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@

namespace s2industries.ZUGFeRD
{
/// <summary>
/// Reference documents are supposed to hold additional data you might want to show on item level.
///
/// Reference documents are used e.g. for commissions on item level
/// </summary>
public class AdditionalReferencedDocument : BaseReferencedDocument
{
/// <summary>
/// Reference documents are strongly typed, specify ReferenceTypeCode to allow easy processing by invoicee
/// </summary>
public ReferenceTypeCodes ReferenceTypeCode { get; set; }
}
}
2 changes: 2 additions & 0 deletions ZUGFeRD/BaseReferencedDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class BaseReferencedDocument
/// Bestellnummer / Lieferscheinummer
/// </summary>
public string ID { get; set; }


/// <summary>
/// Bestelldatum / Lieferdatum
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions ZUGFeRD/ContentCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public enum ContentCodes
/// </summary>
ST3,

/// <summary>
/// Unbekannter Wert
/// </summary>
Unknown
}

Expand Down
27 changes: 14 additions & 13 deletions ZUGFeRD/CountryCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,26 @@ namespace s2industries.ZUGFeRD
/// <summary>
/// Country codes based on ISO 3166
/// source:
/// http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements_txt.htm
/// https://cemil.dev/countrieslist
///
/// Note: You don't get a parseable file any more from that URL
///
/// enum can be re-generated using:
///
/// f = file("countries.txt")
/// g = file("output.cs", "w+")
/// g = open('output.cs', 'w+')
///
/// for line in f.readlines():
/// parts = line.replace("\n", "").split(";")
/// with open('countries.json') as json_file:
/// data = json.load(json_file)
/// for p in data:
/// alphaTwo = p['alpha-2']
/// countryCode = p['country-code']
/// name = p['name']
/// g.write('/// <summary>\n')
/// g.write('/// ' + name + '\n')
/// g.write('/// ' + alphaTwo + ' = ' + countryCode + '\n')
/// g.write('/// </summary>\n')
/// g.write(alphaTwo + ' = ' + countryCode + ',\n')
/// g.write('\n')
///
/// g.write("/// <summary>\n")
/// g.write("/// " + parts[0] + "\n")
/// g.write("/// </summary>\n")
/// g.write(parts[1] + ",\n")
/// g.write("\n")
///
/// f.close()
/// g.close()
///
/// Enumeration of Country Codes
Expand Down
Loading

0 comments on commit 162286e

Please sign in to comment.