ZUGFeRD / mustangproject

Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
http://www.mustangproject.org
Apache License 2.0
234 stars 132 forks source link

Allow tradeparty electronic address with leitwegid like setEmail #366

Open razilein opened 7 months ago

razilein commented 7 months ago

I'm using ZUGFeRD2PullProvider with the profile XRechnung.

I want do add the recipient. It's necessary for validation to add an electronic address. I want to use the leitwegId instead of the email-address.

Maybe you can provide a new method setElectronicAddress(String address, String easCode) for this purpose? In Javadoc you can add a hint to use the eas-code from this list: https://www.xrepository.de/details/urn:xoev-de:kosit:codeliste:eas_5#version

<ram:BuyerTradeParty>
        <ram:ID>98765</ram:ID>
        <ram:Name>Mustermann GmbH</ram:Name>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>99999</ram:PostcodeCode>
          <ram:LineOne>Teststraße 1</ram:LineOne>
          <ram:CityName>Musterhausen</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:URIUniversalCommunication>
          <ram:URIID schemeID="EM">mustermann@example.com</ram:URIID>
        </ram:URIUniversalCommunication>
      </ram:BuyerTradeParty>

setElectronicAddress("123456789", "0204") should generate:

<ram:BuyerTradeParty>
        <ram:ID>98765</ram:ID>
        <ram:Name>Mustermann GmbH</ram:Name>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>99999</ram:PostcodeCode>
          <ram:LineOne>Teststraße 1</ram:LineOne>
          <ram:CityName>Musterhausen</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:URIUniversalCommunication>
          <ram:URIID schemeID="0204">123456789</ram:URIID>
        </ram:URIUniversalCommunication>
      </ram:BuyerTradeParty>
jstaerk commented 7 months ago

good idea, I suggest to use a SchemedID instance for that purpose, three possibilities: 1) I can show you how to implement & push it yourself (possible meetings e.g. https://doodle.com/meeting/participate/id/b6Y3gqLa), 2) You could wait until someone has time and feels like it 3) if you want to push it: commercial support support for that is clearly in the three-digit-euro-range