Package org.mustangproject
Class Item
- java.lang.Object
-
- org.mustangproject.Item
-
- All Implemented Interfaces:
IAbsoluteValueProvider,IZUGFeRDExportableItem
public class Item extends java.lang.Object implements IZUGFeRDExportableItem
describes any invoice line
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringaccountingReferenceprotected java.util.ArrayList<ReferencedDocument>additionalReferenceprotected java.util.ArrayList<IZUGFeRDAllowanceCharge>Allowancesprotected java.math.BigDecimalbasisQuantityprotected java.lang.StringbuyerOrderReferencedDocumentIDprotected java.lang.StringbuyerOrderReferencedDocumentLineIDprotected java.util.ArrayList<IZUGFeRDAllowanceCharge>Chargesprotected java.util.DatedetailedDeliveryPeriodFromprotected java.util.DatedetailedDeliveryPeriodToprotected java.math.BigDecimalgrossPriceprotected java.lang.Stringidprotected java.util.List<IncludedNote>includedNotesprotected java.math.BigDecimallineTotalAmountprotected java.util.ArrayList<java.lang.String>notesprotected java.math.BigDecimalpriceprotected Productproductprotected java.math.BigDecimalquantityprotected java.util.ArrayList<ReferencedDocument>referencedDocumentsprotected java.math.BigDecimaltax
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ItemaddAdditionalReference(ReferencedDocument doc)adds item level references along with their typecodes and issuerassignedIDs (contract ID, cost centre, ...)ItemaddAllowance(IZUGFeRDAllowanceCharge izac)Adds a item level reduction the price (will be multiplied by quantity)ItemaddBuyerOrderReferencedDocumentID(java.lang.String s)ItemaddBuyerOrderReferencedDocumentLineID(java.lang.String s)ItemaddCharge(IZUGFeRDAllowanceCharge izac)Adds a item level addition to the price (will be multiplied by quantity)ItemaddNote(java.lang.String text)adds item level freetext fields (includednote)ItemaddNote(IncludedNote theNote)adds categorized item level freetext fields (includednote)IZUGFeRDExportableItemaddNotes(java.util.Collection<IncludedNote> notes)ItemaddReferencedDocument(ReferencedDocument doc)adds item level Referenced documents along with their typecodes and issuerassignedIDsItemaddReferencedLineID(java.lang.String s)Deprecated.java.lang.StringgetAccountingReference()IReferencedDocument[]getAdditionalReferences()allows to specify multiple references (billing information)IZUGFeRDAllowanceCharge[]getAllowances()java.math.BigDecimalgetBasisQuantity()how many items units per pricejava.lang.StringgetBuyerOrderReferencedDocumentID()buyer order reference document idjava.lang.StringgetBuyerOrderReferencedDocumentLineID()BT 132 (issue https://github.com/ZUGFeRD/mustangproject/issues/247)IZUGFeRDAllowanceCharge[]getCharges()item level price additionsjava.util.DategetDetailedDeliveryPeriodFrom()specifies the item level delivery period (there is also one on document level), this will be included in a BillingSpecifiedPeriod elementjava.util.DategetDetailedDeliveryPeriodTo()specifies the item level delivery period (there is also one on document level), this will be included in a BillingSpecifiedPeriod elementjava.math.BigDecimalgetGrossPrice()java.lang.StringgetId()IZUGFeRDAllowanceCharge[]getItemAllowances()item level discountsIZUGFeRDAllowanceCharge[]getItemCharges()item level price additionsjava.math.BigDecimalgetLineTotalAmount()java.lang.String[]getNotes()descriptive textsjava.util.List<IncludedNote>getNotesWithSubjectCode()A grouping of business terms to indicate accounting-relevant free texts including a qualification of these.java.math.BigDecimalgetPrice()The price of one item excl. taxesProductgetProduct()java.math.BigDecimalgetQuantity()how many get billedIReferencedDocument[]getReferencedDocuments()allows to specify multiple(!)java.math.BigDecimalgetTax()ItemsetBasisQuantity(java.math.BigDecimal basis)ItemsetDetailedDeliveryPeriod(java.util.Date from, java.util.Date to)specify a item level delivery period (apart from the document level delivery period, and the document level delivery day, which is probably anyway required)ItemsetGrossPrice(java.math.BigDecimal grossPrice)the list price without VAT (sic!)ItemsetId(java.lang.String id)voidsetItemAllowances(java.util.ArrayList<Allowance> theAllowances)jackson convenience methodvoidsetItemCharges(java.util.ArrayList<Charge> theCharges)jackson convenience methodItemsetLineTotalAmount(java.math.BigDecimal lineTotalAmount)should only be set by calculator classes or maybe when reading from XMLItemsetNotesWithSubjectCode(java.util.List<IncludedNote> theList)ItemsetPrice(java.math.BigDecimal price)ItemsetProduct(Product product)ItemsetQuantity(java.math.BigDecimal quantity)ItemsetTax(java.math.BigDecimal tax)-
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.IZUGFeRDExportableItem
getAdditionalReferencedDocumentID, getCalculation, getItemTotalAllowances, getValue
-
-
-
-
Field Detail
-
price
protected java.math.BigDecimal price
-
quantity
protected java.math.BigDecimal quantity
-
tax
protected java.math.BigDecimal tax
-
grossPrice
protected java.math.BigDecimal grossPrice
-
lineTotalAmount
protected java.math.BigDecimal lineTotalAmount
-
basisQuantity
protected java.math.BigDecimal basisQuantity
-
detailedDeliveryPeriodFrom
protected java.util.Date detailedDeliveryPeriodFrom
-
detailedDeliveryPeriodTo
protected java.util.Date detailedDeliveryPeriodTo
-
id
protected java.lang.String id
-
buyerOrderReferencedDocumentLineID
protected java.lang.String buyerOrderReferencedDocumentLineID
-
buyerOrderReferencedDocumentID
protected java.lang.String buyerOrderReferencedDocumentID
-
product
protected Product product
-
notes
protected java.util.ArrayList<java.lang.String> notes
-
referencedDocuments
protected java.util.ArrayList<ReferencedDocument> referencedDocuments
-
additionalReference
protected java.util.ArrayList<ReferencedDocument> additionalReference
-
Allowances
protected java.util.ArrayList<IZUGFeRDAllowanceCharge> Allowances
-
Charges
protected java.util.ArrayList<IZUGFeRDAllowanceCharge> Charges
-
includedNotes
protected java.util.List<IncludedNote> includedNotes
-
accountingReference
protected java.lang.String accountingReference
-
-
Constructor Detail
-
Item
public Item(Product product, java.math.BigDecimal price, java.math.BigDecimal quantity)
default constructor- Parameters:
product- contains the products name, tax rate, and unitprice- the base price of one item the productquantity- the number, dimensions or the weight of the delivered product or good in this context
-
Item
public Item()
empty constructor do not use, but might be used e.g. by jackson
-
Item
public Item(org.w3c.dom.NodeList itemChilds, boolean recalcPrice)
-
-
Method Detail
-
addBuyerOrderReferencedDocumentLineID
public Item addBuyerOrderReferencedDocumentLineID(java.lang.String s)
-
addReferencedLineID
@Deprecated(since="2.14.0") public Item addReferencedLineID(java.lang.String s)
Deprecated.
-
getBuyerOrderReferencedDocumentID
public java.lang.String getBuyerOrderReferencedDocumentID()
Description copied from interface:IZUGFeRDExportableItembuyer order reference document id- Specified by:
getBuyerOrderReferencedDocumentIDin interfaceIZUGFeRDExportableItem- Returns:
- the document id (defaults to
null)
-
addBuyerOrderReferencedDocumentID
public Item addBuyerOrderReferencedDocumentID(java.lang.String s)
-
getAllowances
public IZUGFeRDAllowanceCharge[] getAllowances()
- Specified by:
getAllowancesin interfaceIZUGFeRDExportableItem
-
getCharges
public IZUGFeRDAllowanceCharge[] getCharges()
Description copied from interface:IZUGFeRDExportableItemitem level price additions- Specified by:
getChargesin interfaceIZUGFeRDExportableItem- Returns:
- array of the additional charges on the item
-
getBuyerOrderReferencedDocumentLineID
public java.lang.String getBuyerOrderReferencedDocumentLineID()
BT 132 (issue https://github.com/ZUGFeRD/mustangproject/issues/247)- Specified by:
getBuyerOrderReferencedDocumentLineIDin interfaceIZUGFeRDExportableItem- Returns:
- the line ID of the order (BT132)
-
getLineTotalAmount
public java.math.BigDecimal getLineTotalAmount()
-
setNotesWithSubjectCode
public Item setNotesWithSubjectCode(java.util.List<IncludedNote> theList)
-
setLineTotalAmount
public Item setLineTotalAmount(java.math.BigDecimal lineTotalAmount)
should only be set by calculator classes or maybe when reading from XML- Parameters:
lineTotalAmount- price*quantity of this line- Returns:
- fluent setter
-
getGrossPrice
public java.math.BigDecimal getGrossPrice()
-
setGrossPrice
public Item setGrossPrice(java.math.BigDecimal grossPrice)
the list price without VAT (sic!), refer to EN16931-1 for definition- Parameters:
grossPrice- the list price without VAT- Returns:
- fluent setter
-
getTax
public java.math.BigDecimal getTax()
-
setTax
public Item setTax(java.math.BigDecimal tax)
-
setId
public Item setId(java.lang.String id)
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceIZUGFeRDExportableItem- Returns:
- the line ID
-
getPrice
public java.math.BigDecimal getPrice()
Description copied from interface:IZUGFeRDExportableItemThe price of one item excl. taxes- Specified by:
getPricein interfaceIZUGFeRDExportableItem- Returns:
- The price of one item excl. taxes
-
setPrice
public Item setPrice(java.math.BigDecimal price)
-
getBasisQuantity
public java.math.BigDecimal getBasisQuantity()
Description copied from interface:IZUGFeRDExportableItemhow many items units per price- Specified by:
getBasisQuantityin interfaceIZUGFeRDExportableItem- Returns:
- item units per price
-
setBasisQuantity
public Item setBasisQuantity(java.math.BigDecimal basis)
-
getQuantity
public java.math.BigDecimal getQuantity()
Description copied from interface:IZUGFeRDExportableItemhow many get billed- Specified by:
getQuantityin interfaceIAbsoluteValueProvider- Specified by:
getQuantityin interfaceIZUGFeRDExportableItem- Returns:
- the quantity of the item
-
setQuantity
public Item setQuantity(java.math.BigDecimal quantity)
-
getProduct
public Product getProduct()
- Specified by:
getProductin interfaceIZUGFeRDExportableItem
-
getItemAllowances
public IZUGFeRDAllowanceCharge[] getItemAllowances()
Description copied from interface:IZUGFeRDExportableItemitem level discounts- Specified by:
getItemAllowancesin interfaceIZUGFeRDExportableItem- Returns:
- array of the discounts on a single item
-
setItemAllowances
public void setItemAllowances(java.util.ArrayList<Allowance> theAllowances)
jackson convenience method
-
setItemCharges
public void setItemCharges(java.util.ArrayList<Charge> theCharges)
jackson convenience method
-
getItemCharges
public IZUGFeRDAllowanceCharge[] getItemCharges()
Description copied from interface:IZUGFeRDExportableItemitem level price additions- Specified by:
getItemChargesin interfaceIZUGFeRDExportableItem- Returns:
- array of the additional charges on the item
-
getNotes
public java.lang.String[] getNotes()
Description copied from interface:IZUGFeRDExportableItemdescriptive texts- Specified by:
getNotesin interfaceIZUGFeRDExportableItem- Returns:
- an array of strings of item specific "includedNotes", text values
-
addCharge
public Item addCharge(IZUGFeRDAllowanceCharge izac)
Adds a item level addition to the price (will be multiplied by quantity)- Parameters:
izac- a relative or absolute charge- Returns:
- fluent setter
- See Also:
Charge
-
addAllowance
public Item addAllowance(IZUGFeRDAllowanceCharge izac)
Adds a item level reduction the price (will be multiplied by quantity)- Parameters:
izac- a relative or absolute allowance- Returns:
- fluent setter
- See Also:
Allowance
-
addNote
public Item addNote(java.lang.String text)
adds item level freetext fields (includednote)- Parameters:
text- UTF8 plain text- Returns:
- fluent setter
-
addNote
public Item addNote(IncludedNote theNote)
adds categorized item level freetext fields (includednote)- Parameters:
theNote- IncludedNote to add- Returns:
- fluent setter
-
addReferencedDocument
public Item addReferencedDocument(ReferencedDocument doc)
adds item level Referenced documents along with their typecodes and issuerassignedIDs- Parameters:
doc- the ReferencedDocument to add- Returns:
- fluent setter
-
getReferencedDocuments
public IReferencedDocument[] getReferencedDocuments()
Description copied from interface:IZUGFeRDExportableItemallows to specify multiple(!) referenced documents along with e.g. their typecodes- Specified by:
getReferencedDocumentsin interfaceIZUGFeRDExportableItem- Returns:
- the referenced documents
-
addAdditionalReference
public Item addAdditionalReference(ReferencedDocument doc)
adds item level references along with their typecodes and issuerassignedIDs (contract ID, cost centre, ...)- Parameters:
doc- the ReferencedDocument to add- Returns:
- fluent setter
-
getAdditionalReferences
public IReferencedDocument[] getAdditionalReferences()
Description copied from interface:IZUGFeRDExportableItemallows to specify multiple references (billing information)- Specified by:
getAdditionalReferencesin interfaceIZUGFeRDExportableItem- Returns:
- the referenced documents
-
setDetailedDeliveryPeriod
public Item setDetailedDeliveryPeriod(java.util.Date from, java.util.Date to)
specify a item level delivery period (apart from the document level delivery period, and the document level delivery day, which is probably anyway required)- Parameters:
from- start dateto- end date- Returns:
- fluent setter
-
getDetailedDeliveryPeriodFrom
public java.util.Date getDetailedDeliveryPeriodFrom()
specifies the item level delivery period (there is also one on document level), this will be included in a BillingSpecifiedPeriod element- Specified by:
getDetailedDeliveryPeriodFromin interfaceIZUGFeRDExportableItem- Returns:
- the beginning of the delivery period
-
getDetailedDeliveryPeriodTo
public java.util.Date getDetailedDeliveryPeriodTo()
specifies the item level delivery period (there is also one on document level), this will be included in a BillingSpecifiedPeriod element- Specified by:
getDetailedDeliveryPeriodToin interfaceIZUGFeRDExportableItem- Returns:
- the end of the delivery period
-
addNotes
public IZUGFeRDExportableItem addNotes(java.util.Collection<IncludedNote> notes)
-
getNotesWithSubjectCode
public java.util.List<IncludedNote> getNotesWithSubjectCode()
Description copied from interface:IZUGFeRDExportableItemA grouping of business terms to indicate accounting-relevant free texts including a qualification of these. The information are written to the same xml nodes likeIZUGFeRDExportableItem.getNotes()but with explicit subjectCode.- Specified by:
getNotesWithSubjectCodein interfaceIZUGFeRDExportableItem- Returns:
- list of the notes
-
getAccountingReference
public java.lang.String getAccountingReference()
- Specified by:
getAccountingReferencein interfaceIZUGFeRDExportableItem
-
-