Package org.mustangproject
Class Invoice
- java.lang.Object
-
- org.mustangproject.Invoice
-
- All Implemented Interfaces:
IExportableTransaction
- Direct Known Subclasses:
CalculatedInvoice
public class Invoice extends java.lang.Object implements IExportableTransaction
An invoice, with fluent setters
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<IZUGFeRDAllowanceCharge>Allowancesprotected java.lang.StringbuyerOrderReferencedDocumentIDprotected java.lang.StringbuyerOrderReferencedDocumentIssueDateTimeprotected java.util.ArrayList<CashDiscount>cashDiscountsprotected java.util.ArrayList<IZUGFeRDAllowanceCharge>Chargesprotected java.lang.StringcontractReferencedDocumentprotected java.lang.StringcreditorReferenceIDprotected java.lang.Stringcurrencyprotected TradePartydeliveryAddressprotected java.util.DatedeliveryDateprotected java.lang.StringdespatchAdviceReferencedDocumentIDprotected java.util.DatedetailedDeliveryDateStartprotected java.util.DatedetailedDeliveryPeriodEndprotected java.lang.StringdocumentCodeprotected java.lang.StringdocumentNameprotected java.util.DatedueDateprotected java.lang.StringinvoiceReferencedDocumentIDprotected java.util.ArrayList<ReferencedDocument>invoiceReferencedDocumentsprotected java.util.DateinvoiceReferencedIssueDateprotected java.util.DateissueDateprotected java.util.ArrayList<IZUGFeRDAllowanceCharge>LogisticsServiceChargesprotected java.util.ArrayList<java.lang.String>notesprotected java.lang.Stringnumberprotected java.lang.StringownForeignOrganisationIDprotected java.lang.StringownOrganisationFullPlaintextInfoprotected java.lang.StringownOrganisationNameprotected TradePartypayeeprotected java.lang.StringpaymentTermDescriptionprotected java.util.ArrayList<IZUGFeRDPaymentTerms>paymentTermsprotected TradePartyrecipientprotected java.lang.StringreferenceNumberprotected java.lang.StringsellerOrderReferencedDocumentIDprotected TradePartysenderprotected java.lang.StringshipToCountryprotected java.lang.StringshipToLocationprotected java.lang.StringshipToOrganisationIDprotected java.lang.StringshipToOrganisationNameprotected java.lang.StringshipToStreetprotected java.lang.StringshipToZIPprotected java.lang.StringspecifiedProcuringProjectIDprotected java.lang.StringspecifiedProcuringProjectNameprotected IReferencedDocumenttenderReferenceprotected java.math.BigDecimaltotalPrepaidAmountprotected java.lang.StringvatDueDateTypeCodeprotected java.util.ArrayList<FileAttachment>xmlEmbeddedFilesprotected java.util.ArrayList<IZUGFeRDExportableItem>ZFItems
-
Constructor Summary
Constructors Constructor Description Invoice()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description InvoiceaddAllowance(IZUGFeRDAllowanceCharge izac)adds a document level rebateInvoiceaddCashDiscount(CashDiscount c)Adds a cash discount (skonto)InvoiceaddCharge(IZUGFeRDAllowanceCharge izac)adds a document level addition to the priceInvoiceaddCustomsNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.CUSInvoiceaddDiscountBonusNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.AAKInvoiceaddGeneralNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.AAIInvoiceaddIntroductionNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.ACYInvoiceaddInvoiceReferencedDocument(ReferencedDocument doc)InvoiceaddItem(IZUGFeRDExportableItem item)required adds invoice "lines" :-)InvoiceaddLegalNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.ABLInvoiceaddNote(java.lang.String text)adds a free text paragraph, which will become an includedNote elementInvoiceaddNotes(java.util.Collection<IncludedNote> notes)InvoiceaddPaymentTerms(IZUGFeRDPaymentTerms paymentTerm)Set multiple payment terms when using the EXTENDED profile.InvoiceaddRegulatoryNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.REGInvoiceaddSellerNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.SURInvoiceaddTaxNote(java.lang.String content)adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.TXDInvoiceembedFileInXML(FileAttachment fa)FileAttachment[]getAdditionalReferencedDocuments()get additional referenced documents acccording to BG-24 XRechnung (Rechnungsbegruendende Unterlagen), i.e.java.lang.StringgetBuyerOrderReferencedDocumentID()get the ID of the BuyerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreementjava.lang.StringgetBuyerOrderReferencedDocumentIssueDateTime()get the issue timestamp of the BuyerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreementCashDiscount[]getCashDiscounts()java.lang.StringgetContractReferencedDocument()java.lang.StringgetCreditorReferenceID()java.lang.StringgetCurrency()get main invoice currency used on the invoiceTradePartygetDeliveryAddress()delivery address, i.e. ram:ShipToTradeParty (only supported for zf2)java.util.DategetDeliveryDate()get delivery datejava.lang.StringgetDespatchAdviceReferencedDocumentID()java.util.DategetDetailedDeliveryPeriodFrom()specifies the document level delivery period, will be included in a BillingSpecifiedPeriod elementjava.util.DategetDetailedDeliveryPeriodTo()specifies the document level delivery period, will be included in a BillingSpecifiedPeriod elementjava.lang.StringgetDocumentCode()java.lang.StringgetDocumentName()appears in /rsm:CrossIndustryDocument/rsm:HeaderExchangedDocument/ram:Namejava.util.DategetDueDate()when the invoice is to be paidIZUGFeRDPaymentTerms[]getExtendedPaymentTerms()Get payment terms for the EXTENDED profile (multiple terms are allowed)java.lang.StringgetInvoiceReferencedDocumentID()get the ID of the preceding invoice, which is e.g. to be corrected if this is a correctionjava.util.ArrayList<ReferencedDocument>getInvoiceReferencedDocuments()Getter for BG-3java.util.DategetInvoiceReferencedIssueDate()java.util.DategetIssueDate()the date when the invoice was createdjava.lang.String[]getNotes()additional text descriptionjava.util.List<IncludedNote>getNotesWithSubjectCode()A grouping of business terms to indicate accounting-relevant free texts including a qualification of these.java.lang.StringgetNumber()Number, typically invoice number of the invoicejava.lang.StringgetOwnCountry()own two digit country codejava.lang.StringgetOwnForeignOrganisationID()supplier identification assigned by the costumerjava.lang.StringgetOwnLocation()own cityjava.lang.StringgetOwnOrganisationFullPlaintextInfo()this should be the full sender institution name, details, manager and tax registration.java.lang.StringgetOwnOrganisationName()own namejava.lang.StringgetOwnStreet()own street addressjava.lang.StringgetOwnTaxID()Tax ID (not VAT ID) of the senderjava.lang.StringgetOwnVATID()VAT ID (Umsatzsteueridentifikationsnummer) of the senderjava.lang.StringgetOwnZIP()own street postal codeTradePartygetPayee()payee / payment receiver, if different from seller, ram:Payee (only supported for zf2)java.lang.StringgetPaymentReference()java.lang.StringgetPaymentTermDescription()get payment term descriptional text e.g.IZUGFeRDPaymentTermsgetPaymentTerms()get payment terms. if set, getPaymentTermDescription() and getDueDate() are ignoredTradePartygetRecipient()the recipientjava.lang.StringgetReferenceNumber()get BuyerReference (BT-10) an identifier assigned by the buyer and used for internal routing.java.math.BigDecimalgetRoundingAmount()for currency rounding differences to 5ct e.g. in Netherlands ("Rappenrundung")java.lang.StringgetSellerOrderReferencedDocumentID()get the ID of the SellerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreement/ApplicableHeaderTradeAgreementTradePartygetSender()the sender of the invoicejava.lang.StringgetShipToCountry()consignee two digit country code (country code of the organisation the goods are shipped to)java.lang.StringgetShipToLocation()consignee city (city of the organisation the goods are shipped to)java.lang.StringgetShipToOrganisationID()consignee identification (identification of the organisation the goods are shipped to [assigned by the costumer])java.lang.StringgetShipToOrganisationName()consignee name (name of the organisation the goods are shipped to)java.lang.StringgetShipToStreet()consignee street address (street of the organisation the goods are shipped to)java.lang.StringgetShipToZIP()consignee street postal code (postal code of the organisation the goods are shipped to)java.lang.StringgetSpecifiedProcuringProjectID()java.lang.StringgetSpecifiedProcuringProjectName()IReferencedDocumentgetTenderReferencedDocument()BT-17 tender or lot referencejava.math.BigDecimalgetTotalPrepaidAmount()get the TotalPrepaidAmount located in SpecifiedTradeSettlementMonetarySummation (v1) or SpecifiedTradeSettlementHeaderMonetarySummation (v2)IZUGFeRDTradeSettlement[]getTradeSettlement()the payment information for any payment meansjava.lang.StringgetVATDueDateTypeCode()IZUGFeRDAllowanceCharge[]getZFAllowances()IZUGFeRDAllowanceCharge[]getZFCharges()IZUGFeRDExportableItem[]getZFItems()IZUGFeRDAllowanceCharge[]getZFLogisticsServiceCharges()booleanisValid()checks if all required items are set in order to be able to export itInvoicesetAdditionalReferencedDocuments(FileAttachment[] fileArr)setter in case e.g. jackson tries to map attachments (normal use embedFileInXML)InvoicesetBuyerOrderReferencedDocumentID(java.lang.String buyerOrderReferencedDocumentID)usually the order numberInvoicesetBuyerOrderReferencedDocumentIssueDateTime(java.lang.String buyerOrderReferencedDocumentIssueDateTime)when the order (or whatever reference in BuyerOrderReferencedDocumentID) was issued (@todo switch to date?)InvoicesetContractReferencedDocument(java.lang.String s)adds the ID of a contract referenced in the invoiceInvoicesetCorrection(java.lang.String number)switch type to invoice correction and refer to document number.InvoicesetCreditNote()InvoicesetCreditorReferenceID(java.lang.String creditorReferenceID)InvoicesetCurrency(java.lang.String currency)InvoicesetDeliveryAddress(TradeParty deliveryAddress)if the delivery address is not the recipient address, it can be specified hereInvoicesetDeliveryDate(java.util.Date deliveryDate)InvoicesetDespatchAdviceReferencedDocumentID(java.lang.String despatchAdviceReferencedDocumentID)InvoicesetDetailedDeliveryPeriod(java.util.Date start, java.util.Date end)sets a document level delivery period, which is optional additional to the mandatory deliverydate and which will become a BillingSpecifiedPeriod-ElementInvoicesetDetailedDeliveryPeriodFrom(java.util.Date dt)InvoicesetDetailedDeliveryPeriodTo(java.util.Date dt)InvoicesetDocumentCode(java.lang.String documentCode)InvoicesetDocumentName(java.lang.String documentName)InvoicesetDueDate(java.util.Date dueDate)InvoicesetExtendedPaymentTerms(IZUGFeRDPaymentTerms[] paymentTerms)InvoicesetInvoiceReferencedDocumentID(java.lang.String invoiceReferencedDocumentID)usually in case of a correction the original invoice numbervoidsetInvoiceReferencedDocuments(java.util.ArrayList<ReferencedDocument> invoiceReferencedDocuments)InvoicesetInvoiceReferencedIssueDate(java.util.Date issueDate)InvoicesetIssueDate(java.util.Date issueDate)InvoicesetNotesWithSubjectCode(java.util.List<IncludedNote> theList)InvoicesetNumber(java.lang.String number)InvoicesetOwnContact(Contact ownContact)Deprecated.use setSenderInvoicesetOwnForeignOrganisationID(java.lang.String ownForeignOrganisationID)Deprecated.InvoicesetOwnOrganisationFullPlaintextInfo(java.lang.String ownOrganisationFullPlaintextInfo)InvoicesetOwnOrganisationName(java.lang.String ownOrganisationName)Deprecated.InvoicesetOwnTaxID(java.lang.String ownTaxID)Deprecated.InvoicesetOwnVATID(java.lang.String ownVATID)Deprecated.InvoicesetPayee(TradeParty payee)if the payee is not the seller, it can be specified hereInvoicesetPaymentReference(java.lang.String paymentReference)InvoicesetPaymentTermDescription(java.lang.String paymentTermDescription)InvoicesetPaymentTerms(IZUGFeRDPaymentTerms paymentTerm)InvoicesetRecipient(TradeParty recipient)required.InvoicesetReferenceNumber(java.lang.String referenceNumber)InvoicesetRoundingAmount(java.math.BigDecimal amount)set the cent e.g. to reach the next 5ct mark for currencies in certain countries e.g. in the Netherlands ("Rappenrundung")InvoicesetSellerOrderReferencedDocumentID(java.lang.String sellerOrderReferencedDocumentID)InvoicesetSender(TradeParty sender)required.InvoicesetShipToCountry(java.lang.String shipToCountry)InvoicesetShipToLocation(java.lang.String shipToLocation)InvoicesetShipToOrganisationID(java.lang.String shipToOrganisationID)InvoicesetShipToOrganisationName(java.lang.String shipToOrganisationName)InvoicesetShipToStreet(java.lang.String shipToStreet)InvoicesetShipToZIP(java.lang.String shipToZIP)InvoicesetSpecifiedProcuringProjectID(java.lang.String specifiedProcuringProjectID)InvoicesetSpecifiedProcuringProjectName(java.lang.String specifiedProcuringProjectName)InvoicesetTenderReferencedDocument(java.lang.String ID)InvoicesetTenderReferencedDocument(ReferencedDocument dr)BT-17InvoicesetTotalPrepaidAmount(java.math.BigDecimal prepaid)allow to set a amount which has already been paidInvoicesetVATDueDateTypeCode(java.lang.String vatDueDateTypeCode)Decide when the VAT should be collected.InvoicesetZFAllowances(Allowance[] iza)this is wrong and only used from jacksonInvoicesetZFCharges(Charge[] iza)this is wrong and only used from jacksonvoidsetZFItems(java.util.ArrayList<IZUGFeRDExportableItem> ims)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mustangproject.ZUGFeRD.IExportableTransaction
getSubjectNote, getTradeSettlementPayment, rebateAgreementExists
-
-
-
-
Field Detail
-
documentName
protected java.lang.String documentName
-
documentCode
protected java.lang.String documentCode
-
number
protected java.lang.String number
-
ownOrganisationFullPlaintextInfo
protected java.lang.String ownOrganisationFullPlaintextInfo
-
referenceNumber
protected java.lang.String referenceNumber
-
shipToOrganisationID
protected java.lang.String shipToOrganisationID
-
shipToOrganisationName
protected java.lang.String shipToOrganisationName
-
shipToStreet
protected java.lang.String shipToStreet
-
shipToZIP
protected java.lang.String shipToZIP
-
shipToLocation
protected java.lang.String shipToLocation
-
shipToCountry
protected java.lang.String shipToCountry
-
buyerOrderReferencedDocumentID
protected java.lang.String buyerOrderReferencedDocumentID
-
buyerOrderReferencedDocumentIssueDateTime
protected java.lang.String buyerOrderReferencedDocumentIssueDateTime
-
ownForeignOrganisationID
protected java.lang.String ownForeignOrganisationID
-
ownOrganisationName
protected java.lang.String ownOrganisationName
-
currency
protected java.lang.String currency
-
paymentTermDescription
protected java.lang.String paymentTermDescription
-
issueDate
protected java.util.Date issueDate
-
dueDate
protected java.util.Date dueDate
-
deliveryDate
protected java.util.Date deliveryDate
-
sender
protected TradeParty sender
-
recipient
protected TradeParty recipient
-
deliveryAddress
protected TradeParty deliveryAddress
-
payee
protected TradeParty payee
-
cashDiscounts
protected java.util.ArrayList<CashDiscount> cashDiscounts
-
ZFItems
protected java.util.ArrayList<IZUGFeRDExportableItem> ZFItems
-
notes
protected java.util.ArrayList<java.lang.String> notes
-
sellerOrderReferencedDocumentID
protected java.lang.String sellerOrderReferencedDocumentID
-
contractReferencedDocument
protected java.lang.String contractReferencedDocument
-
xmlEmbeddedFiles
protected java.util.ArrayList<FileAttachment> xmlEmbeddedFiles
-
totalPrepaidAmount
protected java.math.BigDecimal totalPrepaidAmount
-
detailedDeliveryDateStart
protected java.util.Date detailedDeliveryDateStart
-
detailedDeliveryPeriodEnd
protected java.util.Date detailedDeliveryPeriodEnd
-
tenderReference
protected IReferencedDocument tenderReference
-
Allowances
protected java.util.ArrayList<IZUGFeRDAllowanceCharge> Allowances
-
Charges
protected java.util.ArrayList<IZUGFeRDAllowanceCharge> Charges
-
LogisticsServiceCharges
protected java.util.ArrayList<IZUGFeRDAllowanceCharge> LogisticsServiceCharges
-
paymentTerms
protected java.util.ArrayList<IZUGFeRDPaymentTerms> paymentTerms
-
invoiceReferencedDocumentID
protected java.lang.String invoiceReferencedDocumentID
-
invoiceReferencedIssueDate
protected java.util.Date invoiceReferencedIssueDate
-
invoiceReferencedDocuments
protected java.util.ArrayList<ReferencedDocument> invoiceReferencedDocuments
-
specifiedProcuringProjectID
protected java.lang.String specifiedProcuringProjectID
-
specifiedProcuringProjectName
protected java.lang.String specifiedProcuringProjectName
-
despatchAdviceReferencedDocumentID
protected java.lang.String despatchAdviceReferencedDocumentID
-
vatDueDateTypeCode
protected java.lang.String vatDueDateTypeCode
-
creditorReferenceID
protected java.lang.String creditorReferenceID
-
-
Method Detail
-
getDocumentName
public java.lang.String getDocumentName()
Description copied from interface:IExportableTransactionappears in /rsm:CrossIndustryDocument/rsm:HeaderExchangedDocument/ram:Name- Specified by:
getDocumentNamein interfaceIExportableTransaction- Returns:
- Name of document
-
getContractReferencedDocument
public java.lang.String getContractReferencedDocument()
- Specified by:
getContractReferencedDocumentin interfaceIExportableTransaction
-
setDocumentName
public Invoice setDocumentName(java.lang.String documentName)
-
getDocumentCode
public java.lang.String getDocumentCode()
- Specified by:
getDocumentCodein interfaceIExportableTransaction- Returns:
- Code number of Document type, e.g. "380" for invoiceF
-
setDocumentCode
public Invoice setDocumentCode(java.lang.String documentCode)
-
embedFileInXML
public Invoice embedFileInXML(FileAttachment fa)
-
getAdditionalReferencedDocuments
public FileAttachment[] getAdditionalReferencedDocuments()
Description copied from interface:IExportableTransactionget additional referenced documents acccording to BG-24 XRechnung (Rechnungsbegruendende Unterlagen), i.e. ram:ApplicableHeaderTradeAgreement/ram:AdditionalReferencedDocument- Specified by:
getAdditionalReferencedDocumentsin interfaceIExportableTransaction- Returns:
- a array of objects from class FileAttachment
-
setAdditionalReferencedDocuments
public Invoice setAdditionalReferencedDocuments(FileAttachment[] fileArr)
setter in case e.g. jackson tries to map attachments (normal use embedFileInXML)- Parameters:
fileArr- Array of FileAttachments- Returns:
- fluent setter
-
getCashDiscounts
public CashDiscount[] getCashDiscounts()
- Specified by:
getCashDiscountsin interfaceIExportableTransaction
-
getNumber
public java.lang.String getNumber()
Description copied from interface:IExportableTransactionNumber, typically invoice number of the invoice- Specified by:
getNumberin interfaceIExportableTransaction- Returns:
- invoice number
-
getTenderReferencedDocument
public IReferencedDocument getTenderReferencedDocument()
Description copied from interface:IExportableTransactionBT-17 tender or lot reference- Specified by:
getTenderReferencedDocumentin interfaceIExportableTransaction- Returns:
- mandatory ID, optional Date
-
setTenderReferencedDocument
public Invoice setTenderReferencedDocument(ReferencedDocument dr)
BT-17- Parameters:
dr-- Returns:
-
setTenderReferencedDocument
public Invoice setTenderReferencedDocument(java.lang.String ID)
-
setNumber
public Invoice setNumber(java.lang.String number)
-
setCorrection
public Invoice setCorrection(java.lang.String number)
switch type to invoice correction and refer to document number. Please note that the quantities need to be negative, if you e.g. delivered 100 and take 50 back the quantity should be -50 in the corrected invoice, which will result in negative VAT and a negative payment amount- Parameters:
number- the invoice number to be corrected- Returns:
- this object (fluent setter)
-
setCreditNote
public Invoice setCreditNote()
-
getOwnOrganisationFullPlaintextInfo
public java.lang.String getOwnOrganisationFullPlaintextInfo()
Description copied from interface:IExportableTransactionthis should be the full sender institution name, details, manager and tax registration. It is one of the few functions which may return null. e.g. Lieferant GmbH Lieferantenstraße 20 80333 München Deutschland Geschäftsführer: Hans Muster Handelsregisternummer: H A 123 It is written as an includedNode with subjectCodeSubjectCode.REG. See alsoIExportableTransaction.getNotesWithSubjectCode()- Specified by:
getOwnOrganisationFullPlaintextInfoin interfaceIExportableTransaction- Returns:
- null or full sender institution name, details, manager and tax registration
-
setOwnOrganisationFullPlaintextInfo
public Invoice setOwnOrganisationFullPlaintextInfo(java.lang.String ownOrganisationFullPlaintextInfo)
-
getReferenceNumber
public java.lang.String getReferenceNumber()
Description copied from interface:IExportableTransactionget BuyerReference (BT-10) an identifier assigned by the buyer and used for internal routing. Used for the Leitweg-ID.- Specified by:
getReferenceNumberin interfaceIExportableTransaction- Returns:
- the BuyerReference of this document
-
setReferenceNumber
public Invoice setReferenceNumber(java.lang.String referenceNumber)
-
getShipToOrganisationID
public java.lang.String getShipToOrganisationID()
Description copied from interface:IExportableTransactionconsignee identification (identification of the organisation the goods are shipped to [assigned by the costumer])- Specified by:
getShipToOrganisationIDin interfaceIExportableTransaction- Returns:
- the sender's identification
-
setShipToOrganisationID
public Invoice setShipToOrganisationID(java.lang.String shipToOrganisationID)
-
getShipToOrganisationName
public java.lang.String getShipToOrganisationName()
Description copied from interface:IExportableTransactionconsignee name (name of the organisation the goods are shipped to)- Specified by:
getShipToOrganisationNamein interfaceIExportableTransaction- Returns:
- the consignee's organisation name
-
setShipToOrganisationName
public Invoice setShipToOrganisationName(java.lang.String shipToOrganisationName)
-
getShipToStreet
public java.lang.String getShipToStreet()
Description copied from interface:IExportableTransactionconsignee street address (street of the organisation the goods are shipped to)- Specified by:
getShipToStreetin interfaceIExportableTransaction- Returns:
- consignee street address
-
setShipToStreet
public Invoice setShipToStreet(java.lang.String shipToStreet)
-
getShipToZIP
public java.lang.String getShipToZIP()
Description copied from interface:IExportableTransactionconsignee street postal code (postal code of the organisation the goods are shipped to)- Specified by:
getShipToZIPin interfaceIExportableTransaction- Returns:
- consignee postal code
-
setShipToZIP
public Invoice setShipToZIP(java.lang.String shipToZIP)
-
getShipToLocation
public java.lang.String getShipToLocation()
Description copied from interface:IExportableTransactionconsignee city (city of the organisation the goods are shipped to)- Specified by:
getShipToLocationin interfaceIExportableTransaction- Returns:
- the consignee's city
-
setShipToLocation
public Invoice setShipToLocation(java.lang.String shipToLocation)
-
getShipToCountry
public java.lang.String getShipToCountry()
Description copied from interface:IExportableTransactionconsignee two digit country code (country code of the organisation the goods are shipped to)- Specified by:
getShipToCountryin interfaceIExportableTransaction- Returns:
- the consignee's two character country iso code
-
setShipToCountry
public Invoice setShipToCountry(java.lang.String shipToCountry)
-
getBuyerOrderReferencedDocumentID
public java.lang.String getBuyerOrderReferencedDocumentID()
Description copied from interface:IExportableTransactionget the ID of the BuyerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreement- Specified by:
getBuyerOrderReferencedDocumentIDin interfaceIExportableTransaction- Returns:
- the ID of the document
-
getSellerOrderReferencedDocumentID
public java.lang.String getSellerOrderReferencedDocumentID()
Description copied from interface:IExportableTransactionget the ID of the SellerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreement/ApplicableHeaderTradeAgreement- Specified by:
getSellerOrderReferencedDocumentIDin interfaceIExportableTransaction- Returns:
- the ID of the document
-
setSellerOrderReferencedDocumentID
public Invoice setSellerOrderReferencedDocumentID(java.lang.String sellerOrderReferencedDocumentID)
-
setBuyerOrderReferencedDocumentID
public Invoice setBuyerOrderReferencedDocumentID(java.lang.String buyerOrderReferencedDocumentID)
usually the order number- Parameters:
buyerOrderReferencedDocumentID- string with number- Returns:
- fluent setter
-
setInvoiceReferencedDocumentID
public Invoice setInvoiceReferencedDocumentID(java.lang.String invoiceReferencedDocumentID)
usually in case of a correction the original invoice number- Parameters:
invoiceReferencedDocumentID- string with number- Returns:
- fluent setter
-
getInvoiceReferencedDocumentID
public java.lang.String getInvoiceReferencedDocumentID()
Description copied from interface:IExportableTransactionget the ID of the preceding invoice, which is e.g. to be corrected if this is a correction- Specified by:
getInvoiceReferencedDocumentIDin interfaceIExportableTransaction- Returns:
- the ID of the document
-
getInvoiceReferencedIssueDate
public java.util.Date getInvoiceReferencedIssueDate()
- Specified by:
getInvoiceReferencedIssueDatein interfaceIExportableTransaction
-
setInvoiceReferencedIssueDate
public Invoice setInvoiceReferencedIssueDate(java.util.Date issueDate)
-
getBuyerOrderReferencedDocumentIssueDateTime
public java.lang.String getBuyerOrderReferencedDocumentIssueDateTime()
Description copied from interface:IExportableTransactionget the issue timestamp of the BuyerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreement- Specified by:
getBuyerOrderReferencedDocumentIssueDateTimein interfaceIExportableTransaction- Returns:
- the IssueDateTime in format CCYY-MM-DDTHH:MM:SS
-
setTotalPrepaidAmount
public Invoice setTotalPrepaidAmount(java.math.BigDecimal prepaid)
allow to set a amount which has already been paid- Parameters:
prepaid- null is possible to omit- Returns:
- fluent setter
-
getTotalPrepaidAmount
public java.math.BigDecimal getTotalPrepaidAmount()
Description copied from interface:IExportableTransactionget the TotalPrepaidAmount located in SpecifiedTradeSettlementMonetarySummation (v1) or SpecifiedTradeSettlementHeaderMonetarySummation (v2)- Specified by:
getTotalPrepaidAmountin interfaceIExportableTransaction- Returns:
- the total sum (incl. VAT) of prepayments, i.e. the difference between GrandTotalAmount and DuePayableAmount
-
setBuyerOrderReferencedDocumentIssueDateTime
public Invoice setBuyerOrderReferencedDocumentIssueDateTime(java.lang.String buyerOrderReferencedDocumentIssueDateTime)
when the order (or whatever reference in BuyerOrderReferencedDocumentID) was issued (@todo switch to date?)- Parameters:
buyerOrderReferencedDocumentIssueDateTime- IssueDateTime in format CCYY-MM-DDTHH:MM:SS- Returns:
- fluent setter
-
getOwnTaxID
public java.lang.String getOwnTaxID()
Description copied from interface:IExportableTransactionTax ID (not VAT ID) of the sender- Specified by:
getOwnTaxIDin interfaceIExportableTransaction- Returns:
- Tax ID (not VAT ID) of the sender
-
setOwnTaxID
@Deprecated public Invoice setOwnTaxID(java.lang.String ownTaxID)
Deprecated.
-
getOwnVATID
public java.lang.String getOwnVATID()
Description copied from interface:IExportableTransactionVAT ID (Umsatzsteueridentifikationsnummer) of the sender- Specified by:
getOwnVATIDin interfaceIExportableTransaction- Returns:
- VAT ID (Umsatzsteueridentifikationsnummer) of the sender
-
setOwnVATID
@Deprecated public Invoice setOwnVATID(java.lang.String ownVATID)
Deprecated.
-
getOwnForeignOrganisationID
public java.lang.String getOwnForeignOrganisationID()
Description copied from interface:IExportableTransactionsupplier identification assigned by the costumer- Specified by:
getOwnForeignOrganisationIDin interfaceIExportableTransaction- Returns:
- the sender's identification
-
setOwnForeignOrganisationID
@Deprecated public Invoice setOwnForeignOrganisationID(java.lang.String ownForeignOrganisationID)
Deprecated.
-
getOwnOrganisationName
public java.lang.String getOwnOrganisationName()
Description copied from interface:IExportableTransactionown name- Specified by:
getOwnOrganisationNamein interfaceIExportableTransaction- Returns:
- the sender's organisation name
-
setOwnOrganisationName
@Deprecated public Invoice setOwnOrganisationName(java.lang.String ownOrganisationName)
Deprecated.
-
getOwnStreet
public java.lang.String getOwnStreet()
Description copied from interface:IExportableTransactionown street address- Specified by:
getOwnStreetin interfaceIExportableTransaction- Returns:
- sender street address
-
getOwnZIP
public java.lang.String getOwnZIP()
Description copied from interface:IExportableTransactionown street postal code- Specified by:
getOwnZIPin interfaceIExportableTransaction- Returns:
- sender postal code
-
getOwnLocation
public java.lang.String getOwnLocation()
Description copied from interface:IExportableTransactionown city- Specified by:
getOwnLocationin interfaceIExportableTransaction- Returns:
- the invoice sender's city
-
getOwnCountry
public java.lang.String getOwnCountry()
Description copied from interface:IExportableTransactionown two digit country code- Specified by:
getOwnCountryin interfaceIExportableTransaction- Returns:
- the invoice senders two character country iso code
-
getNotes
public java.lang.String[] getNotes()
Description copied from interface:IExportableTransactionadditional text description- Specified by:
getNotesin interfaceIExportableTransaction- Returns:
- an array of strings of document wide "includedNotes" (descriptive text values)
-
getNotesWithSubjectCode
public java.util.List<IncludedNote> getNotesWithSubjectCode()
Description copied from interface:IExportableTransactionA grouping of business terms to indicate accounting-relevant free texts including a qualification of these. The information are written to the same xml nodes likeIExportableTransaction.getNotes()but with explicit subjectCode.- Specified by:
getNotesWithSubjectCodein interfaceIExportableTransaction- Returns:
- list of the notes
-
setNotesWithSubjectCode
public Invoice setNotesWithSubjectCode(java.util.List<IncludedNote> theList)
-
getCurrency
public java.lang.String getCurrency()
Description copied from interface:IExportableTransactionget main invoice currency used on the invoice- Specified by:
getCurrencyin interfaceIExportableTransaction- Returns:
- three character currency of this invoice
-
setCurrency
public Invoice setCurrency(java.lang.String currency)
-
getPaymentTermDescription
public java.lang.String getPaymentTermDescription()
Description copied from interface:IExportableTransactionget payment term descriptional text e.g. Bis zum 22.10.2015 ohne Abzug- Specified by:
getPaymentTermDescriptionin interfaceIExportableTransaction- Returns:
- get payment terms
-
setPaymentTermDescription
public Invoice setPaymentTermDescription(java.lang.String paymentTermDescription)
-
getIssueDate
public java.util.Date getIssueDate()
Description copied from interface:IExportableTransactionthe date when the invoice was created- Specified by:
getIssueDatein interfaceIExportableTransaction- Returns:
- when the invoice was created
-
setIssueDate
public Invoice setIssueDate(java.util.Date issueDate)
-
getDueDate
public java.util.Date getDueDate()
Description copied from interface:IExportableTransactionwhen the invoice is to be paid- Specified by:
getDueDatein interfaceIExportableTransaction- Returns:
- when the invoice is to be paid
-
setDueDate
public Invoice setDueDate(java.util.Date dueDate)
-
getDeliveryDate
public java.util.Date getDeliveryDate()
Description copied from interface:IExportableTransactionget delivery date- Specified by:
getDeliveryDatein interfaceIExportableTransaction- Returns:
- the day the goods have been delivered
-
setDeliveryDate
public Invoice setDeliveryDate(java.util.Date deliveryDate)
-
getSender
public TradeParty getSender()
Description copied from interface:IExportableTransactionthe sender of the invoice- Specified by:
getSenderin interfaceIExportableTransaction- Returns:
- the contact person at the supplier side
-
getRoundingAmount
public java.math.BigDecimal getRoundingAmount()
for currency rounding differences to 5ct e.g. in Netherlands ("Rappenrundung")- Specified by:
getRoundingAmountin interfaceIExportableTransaction- Returns:
- null if not set, otherwise BigDecimal of Euros
-
setRoundingAmount
public Invoice setRoundingAmount(java.math.BigDecimal amount)
set the cent e.g. to reach the next 5ct mark for currencies in certain countries e.g. in the Netherlands ("Rappenrundung")- Parameters:
amount-- Returns:
- fluent setter
-
setOwnContact
@Deprecated public Invoice setOwnContact(Contact ownContact)
Deprecated.use setSendersets a named sender contact- Parameters:
ownContact- the sender contact- Returns:
- fluent setter
- See Also:
Contact
-
getRecipient
public TradeParty getRecipient()
Description copied from interface:IExportableTransactionthe recipient- Specified by:
getRecipientin interfaceIExportableTransaction- Returns:
- the recipient of the invoice
-
setRecipient
public Invoice setRecipient(TradeParty recipient)
required. sets the invoice receiving institution = invoicee- Parameters:
recipient- the invoicee organisation- Returns:
- fluent setter
-
setSender
public Invoice setSender(TradeParty sender)
required. sets the invoicing institution = invoicer- Parameters:
sender- the invoicer- Returns:
- fluent setter
-
getInvoiceReferencedDocuments
public java.util.ArrayList<ReferencedDocument> getInvoiceReferencedDocuments()
Description copied from interface:IExportableTransactionGetter for BG-3- Specified by:
getInvoiceReferencedDocumentsin interfaceIExportableTransaction- Returns:
- list of documents
-
setInvoiceReferencedDocuments
public void setInvoiceReferencedDocuments(java.util.ArrayList<ReferencedDocument> invoiceReferencedDocuments)
-
addInvoiceReferencedDocument
public Invoice addInvoiceReferencedDocument(ReferencedDocument doc)
-
getZFAllowances
public IZUGFeRDAllowanceCharge[] getZFAllowances()
- Specified by:
getZFAllowancesin interfaceIExportableTransaction
-
setZFAllowances
public Invoice setZFAllowances(Allowance[] iza)
this is wrong and only used from jackson- Parameters:
iza- the Array of allowances/charges- Returns:
- fluent setter
-
getZFCharges
public IZUGFeRDAllowanceCharge[] getZFCharges()
- Specified by:
getZFChargesin interfaceIExportableTransaction
-
setZFCharges
public Invoice setZFCharges(Charge[] iza)
this is wrong and only used from jackson- Parameters:
iza- the array of charges- Returns:
- fluent setter
-
getZFLogisticsServiceCharges
public IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges()
- Specified by:
getZFLogisticsServiceChargesin interfaceIExportableTransaction
-
getTradeSettlement
public IZUGFeRDTradeSettlement[] getTradeSettlement()
Description copied from interface:IExportableTransactionthe payment information for any payment means- Specified by:
getTradeSettlementin interfaceIExportableTransaction- Returns:
- an array of IZUGFeRDTradeSettlement
-
getPaymentTerms
public IZUGFeRDPaymentTerms getPaymentTerms()
Description copied from interface:IExportableTransactionget payment terms. if set, getPaymentTermDescription() and getDueDate() are ignored- Specified by:
getPaymentTermsin interfaceIExportableTransaction- Returns:
- the IZUGFeRDPaymentTerms of the invoice
-
setPaymentTerms
public Invoice setPaymentTerms(IZUGFeRDPaymentTerms paymentTerm)
-
getExtendedPaymentTerms
public IZUGFeRDPaymentTerms[] getExtendedPaymentTerms()
Description copied from interface:IExportableTransactionGet payment terms for the EXTENDED profile (multiple terms are allowed)- Specified by:
getExtendedPaymentTermsin interfaceIExportableTransaction- Returns:
-
setExtendedPaymentTerms
public Invoice setExtendedPaymentTerms(IZUGFeRDPaymentTerms[] paymentTerms)
-
addPaymentTerms
public Invoice addPaymentTerms(IZUGFeRDPaymentTerms paymentTerm)
Set multiple payment terms when using the EXTENDED profile.- Returns:
-
getPaymentReference
public java.lang.String getPaymentReference()
- Specified by:
getPaymentReferencein interfaceIExportableTransaction
-
setPaymentReference
public Invoice setPaymentReference(java.lang.String paymentReference)
-
getDeliveryAddress
public TradeParty getDeliveryAddress()
Description copied from interface:IExportableTransactiondelivery address, i.e. ram:ShipToTradeParty (only supported for zf2)- Specified by:
getDeliveryAddressin interfaceIExportableTransaction- Returns:
- the IZUGFeRDExportableTradeParty delivery address
-
setDeliveryAddress
public Invoice setDeliveryAddress(TradeParty deliveryAddress)
if the delivery address is not the recipient address, it can be specified here- Parameters:
deliveryAddress- the goods receiving organisation- Returns:
- fluent setter
-
getPayee
public TradeParty getPayee()
Description copied from interface:IExportableTransactionpayee / payment receiver, if different from seller, ram:Payee (only supported for zf2)- Specified by:
getPayeein interfaceIExportableTransaction- Returns:
- the IZUGFeRDExportableTradeParty payment receiver, if different from sellver
-
setPayee
public Invoice setPayee(TradeParty payee)
if the payee is not the seller, it can be specified here- Parameters:
payee- the payment receiving organisation- Returns:
- fluent setter
-
addCashDiscount
public Invoice addCashDiscount(CashDiscount c)
Adds a cash discount (skonto)- Parameters:
c- the CashDiscount percent/period combination- Returns:
- fluent setter
-
getZFItems
public IZUGFeRDExportableItem[] getZFItems()
- Specified by:
getZFItemsin interfaceIExportableTransaction- Returns:
- the invoice line items with the positions
-
setZFItems
public void setZFItems(java.util.ArrayList<IZUGFeRDExportableItem> ims)
-
addItem
public Invoice addItem(IZUGFeRDExportableItem item)
required adds invoice "lines" :-)- Parameters:
item- the invoice line- Returns:
- fluent setter
- See Also:
Item
-
isValid
public boolean isValid()
checks if all required items are set in order to be able to export it- Returns:
- true if all required items are set
-
addCharge
public Invoice addCharge(IZUGFeRDAllowanceCharge izac)
adds a document level addition to the price- Parameters:
izac- the charge to be applied- Returns:
- fluent setter
- See Also:
Charge
-
addAllowance
public Invoice addAllowance(IZUGFeRDAllowanceCharge izac)
adds a document level rebate- Parameters:
izac- the allowance to be applied- Returns:
- fluent setter
- See Also:
Allowance
-
setContractReferencedDocument
public Invoice setContractReferencedDocument(java.lang.String s)
adds the ID of a contract referenced in the invoice- Parameters:
s- the contract number- Returns:
- fluent setter
-
setDetailedDeliveryPeriod
public Invoice setDetailedDeliveryPeriod(java.util.Date start, java.util.Date end)
sets a document level delivery period, which is optional additional to the mandatory deliverydate and which will become a BillingSpecifiedPeriod-Element- Parameters:
start- the date of first deliveryend- the date of last delivery- Returns:
- fluent setter
-
getDetailedDeliveryPeriodFrom
public java.util.Date getDetailedDeliveryPeriodFrom()
Description copied from interface:IExportableTransactionspecifies the document level delivery period, will be included in a BillingSpecifiedPeriod element- Specified by:
getDetailedDeliveryPeriodFromin interfaceIExportableTransaction- Returns:
- the beginning of the delivery period
-
setDetailedDeliveryPeriodFrom
public Invoice setDetailedDeliveryPeriodFrom(java.util.Date dt)
-
getDetailedDeliveryPeriodTo
public java.util.Date getDetailedDeliveryPeriodTo()
Description copied from interface:IExportableTransactionspecifies the document level delivery period, will be included in a BillingSpecifiedPeriod element- Specified by:
getDetailedDeliveryPeriodToin interfaceIExportableTransaction- Returns:
- the end of the delivery period
-
setDetailedDeliveryPeriodTo
public Invoice setDetailedDeliveryPeriodTo(java.util.Date dt)
-
addNote
public Invoice addNote(java.lang.String text)
adds a free text paragraph, which will become an includedNote element- Parameters:
text- freeform UTF8 plain text- Returns:
- fluent setter
-
addNotes
public Invoice addNotes(java.util.Collection<IncludedNote> notes)
-
addGeneralNote
public Invoice addGeneralNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.AAI- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
addRegulatoryNote
public Invoice addRegulatoryNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.REG- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
addLegalNote
public Invoice addLegalNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.ABL- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
addCustomsNote
public Invoice addCustomsNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.CUS- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
addSellerNote
public Invoice addSellerNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.SUR- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
addTaxNote
public Invoice addTaxNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.TXD- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
addIntroductionNote
public Invoice addIntroductionNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.ACY- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
addDiscountBonusNote
public Invoice addDiscountBonusNote(java.lang.String content)
adds a free text paragraph, which will become an includedNote element with explicit subjectCodeSubjectCode.AAK- Parameters:
content- freeform UTF8 plain text- Returns:
- fluent setter
-
getSpecifiedProcuringProjectID
public java.lang.String getSpecifiedProcuringProjectID()
- Specified by:
getSpecifiedProcuringProjectIDin interfaceIExportableTransaction
-
setSpecifiedProcuringProjectID
public Invoice setSpecifiedProcuringProjectID(java.lang.String specifiedProcuringProjectID)
-
getDespatchAdviceReferencedDocumentID
public java.lang.String getDespatchAdviceReferencedDocumentID()
- Specified by:
getDespatchAdviceReferencedDocumentIDin interfaceIExportableTransaction
-
setDespatchAdviceReferencedDocumentID
public Invoice setDespatchAdviceReferencedDocumentID(java.lang.String despatchAdviceReferencedDocumentID)
-
getSpecifiedProcuringProjectName
public java.lang.String getSpecifiedProcuringProjectName()
- Specified by:
getSpecifiedProcuringProjectNamein interfaceIExportableTransaction
-
setSpecifiedProcuringProjectName
public Invoice setSpecifiedProcuringProjectName(java.lang.String specifiedProcuringProjectName)
-
getVATDueDateTypeCode
public java.lang.String getVATDueDateTypeCode()
- Specified by:
getVATDueDateTypeCodein interfaceIExportableTransaction
-
setVATDueDateTypeCode
public Invoice setVATDueDateTypeCode(java.lang.String vatDueDateTypeCode)
Decide when the VAT should be collected.- Parameters:
vatDueDateTypeCode- use EventTimeCodeTypeConstants- Returns:
- fluent setter
-
getCreditorReferenceID
public java.lang.String getCreditorReferenceID()
- Specified by:
getCreditorReferenceIDin interfaceIExportableTransaction
-
setCreditorReferenceID
public Invoice setCreditorReferenceID(java.lang.String creditorReferenceID)
-
-