Class ProductPaymentEntry
java.lang.Object
org.salespointframework.core.AbstractEntity<AccountancyEntry.AccountancyEntryIdentifier>
org.salespointframework.accountancy.AccountancyEntry
org.salespointframework.accountancy.ProductPaymentEntry
- All Implemented Interfaces:
Persistable<AccountancyEntry.AccountancyEntryIdentifier>
A
ProductPaymentEntry
is used to store information of payments of orders.- Author:
- Hannes Weisbach, Thomas Dedek, Oliver Gierke
-
Nested Class Summary
Nested classes/interfaces inherited from class org.salespointframework.accountancy.AccountancyEntry
AccountancyEntry.AccountancyEntryIdentifier
-
Constructor Summary
ConstructorsConstructorDescriptionProductPaymentEntry
(Order.OrderIdentifier orderIdentifier, UserAccount userAccount, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod) AProductPaymentEntry
is constructed for a specificOrder.OrderIdentifier
attached to it. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether theProductPaymentEntry
belongs to the givenOrder
.TheOrder.OrderIdentifier
which thisProductPaymentEntry
refers to.ThePaymentMethod
chosen for the order belonging to thisProductPaymentEntry
TheUserAccount
which thisProductPaymentEntry
refers to.static ProductPaymentEntry
static ProductPaymentEntry
Creates a newProductPaymentEntry
that rolls back the payment for the givenOrder
.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(Order.OrderIdentifier orderIdentifier, UserAccount userAccount, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod) AProductPaymentEntry
is constructed for a specificOrder.OrderIdentifier
attached to it. This entry saves also theUserAccount.UserAccountIdentifier
and the specified amount that was paid.- Parameters:
orderIdentifier
- theOrder.OrderIdentifier
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
TheOrder.OrderIdentifier
which thisProductPaymentEntry
refers to. -
getUserAccount
TheUserAccount
which thisProductPaymentEntry
refers to. -
getPaymentMethod
ThePaymentMethod
chosen for the order belonging to thisProductPaymentEntry
-
toString
- Overrides:
toString
in classAccountancyEntry
-