Record Class Subtotal
java.lang.Object
java.lang.Record
net.tangly.erp.invoices.domain.Subtotal
- All Implemented Interfaces:
net.tangly.core.HasText,InvoiceLine
public record Subtotal(int position, String text, @NotNull List<InvoiceLine> items)
extends Record
implements InvoiceLine
The subtotal defines the sum for a set of positions in the invoice. A subtotal groups a set of related positions, such as belonging to the same accounting
position or project booking, or to the same amount of VAT percentage for mixed VAT invoices.
-
Field Summary
Fields inherited from interface net.tangly.core.HasText
TEXT -
Constructor Summary
ConstructorsConstructorDescriptionSubtotal(int position, String text, @NotNull List<InvoiceLine> items) Creates an instance of aSubtotalrecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Return the amount associated with the line.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisItem()Return true if the line contains items.@NotNull List<InvoiceLine> items()Returns the value of theitemsrecord component.intposition()Returns the value of thepositionrecord component.Return the list of positions part of the subtotal aggregate.quantity()Return the quantity of items associated with an invoice line.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.Return the unit price of items associated with an invoice line.vat()Return the VAT amount associated with the line.vatRate()Return the VAT rate associated with the line.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.tangly.erp.invoices.domain.InvoiceLine
isAggregate
-
Constructor Details
-
Subtotal
Creates an instance of aSubtotalrecord class.- Parameters:
position- the value for thepositionrecord componenttext- the value for thetextrecord componentitems- the value for theitemsrecord component
-
-
Method Details
-
amount
Description copied from interface:InvoiceLineReturn the amount associated with the line.- Specified by:
amountin interfaceInvoiceLine- Returns:
- the amount of the line
-
vat
Description copied from interface:InvoiceLineReturn the VAT amount associated with the line.- Specified by:
vatin interfaceInvoiceLine- Returns:
- the VAT amount of the line
-
quantity
Description copied from interface:InvoiceLineReturn the quantity of items associated with an invoice line.- Specified by:
quantityin interfaceInvoiceLine- Returns:
- the quantity of items if defined otherwise zero
-
unitPrice
Description copied from interface:InvoiceLineReturn the unit price of items associated with an invoice line.- Specified by:
unitPricein interfaceInvoiceLine- Returns:
- the unit price of the items for the line
-
vatRate
Description copied from interface:InvoiceLineReturn the VAT rate associated with the line.- Specified by:
vatRatein interfaceInvoiceLine- Returns:
- the VAT rate of the line
-
isItem
public boolean isItem()Description copied from interface:InvoiceLineReturn true if the line contains items.- Specified by:
isItemin interfaceInvoiceLine- Returns:
- flag indicating the line contains items
-
positions
Return the list of positions part of the subtotal aggregate.- Returns:
- positions associated with the subtotal
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
position
public int position()Returns the value of thepositionrecord component.- Specified by:
positionin interfaceInvoiceLine- Returns:
- the value of the
positionrecord component
-
text
Returns the value of thetextrecord component.- Specified by:
textin interfacenet.tangly.core.HasText- Specified by:
textin interfaceInvoiceLine- Returns:
- the value of the
textrecord component
-
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-