Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/despatch advice referenced document #266

Conversation

dbingham-tl
Copy link
Contributor

Field BT-16 (DespatchAdviceReferencedDocument) was missing. According to XRechnung and ZUGFeRD Specifications the field is used to reference despatch advice numbers.
The Deutsche Bahn AG for example uses this in context of XRechnung to receive corresponding delivery-note numbers as there is no DeliveryNoteReferencedDocument in XRechnung.

@stephanstapel
Copy link
Owner

Thanks for your pull request!
Can you please initialize the property with an empty list.
Could you then make the setter internal and allow adding a document only via function? It's still barely noticeable in the code :) but I try to encapsulate those member variables more.
Is it also possible to add a test case?

@dbingham-tl
Copy link
Contributor Author

dbingham-tl commented May 14, 2024

Sure! I'll make the set of the Property internal. The wrapping Setter function already exists.
Regarding the list: According to the documentations there's only 0..1 allowed DespatchAdviceReferencedDocuments. Would a List still be correct here?

@stephanstapel
Copy link
Owner

Thanks again!
I didn't check the documentation :) If its 0..1, it shouldn't be a list but more a single object like here:

public DeliveryNoteReferencedDocument DeliveryNoteReferencedDocument { get; set; } = null;

@dbingham-tl
Copy link
Contributor Author

There we go. I noticed that while creating the test, that "IssueDateTime" namespace in the Descriptor22Reader was never found in the saved xml, as the writer saves it under FormattedIssueDateTime.
Interestingly, there is not such problem with the DeliveryNoteReferencedDocument, but I simply copied the code from there (Reader & Writer).
The main difference I find is the WriteStartElement for the DeliveryNote part expluding the XRechnung profiles....But that should not change the namespace from FormattedIssueDateTime to IssueDateTime, right?

It's important to note: I only added the DateTime, as the format of DespatchAdviceReferencedDocument (According to specs) is a DocumentReference, which contains a date. However in the specs (including the examples) the date was never realy used.
Nevertheless, we support it with this merge :)

@stephanstapel stephanstapel merged commit 800d9e6 into stephanstapel:master May 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants