From: Roland Häder Date: Sun, 7 Jun 2020 12:07:24 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bd988adf53a850059a636bef0f349f536c1db97a;p=jfinancials-core.git Continued: - some receipts bear a resumption/continuation of an other previous receipt. - this information can now be reflected in this entity Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java b/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java index 478a10c..2fdb308 100644 --- a/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java +++ b/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java @@ -185,6 +185,20 @@ public interface BillableReceipt extends Comparable, Serializab */ void setReceiptBranchOffice (final BranchOffice receiptBranch); + /** + * Getter for receipt resumption (which other receipt this one is based on). + *

+ * @return Receipt this one is based on + */ + BillableReceipt getReceiptResumptionOf (); + + /** + * Setter for receipt resumption (which other receipt this one is based on). + *

+ * @param receiptResumptionOf Receipt this one is based on + */ + void setReceiptResumptionOf (final BillableReceipt receiptResumptionOf); + /** * Getter for payment type *

diff --git a/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java b/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java index d3f2431..735d474 100644 --- a/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java +++ b/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java @@ -146,6 +146,13 @@ public class FinancialReceipt implements BillableReceipt { @Column (name = "receipt_register_number") private Long receiptRegisterNumber; + /** + * Receipt resumes an other existing receipt + */ + @JoinColumn (name = "receipt_resumption_id", referencedColumnName = "receipt_id") + @OneToOne (targetEntity = FinancialReceipt.class, cascade = CascadeType.REFRESH) + private BillableReceipt receiptResumptionOf; + /** * Selling employee instance */ @@ -438,6 +445,16 @@ public class FinancialReceipt implements BillableReceipt { this.receiptRegisterNumber = receiptRegisterNumber; } + @Override + public BillableReceipt getReceiptResumptionOf () { + return this.receiptResumptionOf; + } + + @Override + public void setReceiptResumptionOf (final BillableReceipt receiptResumptionOf) { + this.receiptResumptionOf = receiptResumptionOf; + } + @Override public Employable getReceiptSellerEmployee () { return this.receiptSellerEmployee;