Class ProductPaymentEntry
java.lang.Object
org.salespointframework.core.AbstractEntity<AccountancyEntryIdentifier>
org.salespointframework.accountancy.AccountancyEntry
org.salespointframework.accountancy.ProductPaymentEntry
- All Implemented Interfaces:
Persistable<AccountancyEntryIdentifier>
@Entity public class ProductPaymentEntry extends AccountancyEntry
A
ProductPaymentEntry
is used to store information of payments of orders.- Author:
- Hannes Weisbach, Thomas Dedek, Oliver Gierke
-
Constructor Summary
Constructors Constructor Description ProductPaymentEntry(OrderIdentifier orderIdentifier, UserAccount userAccount, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod)
AProductPaymentEntry
is constructed for a specificOrderIdentifier
attached to it. -
Method Summary
Modifier and Type Method Description boolean
belongsTo(Order order)
Returns whether theProductPaymentEntry
belongs to the givenOrder
.OrderIdentifier
getOrderIdentifier()
TheOrderIdentifier
which thisProductPaymentEntry
refers to.PaymentMethod
getPaymentMethod()
ThePaymentMethod
chosen for the order belonging to thisProductPaymentEntry
UserAccount
getUserAccount()
TheUserAccount
which thisProductPaymentEntry
refers to.static ProductPaymentEntry
of(Order order, String description)
static ProductPaymentEntry
rollback(Order order, String description)
Creates a newProductPaymentEntry
that rolls back the payment for the givenOrder
.String
toString()
Methods inherited from class org.salespointframework.accountancy.AccountancyEntry
getDate, getDescription, getId, getValue, hasDate, isExpense, isRevenue
Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, hasId, isNew
-
Constructor Details
-
ProductPaymentEntry
public ProductPaymentEntry(OrderIdentifier orderIdentifier, UserAccount userAccount, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod)AProductPaymentEntry
is constructed for a specificOrderIdentifier
attached to it. This entry saves also theUserAccountIdentifier
and the specified amount that was paid.- Parameters:
orderIdentifier
- theOrderIdentifier
to which thisProductPaymentEntry
will refer to, must not be null.userAccount
- theUserAccount
to which thisProductPaymentEntry
will refer to, must not be null.amount
- theMonetaryAmount
that was paid, must not be null.description
- textual description of the payment entry, must not be null.paymentMethod
- must not be null.
-
-
Method Details
-
of
-
rollback
Creates a newProductPaymentEntry
that rolls back the payment for the givenOrder
.- Parameters:
order
- must not be null.description
- must not be null.- Returns:
- Since:
- 7.1
-
belongsTo
Returns whether theProductPaymentEntry
belongs to the givenOrder
.- Parameters:
order
- must not be null.- Returns:
-
getOrderIdentifier
TheOrderIdentifier
which thisProductPaymentEntry
refers to. -
getUserAccount
TheUserAccount
which thisProductPaymentEntry
refers to. -
getPaymentMethod
ThePaymentMethod
chosen for the order belonging to thisProductPaymentEntry
-
toString
- Overrides:
toString
in classAccountancyEntry
-