]> git.mxchange.org Git - jbonuscard-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 14 Oct 2017 12:55:45 +0000 (14:55 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 14 Oct 2017 13:20:18 +0000 (15:20 +0200)
- removed itemProductPrice as this was redundant (see jproduct-core)

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jfinancials/model/receipt/item/BillableReceiptItem.java
src/org/mxchange/jfinancials/model/receipt/item/FinancialReceiptItem.java
src/org/mxchange/jfinancials/model/receipt/item/ReceiptItems.java

index 39db54e75192b45b1a902d0d88ca922db904ae2b..85ee3a091e7a8b5c167cb46e9b1ed727abb237ce 100644 (file)
@@ -85,46 +85,32 @@ public interface BillableReceiptItem extends Serializable {
        void setItemProduct (final Product itemProduct);
 
        /**
-        * Getter for product quantity
-        * <p>
-        * @return Product quantity
-        */
-       Long getItemProductQuantity ();
-
-       /**
-        * Setter for product quantity
-        * <p>
-        * @param itemProductQuantity Product quantity
-        */
-       void setItemProductQuantity (final Long itemProductQuantity);
-
-       /**
-        * Getter for product single price (copied from GenericProduct)
+        * Getter for product discount
         * <p>
-        * @return Product single price
+        * @return Product discount
         */
-       Float getItemProductPrice ();
+       Float getItemProductDiscount ();
 
        /**
-        * Setter for product single price (copied from GenericProduct)
+        * Setter for product discount
         * <p>
-        * @param itemProductPrice Product single price
+        * @param productDiscount Product discount
         */
-       void setItemProductPrice (final Float itemProductPrice);
+       void setItemProductDiscount (final Float productDiscount);
 
        /**
-        * Getter for item discount
+        * Getter for product quantity
         * <p>
-        * @return Item discount
+        * @return Product quantity
         */
-       Float getItemDiscount ();
+       Long getItemProductQuantity ();
 
        /**
-        * Setter for item discount
+        * Setter for product quantity
         * <p>
-        * @param itemDiscount Item discount
+        * @param itemProductQuantity Product quantity
         */
-       void setItemDiscount (final Float itemDiscount);
+       void setItemProductQuantity (final Long itemProductQuantity);
 
        @Override
        boolean equals (final Object object);
index 66a602b6efb171cf75074843152f4c053b807f87..c618991c3a070c08491e9e56105b668f174fb76c 100644 (file)
@@ -66,12 +66,6 @@ public class FinancialReceiptItem implements BillableReceiptItem {
        @Column (name = "item_created", nullable = false)
        private Date itemCreated;
 
-       /**
-        * Discount on item
-        */
-       @Column (name = "item_product_discount")
-       private Float itemDiscount;
-
        /**
         * Primary key
         */
@@ -88,11 +82,10 @@ public class FinancialReceiptItem implements BillableReceiptItem {
        private Product itemProduct;
 
        /**
-        * Single product price (being copied here from GenericProduct)
+        * Discount on item
         */
-       @Basic (optional = false)
-       @Column (name = "item_product_price", nullable = false)
-       private Float itemProductPrice;
+       @Column (name = "item_product_discount")
+       private Float itemProductDiscount;
 
        /**
         * Product quantity
@@ -118,17 +111,15 @@ public class FinancialReceiptItem implements BillableReceiptItem {
         * Constructor with product, price, quantity and receipt instance
         * <p>
         * @param itemProduct         Product instance
-        * @param itemProductPrice    Product price (copied)
         * @param itemProductQuantity Product quantity
         * @param itemReceipt         FinancialReceipt instance
         */
-       public FinancialReceiptItem (final Product itemProduct, final Float itemProductPrice, final Long itemProductQuantity, final BillableReceipt itemReceipt) {
+       public FinancialReceiptItem (final Product itemProduct, final Long itemProductQuantity, final BillableReceipt itemReceipt) {
                // Call other constructor
                this();
 
                // Set all values
                this.itemProduct = itemProduct;
-               this.itemProductPrice = itemProductPrice;
                this.itemProductQuantity = itemProductQuantity;
                this.itemReceipt = itemReceipt;
        }
@@ -149,8 +140,6 @@ public class FinancialReceiptItem implements BillableReceiptItem {
                        return false;
                } else if (!Objects.equals(this.getItemProduct(), receiptItem.getItemProduct())) {
                        return false;
-               } else if (!Objects.equals(this.getItemProductPrice(), receiptItem.getItemProductPrice())) {
-                       return false;
                } else if (!Objects.equals(this.getItemProductQuantity(), receiptItem.getItemProductQuantity())) {
                        return false;
                } else if (!Objects.equals(this.getItemReceipt(), receiptItem.getItemReceipt())) {
@@ -172,16 +161,6 @@ public class FinancialReceiptItem implements BillableReceiptItem {
                this.itemCreated = itemCreated;
        }
 
-       @Override
-       public Float getItemDiscount () {
-               return this.itemDiscount;
-       }
-
-       @Override
-       public void setItemDiscount (final Float itemDiscount) {
-               this.itemDiscount = itemDiscount;
-       }
-
        @Override
        public Long getItemId () {
                return this.itemId;
@@ -203,13 +182,13 @@ public class FinancialReceiptItem implements BillableReceiptItem {
        }
 
        @Override
-       public Float getItemProductPrice () {
-               return this.itemProductPrice;
+       public Float getItemProductDiscount () {
+               return this.itemProductDiscount;
        }
 
        @Override
-       public void setItemProductPrice (final Float itemProductPrice) {
-               this.itemProductPrice = itemProductPrice;
+       public void setItemProductDiscount (final Float itemProductDiscount) {
+               this.itemProductDiscount = itemProductDiscount;
        }
 
        @Override
@@ -238,7 +217,6 @@ public class FinancialReceiptItem implements BillableReceiptItem {
 
                hash = 53 * hash + Objects.hashCode(this.getItemId());
                hash = 53 * hash + Objects.hashCode(this.getItemProduct());
-               hash = 53 * hash + Objects.hashCode(this.getItemProductPrice());
                hash = 53 * hash + Objects.hashCode(this.getItemProductQuantity());
                hash = 53 * hash + Objects.hashCode(this.getItemReceipt());
 
index d7d4fd70501f96b4cfaadf72cfef89158c554dfa..a386d9b0c03415c0553daf1085c2051305b46bf0 100644 (file)
@@ -100,9 +100,6 @@ public class ReceiptItems implements Serializable {
                } else if (!Objects.equals(receiptItem1.getItemProduct(), receiptItem2.getItemProduct())) {
                        // Other item product
                        return false;
-               } else if (!Objects.equals(receiptItem1.getItemProductPrice(), receiptItem2.getItemProductPrice())) {
-                       // Other product price
-                       return false;
                } else if (!Objects.equals(receiptItem1.getItemProductQuantity(), receiptItem2.getItemProductQuantity())) {
                        // Other item quantity
                        return false;