Class AccountancyEntry
- java.lang.Object
-
- org.salespointframework.core.AbstractEntity<AccountancyEntryIdentifier>
-
- org.salespointframework.accountancy.AccountancyEntry
-
- All Implemented Interfaces:
org.springframework.data.domain.Persistable<AccountancyEntryIdentifier>
- Direct Known Subclasses:
ProductPaymentEntry
@Entity public class AccountancyEntry extends AbstractEntity<AccountancyEntryIdentifier>
This class represents an accountancy entry. It is advisable to sub-class it, to define specific entry types for an accountancy, for example aProductPaymentEntry
.- Author:
- Hannes Weisbach, Oliver Gierke
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AccountancyEntry()
AccountancyEntry(javax.money.MonetaryAmount value)
Creates a newPersistentAccountancyEntry
with a specific value.AccountancyEntry(javax.money.MonetaryAmount value, String description)
Creates a newPersistentAccountancyEntry
with a specific value and a user defined description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<LocalDateTime>
getDate()
String
getDescription()
AccountancyEntryIdentifier
getId()
javax.money.MonetaryAmount
getValue()
boolean
hasDate()
Returns whether theAccountancyEntry
already has aDate
set.boolean
isExpense()
Returns whether the entry is considered expense, i.e. its value is negative.boolean
isRevenue()
Returns whether the entry is considered revenue, i.e. its value is zero or positive.String
toString()
-
Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, isNew
-
-
-
-
Constructor Detail
-
AccountancyEntry
public AccountancyEntry(javax.money.MonetaryAmount value)
Creates a newPersistentAccountancyEntry
with a specific value.- Parameters:
value
- The value that is stored in this entry.
-
AccountancyEntry
public AccountancyEntry(javax.money.MonetaryAmount value, String description)
Creates a newPersistentAccountancyEntry
with 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
protected AccountancyEntry()
-
-
Method Detail
-
hasDate
public boolean hasDate()
Returns whether theAccountancyEntry
already has aDate
set.- Returns:
-
getDate
public Optional<LocalDateTime> getDate()
- Returns:
- the
DateTime
when this entry was posted.
-
getId
public AccountancyEntryIdentifier getId()
-
isRevenue
public boolean isRevenue()
Returns whether the entry is considered revenue, i.e. its value is zero or positive.- Returns:
- Since:
- 7.1
-
isExpense
public boolean isExpense()
Returns whether the entry is considered expense, i.e. its value is negative.- Returns:
- Since:
- 7.1
-
getValue
public javax.money.MonetaryAmount getValue()
-
getDescription
public String getDescription()
-
-