updated some javadoc

This commit is contained in:
jstaerk
2020-11-12 08:06:53 +01:00
parent bb42381c67
commit b6aad03da2
9 changed files with 333 additions and 72 deletions

View File

@@ -36,13 +36,13 @@ 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, 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;
protected TradeParty sender = null, recipient = null, deliveryAddress = null;
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
protected ArrayList<String> notes = null;
protected String contractReferencedDocument = null;
protected Date occurrenceDateFrom = null;
protected Date occurrenceDateTo = null;
protected Date detailedDeliveryDateStart = null;
protected Date detailedDeliveryPeriodEnd = null;
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(),
Charges = new ArrayList<IZUGFeRDAllowanceCharge>(), LogisticsServiceCharges = new ArrayList<IZUGFeRDAllowanceCharge>();
@@ -59,7 +59,9 @@ public class Invoice implements IExportableTransaction {
return documentName;
}
public String getContractReferencedDocument() { return contractReferencedDocument; }
public String getContractReferencedDocument() {
return contractReferencedDocument;
}
public Invoice setDocumentName(String documentName) {
this.documentName = documentName;
@@ -94,7 +96,7 @@ public class Invoice implements IExportableTransaction {
*/
public Invoice setCorrection(String number) {
setBuyerOrderReferencedDocumentID(number);
documentCode= DocumentCodeTypeConstants.CORRECTEDINVOICE;
documentCode = DocumentCodeTypeConstants.CORRECTEDINVOICE;
return this;
}
@@ -144,7 +146,6 @@ public class Invoice implements IExportableTransaction {
}
public Invoice setShipToStreet(String shipToStreet) {
this.shipToStreet = shipToStreet;
return this;
@@ -209,6 +210,7 @@ public class Invoice implements IExportableTransaction {
@Deprecated
/***
* @deprecated use TradeParty::addTaxID instead
* @see TradeParty
*/
public Invoice setOwnTaxID(String ownTaxID) {
sender.addTaxID(ownTaxID);
@@ -223,6 +225,7 @@ public class Invoice implements IExportableTransaction {
@Deprecated
/***
* @deprecated use TradeParty::addVATID instead
* @see TradeParty
*/
public Invoice setOwnVATID(String ownVATID) {
sender.addVATID(ownVATID);
@@ -234,6 +237,12 @@ public class Invoice implements IExportableTransaction {
return ownForeignOrganisationID;
}
@Deprecated
/***
* @deprecated use TradeParty instead
* @see TradeParty
*/
public Invoice setOwnForeignOrganisationID(String ownForeignOrganisationID) {
this.ownForeignOrganisationID = ownForeignOrganisationID;
return this;
@@ -244,6 +253,12 @@ public class Invoice implements IExportableTransaction {
return ownOrganisationName;
}
@Deprecated
/***
* @deprecated use senders' TradeParty's name instead
* @see TradeParty
*/
public Invoice setOwnOrganisationName(String ownOrganisationName) {
this.ownOrganisationName = ownOrganisationName;
return this;
@@ -273,7 +288,7 @@ public class Invoice implements IExportableTransaction {
@Override
public String[] getNotes() {
if (notes==null) {
if (notes == null) {
return null;
}
return notes.toArray(new String[0]);
@@ -344,6 +359,11 @@ public class Invoice implements IExportableTransaction {
return sender;
}
/***
* sets a named sender contact
* @param ownContact
* @return
*/
public Invoice setOwnContact(Contact ownContact) {
this.sender.setContact(ownContact);
return this;
@@ -353,14 +373,26 @@ public class Invoice implements IExportableTransaction {
return recipient;
}
/**
* required.
* sets the invoice receiving institution = invoicee
* @param recipient
* @return
*/
public Invoice setRecipient(TradeParty recipient) {
this.recipient = recipient;
return this;
}
/**
* required.
* sets the invoicing institution = invoicer
* @param sender
* @return
*/
public Invoice setSender(TradeParty sender) {
this.sender = sender;
if ((sender.getBankDetails()!=null)&&(sender.getBankDetails().size()>0)) {
if ((sender.getBankDetails() != null) && (sender.getBankDetails().size() > 0)) {
// convert bankdetails
}
@@ -372,7 +404,7 @@ public class Invoice implements IExportableTransaction {
if (Allowances.isEmpty()) {
return null;
} else
return Allowances.toArray(new IZUGFeRDAllowanceCharge[0]);
return Allowances.toArray(new IZUGFeRDAllowanceCharge[0]);
}
@@ -397,11 +429,11 @@ public class Invoice implements IExportableTransaction {
@Override
public IZUGFeRDTradeSettlement[] getTradeSettlement() {
if (getSender()==null) {
if (getSender() == null) {
return null;
}
return ((TradeParty)getSender()).getAsTradeSettlement();
return ((TradeParty) getSender()).getAsTradeSettlement();
}
@@ -421,6 +453,11 @@ public class Invoice implements IExportableTransaction {
return deliveryAddress;
}
/***
* if the delivery address is not the recipient address, it can be specified here
* @param deliveryAddress
* @return
*/
public Invoice setDeliveryAddress(TradeParty deliveryAddress) {
this.deliveryAddress = deliveryAddress;
return this;
@@ -431,14 +468,18 @@ public class Invoice implements IExportableTransaction {
return ZFItems.toArray(new IZUGFeRDExportableItem[0]);
}
/**
* required
* adds invoice "lines" :-)
* @param item
* @return
*/
public Invoice addItem(IZUGFeRDExportableItem item) {
ZFItems.add(item);
return this;
}
/***
* checks if all required items are set in order to be able to export it
* @return true if all required items are set
@@ -454,61 +495,72 @@ public class Invoice implements IExportableTransaction {
// this.country = country;
}
/***
* adds a document level addition to the price
* @param izac
* @return
*/
public Invoice addCharge(IZUGFeRDAllowanceCharge izac) {
Charges.add(izac);
return this;
}
/***
* adds a document level rebate
* @param izac
* @return
*/
public Invoice addAllowance(IZUGFeRDAllowanceCharge izac) {
Allowances.add(izac);
return this;
}
/***
* adds the ID of a contract referenced in the invoice
* @param s
* @return
*/
public Invoice setContractReferencedDocument(String s) {
contractReferencedDocument=s;
contractReferencedDocument = s;
return this;
}
public Invoice setOccurrenceDate(Date occur) {
occurrenceDateFrom=occur;
occurrenceDateTo=null;
/***
* sets a document level delivery period,
* which is optional additional to the mandatory deliverydate
* and which will become a BillingSpecifiedPeriod-Element
* @param start
* @param end
* @return fluent setter
*/
public Invoice setDetailedDeliveryPeriod(Date start, Date end) {
detailedDeliveryDateStart = start;
detailedDeliveryPeriodEnd = end;
return this;
}
public Invoice setOccurrencePeriod(Date start, Date end) {
occurrenceDateFrom=start;
occurrenceDateTo=end;
return this;
@Override
public Date getDetailedDeliveryPeriodFrom() {
return detailedDeliveryDateStart;
}
@Override
public Date getOccurrenceDate() {
return occurrenceDateFrom;
}
@Override
public Date getOccurrencePeriodFrom() {
if (occurrenceDateTo!=null) {
return occurrenceDateFrom;
} else {
return null;
}
}
@Override
public Date getOccurrencePeriodTo() {
if (occurrenceDateTo!=null) {
return occurrenceDateTo;
} else {
return null;
}
public Date getDetailedDeliveryPeriodTo() {
return detailedDeliveryPeriodEnd;
}
/***
* adds a free text paragraph, which will become a includedNote element
* @param text
* @return fluent setter
*/
public Invoice addNote(String text) {
if (notes==null) {
notes=new ArrayList<String>();
if (notes == null) {
notes = new ArrayList<String>();
}
notes.add(text);
return this;