]> git.mxchange.org Git - jfinancials-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 7 Jun 2020 12:07:24 +0000 (14:07 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 7 Jun 2020 12:07:24 +0000 (14:07 +0200)
- 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 <roland@mxchange.org>
src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java
src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java

index 478a10cf86cd75a3934c3d01cb69fe1cede626fa..2fdb30850e44d59420cc47ec657682a973e3b362 100644 (file)
@@ -185,6 +185,20 @@ public interface BillableReceipt extends Comparable<BillableReceipt>, Serializab
         */
        void setReceiptBranchOffice (final BranchOffice receiptBranch);
 
+       /**
+        * Getter for receipt resumption (which other receipt this one is based on).
+        * <p>
+        * @return Receipt this one is based on
+        */
+       BillableReceipt getReceiptResumptionOf ();
+
+       /**
+        * Setter for receipt resumption (which other receipt this one is based on).
+        * <p>
+        * @param receiptResumptionOf Receipt this one is based on
+        */
+       void setReceiptResumptionOf (final BillableReceipt receiptResumptionOf);
+
        /**
         * Getter for payment type
         * <p>
index d3f24311c0d8ffbcfb24c30f26a0447af46d8ec4..735d4749eff6895d86e8bf37d3bc7cd109258484 100644 (file)
@@ -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;