support specifiedlegalorganization
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
|
||||
/** **********************************************************************
|
||||
*
|
||||
* Copyright 2019 Jochen Staerk
|
||||
*
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy
|
||||
* of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public interface IZUGFeRDExportableOrganization {
|
||||
public String getID();
|
||||
|
||||
public String getName();
|
||||
}
|
||||
@@ -83,6 +83,10 @@ public interface IZUGFeRDExportableTransaction {
|
||||
return null;
|
||||
}
|
||||
|
||||
default IZUGFeRDExportableOrganization getOwnOrganization() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* who processed the order
|
||||
*
|
||||
|
||||
@@ -292,6 +292,14 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
xml = xml + " <ram:SellerTradeParty>\n" //$NON-NLS-1$
|
||||
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
|
||||
+ " <ram:Name>" + trans.getOwnOrganisationName() + "</ram:Name>\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (trans.getOwnOrganization()!=null) {
|
||||
|
||||
xml = xml + " <ram:SpecifiedLegalOrganization>\n" +
|
||||
" <ram:ID>"+trans.getOwnOrganization().getID()+"</ram:ID>\n" +
|
||||
" <ram:TradingBusinessName>"+trans.getOwnOrganization().getName()+"</ram:TradingBusinessName>\n" +
|
||||
" </ram:SpecifiedLegalOrganization>";
|
||||
|
||||
}
|
||||
if (trans.getOwnContact() != null) {
|
||||
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + trans.getOwnContact().getName()
|
||||
+ "</ram:PersonName>\n";
|
||||
|
||||
@@ -27,6 +27,10 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
public MustangReaderTestCase(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
@Override public IZUGFeRDExportableOrganization getOwnOrganization() {
|
||||
return new SenderOrganization();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
||||
@@ -100,6 +104,21 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
return "88802";
|
||||
}
|
||||
}
|
||||
|
||||
protected class SenderOrganization implements IZUGFeRDExportableOrganization {
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
|
||||
return "HRA-555123456";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Bei Spiel GmbH";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected class SenderContact implements IZUGFeRDExportableContact {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user