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

X-Rechnung direct-debit missing mandatory field BT-90 #370

Closed
asdf00000 opened this issue Apr 19, 2024 · 6 comments
Closed

X-Rechnung direct-debit missing mandatory field BT-90 #370

asdf00000 opened this issue Apr 19, 2024 · 6 comments

Comments

@asdf00000
Copy link
Contributor

For X-Rechnung with payment method direct debit, the now mandatory field BT-90 CreditorReferenceID is missing.
The current Validator rejects files without that field.
This is how it should look like:

<ram:ApplicableHeaderTradeSettlement>             
    <ram:CreditorReferenceID>[Bank assigned creditor identifier]</ram:CreditorReferenceID>
    <ram:PaymentReference>12345</ram:PaymentReference>
    <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
    <ram:SpecifiedTradeSettlementPaymentMeans>
        <ram:TypeCode>59</ram:TypeCode>
        ...

The problem is, that the field must be inside the ApplicableHeaderTradeSettlement-block, not inside the direct-debit-specific SpecifiedTradeSettlementPaymentMeans-block.
So just adding the field into IZUGFeRDTradeSettlementDebit won't suffice as it is needed in the higher level xml-block.
As a consequence, including the field might require rearranging the code that creates the ApplicableHeaderTradeSettlement-block.

Is anyone already working on it?

@jstaerk
Copy link
Collaborator

jstaerk commented May 24, 2024

If your issue is a question if a mustang generated file is valid(?) please include either the complete source code and/or the complete output so that I can have a look and run it through a validator.

@asdf00000
Copy link
Contributor Author

No, it's not a question, just a notice. I have researched the issue before I opened the ticket.

I tested it with KOSIT Version 3.0.1_2023-09-22 and Mustang-Validator 2.10.0.
Every X-Rechnung created with Mustang 2.10.0 with payment type direct-debit is rejected by KOSIT-Validator and Mustang-Validator because the CreditorReferenceID-field is not implemented.
The field used to be optional in earlier versions of X-Rechnung, but is now mandatory for payment type direct-debit.
As I mentioned above, the following line must be adeed so that the X-Rechnung passes the validation.

<ram:CreditorReferenceID>[Bank assigned creditor identifier]</ram:CreditorReferenceID>

I thought about implementing it myself and submitting a pull request, but your current code structure is not suitable for that without major changes.

So I fixed it locally for myself for now by post-processing the XML-string and injecting the missing line.

@sebastianschmitz1510
Copy link

Last week I had the same issue with a "xRechnung" with a missing "CreditorReferenceID" (BT-90).
By manually adding the "CreditorReferenceID" as the first element in "ApplicableHeaderTradeSettlement", the validator declared the X-invoice as valid.
I use mustang-validator and mustang-library in version 2.10.0.

@jstaerk
Copy link
Collaborator

jstaerk commented Jul 8, 2024

Even if it is just a notice, could someone please include either the complete source code and/or the complete output so that I can have a look and run it through a validator?

@asdf00000
Copy link
Contributor Author

You can generate any random X-Rechnung with payment type direct debit.

Example for Invalid X-Rechnung generated with mustang:
https://github.com/asdf00000/XRechnungSamples/blob/main/xrechnung-invalid.xml

Validator error:
|[BR-DE-30] Wenn "DIRECT DEBIT" BG-19 vorhanden ist, dann muss "Bank assigned creditor identifier" BT-90 übermittelt werden.

This is how it should look like:
https://github.com/asdf00000/XRechnungSamples/blob/main/xrechnung-valid.xml

@jstaerk
Copy link
Collaborator

jstaerk commented Aug 27, 2024

Thanks for the PR I assume this is solved now in master head?

@jstaerk jstaerk closed this as completed Aug 27, 2024
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