moving tax id and vat id into tradeparty
This commit is contained in:
@@ -28,7 +28,7 @@ import java.util.Date;
|
||||
|
||||
public class Invoice implements IExportableTransaction {
|
||||
|
||||
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownTaxID = null, ownVATID = null, ownForeignOrganisationID = null, ownOrganisationName = null, currency = null, paymentTermDescription = null;
|
||||
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownForeignOrganisationID = null, ownOrganisationName = null, currency = null, paymentTermDescription = null;
|
||||
protected Date issueDate = null, dueDate = null, deliveryDate = null;
|
||||
protected BigDecimal totalPrepaidAmount = null;
|
||||
protected TradeParty sender=null, recipient = null, deliveryAddress = null;
|
||||
@@ -81,6 +81,16 @@ public class Invoice implements IExportableTransaction {
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* switch type to invoice correction and refer to document number
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
public Invoice setCorrection(String number) {
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationFullPlaintextInfo() {
|
||||
return ownOrganisationFullPlaintextInfo;
|
||||
@@ -183,21 +193,21 @@ public class Invoice implements IExportableTransaction {
|
||||
|
||||
@Override
|
||||
public String getOwnTaxID() {
|
||||
return ownTaxID;
|
||||
return getSender().getTaxID();
|
||||
}
|
||||
|
||||
public Invoice setOwnTaxID(String ownTaxID) {
|
||||
this.ownTaxID = ownTaxID;
|
||||
sender.addTaxID(ownTaxID);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnVATID() {
|
||||
return ownVATID;
|
||||
return getSender().getVATID();
|
||||
}
|
||||
|
||||
public Invoice setOwnVATID(String ownVATID) {
|
||||
this.ownVATID = ownVATID;
|
||||
sender.addVATID(ownVATID);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -401,7 +411,7 @@ public class Invoice implements IExportableTransaction {
|
||||
* @return
|
||||
*/
|
||||
public boolean isValid() {
|
||||
return (dueDate != null) && (sender != null) && (ownTaxID != null) && (ownVATID != null) && (recipient != null);
|
||||
return (dueDate != null) && (sender != null) && (sender.getTaxID() != null) && (sender.getVATID() != null) && (recipient != null);
|
||||
//contact
|
||||
// this.phone = phone;
|
||||
// this.email = email;
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* *********************************************************************
|
||||
* <p>
|
||||
* Copyright 2018 Jochen Staerk
|
||||
* <p>
|
||||
* Use is subject to license terms.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
public class InvoiceCorrection extends Invoice {
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import org.mustangproject.ZUGFeRD.IZUGFeRDExportableTradeParty;
|
||||
public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
|
||||
protected String name,zip,street,location,country;
|
||||
protected String taxID=null, vatID=null;
|
||||
protected Contact contact=null;
|
||||
|
||||
public TradeParty(String name, String street, String zip, String location, String country) {
|
||||
@@ -22,6 +23,26 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
return this;
|
||||
}
|
||||
|
||||
public TradeParty addTaxID(String taxID) {
|
||||
this.taxID=taxID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TradeParty addVATID(String vatID) {
|
||||
this.vatID=vatID;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVATID() {
|
||||
return vatID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTaxID() {
|
||||
return taxID;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,11 @@ public interface IExportableTransaction {
|
||||
* @return Tax ID (not VAT ID) of the sender
|
||||
*/
|
||||
default String getOwnTaxID() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getTaxID();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +179,11 @@ public interface IExportableTransaction {
|
||||
* @return VAT ID (Umsatzsteueridentifikationsnummer) of the sender
|
||||
*/
|
||||
default String getOwnVATID() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getVATID();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,12 +18,14 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import org.mustangproject.TradeParty;
|
||||
|
||||
/**
|
||||
* Mustangproject's ZUGFeRD implementation neccessary interface for ZUGFeRD exporter Licensed under the APLv2
|
||||
*
|
||||
* @author jstaerk
|
||||
* @version 1.2.0
|
||||
* dated 2014-05-10
|
||||
* @version 2.0.0
|
||||
* dated 2020-09-12
|
||||
*/
|
||||
|
||||
|
||||
@@ -127,4 +129,14 @@ public interface IZUGFeRDExportableTradeParty {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* obligatory for sender but not for recipient
|
||||
* @return
|
||||
*/
|
||||
default String getTaxID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user