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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default IZUGFeRDExportableOrganization getOwnOrganization() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* who processed the order
|
* who processed the order
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -292,6 +292,14 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
|||||||
xml = xml + " <ram:SellerTradeParty>\n" //$NON-NLS-1$
|
xml = xml + " <ram:SellerTradeParty>\n" //$NON-NLS-1$
|
||||||
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
|
||||||
+ " <ram:Name>" + trans.getOwnOrganisationName() + "</ram:Name>\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
+ " <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) {
|
if (trans.getOwnContact() != null) {
|
||||||
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + trans.getOwnContact().getName()
|
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + trans.getOwnContact().getName()
|
||||||
+ "</ram:PersonName>\n";
|
+ "</ram:PersonName>\n";
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
|||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public IZUGFeRDExportableOrganization getOwnOrganization() {
|
||||||
|
return new SenderOrganization();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
||||||
Payment[] payments = new Payment[1];
|
Payment[] payments = new Payment[1];
|
||||||
@@ -101,6 +105,21 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
protected class SenderContact implements IZUGFeRDExportableContact {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user