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) AProductPaymentEntryis constructed for a specificOrder.OrderIdentifierattached to it. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether theProductPaymentEntrybelongs to the givenOrder.TheOrder.OrderIdentifierwhich thisProductPaymentEntryrefers to.ThePaymentMethodchosen for the order belonging to thisProductPaymentEntryTheUserAccountwhich thisProductPaymentEntryrefers to.static ProductPaymentEntrystatic ProductPaymentEntryCreates a newProductPaymentEntrythat rolls back the payment for the givenOrder.toString()Methods inherited from class org.salespointframework.accountancy.AccountancyEntry
getDate, getDescription, getId, getValue, hasDate, isExpense, isRevenueMethods 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) AProductPaymentEntryis constructed for a specificOrder.OrderIdentifierattached to it. This entry saves also theUserAccount.UserAccountIdentifierand the specified amount that was paid.- Parameters:
orderIdentifier- theOrder.OrderIdentifierto which thisProductPaymentEntrywill refer to, must not be null.userAccount- theUserAccountto which thisProductPaymentEntrywill refer to, must not be null.amount- theMonetaryAmountthat 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 newProductPaymentEntrythat 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 theProductPaymentEntrybelongs to the givenOrder.- Parameters:
order- must not be null.- Returns:
-
getOrderIdentifier
TheOrder.OrderIdentifierwhich thisProductPaymentEntryrefers to. -
getUserAccount
TheUserAccountwhich thisProductPaymentEntryrefers to. -
getPaymentMethod
ThePaymentMethodchosen for the order belonging to thisProductPaymentEntry -
toString
- Overrides:
toStringin classAccountancyEntry
-