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 · 5 comments
Open

BUG: Validation error when using direct debit #661

wurst-hans opened this issue Jan 10, 2025 · 5 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>

@jstaerk
Copy link
Collaborator

jstaerk commented Feb 17, 2025

Hello,
could someone please provide a way to reproduce the error, e.g. java source code that creates invalid XML?
thanks!
kind regards
Jochen

@CommanderRaiker
Copy link

Hello, could someone please provide a way to reproduce the error, e.g. java source code that creates invalid XML? thanks! kind regards Jochen

As far as I know, the payment type code BT-81 "59" only requires the following information and may not accept any additional details:

  • BT-91 Debited account identifier / IBAN
  • BT-89 Mandate reference identifier / Mandatsreferenz
  • BT-90 Bank assigned creditor identifier / Gläubiger ID
  • (BT-20) optionally Payment terms / Zahlungsbedingungen

So, I don't see an error here and have never used PayerSpecifiedDebtorFinancialInstitution. I provided an example for using payment type 59 and hope that wurst-hans was able to resolve his issue.

greetings
Raik

@wurst-hans
Copy link
Author

I'm not producing any e-invoice using your tool, so I have no test code in Java for you. But I validate ZUGFeRD invoices only using Mustangproject.
When there is a ZUGFeRD profile "XRechnung", I expect that any valid XRechnung can be contained within a ZUGFeRD PDF. And a valid XRechnung allows using a PayerSpecifiedDebtorFinancialInstitution when the payment type is 59. At least, KoSIT doesn't throw any error on this, but your validator does.
I assume, that this is an error, because your tool doesn't use a dedicated XSD for XRechnung.

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

3 participants