private static final long serialVersionUID = 185_867_217_461L;
/**
- * When this receipt has been created
+ * When this receipt entry has been created
*/
@Basic (optional = false)
@Temporal (TemporalType.TIMESTAMP)
@Column (name = "receipt_id", nullable = false, updatable = false)
private Long receiptId;
+ /**
+ * When this receipt has been issued
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.DATE)
+ @Column (name = "receipt_issued", nullable = false)
+ private Calendar receiptIssued;
+
/**
* Payment type (cash, credit card, EC card ...)
*/
* @param receiptPaymentType Payment type
* @param receiptSeller Seller instance
* @param receiptUser User instance
+ * @param receiptIssued When this receipt has been issued
*/
- public FinancialReceipt (final PaymentType receiptPaymentType, final BusinessContact receiptSeller, final User receiptUser) {
+ public FinancialReceipt (final PaymentType receiptPaymentType, final BusinessContact receiptSeller, final User receiptUser, final Calendar receiptIssued) {
// Call other constructor first
this();
this.receiptPaymentType = receiptPaymentType;
this.receiptSeller = receiptSeller;
this.receiptUser = receiptUser;
+ this.receiptIssued = receiptIssued;
}
@Override
return false;
} else if (!Objects.equals(this.getReceiptUser(), receipt.getReceiptUser())) {
return false;
+ } else if (!Objects.equals(this.getReceiptIssued(), receipt.getReceiptIssued())) {
+ return false;
}
return true;
this.receiptId = receiptId;
}
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Calendar getReceiptIssued () {
+ return this.receiptIssued;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setReceiptIssued (final Calendar receiptIssued) {
+ this.receiptIssued = receiptIssued;
+ }
+
@Override
public PaymentType getReceiptPaymentType () {
return this.receiptPaymentType;