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

BUG: Validation error when using direct debit #661

Open
wurst-hans opened this issue Jan 10, 2025 · 2 comments
Open

BUG: Validation error when using direct debit #661

wurst-hans opened this issue Jan 10, 2025 · 2 comments

Comments

@wurst-hans
Copy link

Using current version, I get an error when validating a ZUGFeRD XRechnung that uses payment type 59 (Direct Debit) and contains a financial institution. XML snippet:

<ram:SpecifiedTradeSettlementPaymentMeans>
  <ram:TypeCode>59</ram:TypeCode>
  <ram:Information>SEPA Lastschrift/Bankeinzug</ram:Information>
  <ram:PayerPartyDebtorFinancialAccount>
    <ram:IBANID>DE1234567890</ram:IBANID>
  </ram:PayerPartyDebtorFinancialAccount>
  <ram:PayerSpecifiedDebtorFinancialInstitution>
    <ram:BICID>DEUTDEMMXXX</ram:BICID>
  </ram:PayerSpecifiedDebtorFinancialInstitution>
</ram:SpecifiedTradeSettlementPaymentMeans>

Current KoSIT validator does not throw any warning or error, but mustangproject rejects the XML with the following error:

schema validation fails:org.xml.sax.SAXParseException; lineNumber: 717; columnNumber: 55; cvccomplex-type.2.4.a: Invalid content was found starting with element
'{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":PayerSpecifiedDebtorFinancialInstitution}'. One of
'{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":PayeePartyCreditorFinancialAccount,
"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":PayeeSpecifiedCreditorFinancialInstitution}' is expected.

When using payment type code 59 there shouldn't be any PayeePartyCreditorFinancial* field, but PayerSpecifiedDebtorFinancial*. When removing the financial institution from the XML, the validation doesn't fail. This seems to be a serious error.

@wurst-hans wurst-hans changed the title BUG: Validation error when using direct debit and providing BUG: Validation error when using direct debit Jan 10, 2025
@wurst-hans
Copy link
Author

I'm not a Java programmer, but first thing I've noticed, that there is no separate schema file (XSD) for profile XRechnung. Second thing: looking at schema for EN1691, the PayerSpecifiedDebtorFinancialInstitution is missing there, although it's defined in DIN CEN/TS 16931-3-3 (and at least in XRechnung too).

@CommanderRaiker
Copy link

I’ve also encountered issues with this part. As strange as it may sound, I believe the order plays a role at some point, and unfortunately, the error messages are not always informative enough.

I think this should work for you:

<ram:ApplicableHeaderTradeSettlement>
  <ram:CreditorReferenceID>DE0000111122223333</ram:CreditorReferenceID>
  <ram:PaymentReference>INVOICE_9999999</ram:PaymentReference>
  <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
  <ram:SpecifiedTradeSettlementPaymentMeans>
    <ram:TypeCode>59</ram:TypeCode>
    <ram:Information>SEPA direct debit</ram:Information>
    <ram:PayerPartyDebtorFinancialAccount>
      <ram:IBANID>DE1111111222222333333</ram:IBANID>
    </ram:PayerPartyDebtorFinancialAccount>
  </ram:SpecifiedTradeSettlementPaymentMeans>
  <ram:ApplicableTradeTax>
  ...
  </ram:ApplicableTradeTax>
  <ram:SpecifiedTradeAllowanceCharge>
  ...
  </ram:SpecifiedTradeAllowanceCharge>
  <ram:SpecifiedTradePaymentTerms>
  ...
  </ram:SpecifiedTradePaymentTerms>
  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  ...
  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>

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

No branches or pull requests

2 participants