From bd988adf53a850059a636bef0f349f536c1db97a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 7 Jun 2020 14:07:24 +0200 Subject: [PATCH] Continued: - some receipts bear a resumption/continuation of an other previous receipt. - this information can now be reflected in this entity MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/receipt/BillableReceipt.java | 14 ++++++++++++++ .../model/receipt/FinancialReceipt.java | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) 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; -- 2.39.5