make accountNo optional#25
Open
lukas-staab wants to merge 1 commit into
Open
Conversation
Author
|
Hey @ms-aranes any plans to merge this PR soon? Right now this is the blocking feature why i cannot use your libary, and i would like to use and ship it :) If you have any questions or suggestions please let me know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the $accountNo parameter nullable with a default value on both DatevAccountLedgerData::addAccountsReceivableLedger() and addAccountsPayableLedger():
Motivation
accountNo (the Gegenkonto / contra account) is optional in the DATEV schema this library implements. In xsds/Belegverwaltung_online_ledger_import_v060.xsd:
minOccurs="0" means the contra account may be omitted — DATEV resolves it later via automatic account assignment (Kontierung) rather than requiring it at import time. This is a common real-world case: the exporting system records the
amount and booking text but deliberately leaves the contra account to be determined in DATEV (e.g. by Steuerberater)
Currently the required string $accountNo forces callers to pass a value the schema treats as optional, which throws ArgumentCountError for an otherwise valid ledger entry. Every other optional field in these methods already follows
the ?type $x = null convention, so this aligns the two required-looking parameters with both the XSD and the rest of the signature.
Changes
Backward compatibility
Fully backward compatible — existing callers that pass accountNo are unaffected; only the "omit it" case becomes possible. The value is already stored as-is into the ledger array and emitted (or skipped) accordingly, matching the
XSD's minOccurs="0".