Class ProductPaymentEntry
- java.lang.Object
 - 
- org.salespointframework.core.AbstractEntity<AccountancyEntryIdentifier>
 - 
- org.salespointframework.accountancy.AccountancyEntry
 - 
- org.salespointframework.accountancy.ProductPaymentEntry
 
 
 
 
- 
- All Implemented Interfaces:
 org.springframework.data.domain.Persistable<AccountancyEntryIdentifier>
@Entity public class ProductPaymentEntry extends AccountancyEntry
AProductPaymentEntryis 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
All Methods Static Methods Instance Methods Concrete Methods 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, isRevenue 
- 
Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, isNew 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
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 Detail
- 
of
public static ProductPaymentEntry of(Order order, String description)
 
- 
rollback
public static ProductPaymentEntry rollback(Order order, String description)
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
public boolean belongsTo(Order order)
Returns whether theProductPaymentEntrybelongs to the givenOrder.- Parameters:
 order- must not be null.- Returns:
 
 
- 
getOrderIdentifier
public OrderIdentifier getOrderIdentifier()
TheOrderIdentifierwhich thisProductPaymentEntryrefers to. 
- 
getUserAccount
public UserAccount getUserAccount()
TheUserAccountwhich thisProductPaymentEntryrefers to. 
- 
getPaymentMethod
public PaymentMethod getPaymentMethod()
ThePaymentMethodchosen for the order belonging to thisProductPaymentEntry 
- 
toString
public String toString()
- Overrides:
 toStringin classAccountancyEntry
 
 - 
 
 -