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)AProductPaymentEntryis constructed for a specificOrderIdentifierattached to it. -
Method Summary
Modifier and Type Method Description booleanbelongsTo(Order order)Returns whether theProductPaymentEntrybelongs to the givenOrder.OrderIdentifiergetOrderIdentifier()TheOrderIdentifierwhich thisProductPaymentEntryrefers to.PaymentMethodgetPaymentMethod()ThePaymentMethodchosen for the order belonging to thisProductPaymentEntryUserAccountgetUserAccount()TheUserAccountwhich thisProductPaymentEntryrefers to.static ProductPaymentEntryof(Order order, String description)static ProductPaymentEntryrollback(Order order, String description)Creates a newProductPaymentEntrythat rolls back the payment for the givenOrder.StringtoString()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(OrderIdentifier orderIdentifier, UserAccount userAccount, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod)AProductPaymentEntryis constructed for a specificOrderIdentifierattached to it. This entry saves also theUserAccountIdentifierand the specified amount that was paid.- Parameters:
orderIdentifier- theOrderIdentifierto 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
TheOrderIdentifierwhich thisProductPaymentEntryrefers to. -
getUserAccount
TheUserAccountwhich thisProductPaymentEntryrefers to. -
getPaymentMethod
ThePaymentMethodchosen for the order belonging to thisProductPaymentEntry -
toString
- Overrides:
toStringin classAccountancyEntry
-