Class AccountancyEntry
java.lang.Object
org.salespointframework.core.AbstractEntity<AccountancyEntry.AccountancyEntryIdentifier>
org.salespointframework.accountancy.AccountancyEntry
- All Implemented Interfaces:
Persistable<AccountancyEntry.AccountancyEntryIdentifier>
- Direct Known Subclasses:
OrderPaymentEntry
@Entity
public class AccountancyEntry
extends AbstractEntity<AccountancyEntry.AccountancyEntryIdentifier>
This class represents an accountancy entry. It is advisable to sub-class it, to define specific entry types for an
accountancy, for example a
OrderPaymentEntry.- Author:
- Hannes Weisbach, Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAccountancyEntry.AccountancyEntryIdentifierserves as an identifier type and primary key forAccountancyEntryobjects. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeprecated.AccountancyEntry(javax.money.MonetaryAmount value) Creates a newAccountancyEntrywith a specific value.AccountancyEntry(javax.money.MonetaryAmount value, String description) Creates a newAccountancyEntrywith a specific value and a user defined description. -
Method Summary
Modifier and TypeMethodDescriptiongetDate()Returns the date this entry was posted.getId()Returns the unique identifier of thisAccountancyEntry.javax.money.MonetaryAmountgetValue()booleanhasDate()Returns whether this entry already has adateset.booleanReturns whether the entry is considered expense, i.e. its value is negative.booleanReturns whether the entry is considered revenue, i.e. its value is zero or positive.toString()Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, hasId, isNew
-
Constructor Details
-
AccountancyEntry
public AccountancyEntry(javax.money.MonetaryAmount value) Creates a newAccountancyEntrywith a specific value.- Parameters:
value- The value that is stored in this entry.
-
AccountancyEntry
Creates a newAccountancyEntrywith a specific value and a user defined description.- Parameters:
value- The value that is stored in this entry.description- A user-supplied description for this entry.
-
AccountancyEntry
Deprecated.
-
-
Method Details
-
hasDate
public boolean hasDate()Returns whether this entry already has adateset.- Returns:
- true if and only if this entry's date is not null.
-
getDate
Returns the date this entry was posted.- Returns:
- the date when this entry was posted, or an empty
Optionalif no date is set.
-
getId
Returns the unique identifier of thisAccountancyEntry.- Returns:
- will never be null
-
isRevenue
public boolean isRevenue()Returns whether the entry is considered revenue, i.e. its value is zero or positive.- Returns:
- whether the entry is considered revenue, i.e. its value is zero or positive.
- Since:
- 7.1
-
isExpense
public boolean isExpense()Returns whether the entry is considered expense, i.e. its value is negative.- Returns:
- whether the entry is considered expense, i.e. its value is negative.
- Since:
- 7.1
-
toString
-
getValue
public javax.money.MonetaryAmount getValue() -
getDescription
-