Class OrderPaymentEntry
java.lang.Object
org.salespointframework.core.AbstractEntity<AccountancyEntry.AccountancyEntryIdentifier>
org.salespointframework.accountancy.AccountancyEntry
org.salespointframework.accountancy.OrderPaymentEntry
- All Implemented Interfaces:
Persistable<AccountancyEntry.AccountancyEntryIdentifier>
A
OrderPaymentEntry 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
ConstructorsConstructorDescriptionOrderPaymentEntry(Order.OrderIdentifier orderIdentifier, UserAccount.UserAccountIdentifier userAccountIdentifier, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod) AProductPaymentEntryis constructed for a specificOrder.OrderIdentifierattached to it. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether theOrderPaymentEntrybelongs to the givenOrder.TheOrder.OrderIdentifierwhich thisOrderPaymentEntryrefers to.ThePaymentMethodchosen for the order belonging to thisOrderPaymentEntry.The identifier of theUserAccountwhich thisOrderPaymentEntryrefers to.static OrderPaymentEntryCreates a newOrderPaymentEntryfor the givenOrderand description.static OrderPaymentEntryCreates a newOrderPaymentEntrythat 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
-
OrderPaymentEntry
public OrderPaymentEntry(Order.OrderIdentifier orderIdentifier, UserAccount.UserAccountIdentifier userAccountIdentifier, 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 thisOrderPaymentEntrywill refer to, must not be null.userAccountIdentifier- the identifier of theUserAccountthisOrderPaymentEntrywill 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
Creates a newOrderPaymentEntryfor the givenOrderand description.- Parameters:
order- must not be null.description- must not be null.- Returns:
- will never be null.
-
rollback
Creates a newOrderPaymentEntrythat rolls back the payment for the givenOrder.- Parameters:
order- must not be null.description- must not be null.- Returns:
- will never be null.
- Since:
- 7.1
-
belongsTo
Returns whether theOrderPaymentEntrybelongs to the givenOrder.- Parameters:
order- must not be null.- Returns:
- whether the
OrderPaymentEntrybelongs to the givenOrder.
-
getOrderIdentifier
TheOrder.OrderIdentifierwhich thisOrderPaymentEntryrefers to. -
getUserAccountIdentifier
The identifier of theUserAccountwhich thisOrderPaymentEntryrefers to. -
getPaymentMethod
ThePaymentMethodchosen for the order belonging to thisOrderPaymentEntry. -
toString
- Overrides:
toStringin classAccountancyEntry
-