From cf3bd42a74e9dcfb275968c69e6d1e73f8567389 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 14 Oct 2017 14:55:45 +0200 Subject: [PATCH] Continued: - removed itemProductPrice as this was redundant (see jproduct-core) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../receipt/item/BillableReceiptItem.java | 38 ++++++------------- .../receipt/item/FinancialReceiptItem.java | 38 ++++--------------- .../model/receipt/item/ReceiptItems.java | 3 -- 3 files changed, 20 insertions(+), 59 deletions(-) diff --git a/src/org/mxchange/jfinancials/model/receipt/item/BillableReceiptItem.java b/src/org/mxchange/jfinancials/model/receipt/item/BillableReceiptItem.java index 39db54e..85ee3a0 100644 --- a/src/org/mxchange/jfinancials/model/receipt/item/BillableReceiptItem.java +++ b/src/org/mxchange/jfinancials/model/receipt/item/BillableReceiptItem.java @@ -85,46 +85,32 @@ public interface BillableReceiptItem extends Serializable { void setItemProduct (final Product itemProduct); /** - * Getter for product quantity - *

- * @return Product quantity - */ - Long getItemProductQuantity (); - - /** - * Setter for product quantity - *

- * @param itemProductQuantity Product quantity - */ - void setItemProductQuantity (final Long itemProductQuantity); - - /** - * Getter for product single price (copied from GenericProduct) + * Getter for product discount *

- * @return Product single price + * @return Product discount */ - Float getItemProductPrice (); + Float getItemProductDiscount (); /** - * Setter for product single price (copied from GenericProduct) + * Setter for product discount *

- * @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 *

- * @return Item discount + * @return Product quantity */ - Float getItemDiscount (); + Long getItemProductQuantity (); /** - * Setter for item discount + * Setter for product quantity *

- * @param itemDiscount Item discount + * @param itemProductQuantity Product quantity */ - void setItemDiscount (final Float itemDiscount); + void setItemProductQuantity (final Long itemProductQuantity); @Override boolean equals (final Object object); diff --git a/src/org/mxchange/jfinancials/model/receipt/item/FinancialReceiptItem.java b/src/org/mxchange/jfinancials/model/receipt/item/FinancialReceiptItem.java index 66a602b..c618991 100644 --- a/src/org/mxchange/jfinancials/model/receipt/item/FinancialReceiptItem.java +++ b/src/org/mxchange/jfinancials/model/receipt/item/FinancialReceiptItem.java @@ -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 *

* @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()); diff --git a/src/org/mxchange/jfinancials/model/receipt/item/ReceiptItems.java b/src/org/mxchange/jfinancials/model/receipt/item/ReceiptItems.java index d7d4fd7..a386d9b 100644 --- a/src/org/mxchange/jfinancials/model/receipt/item/ReceiptItems.java +++ b/src/org/mxchange/jfinancials/model/receipt/item/ReceiptItems.java @@ -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; -- 2.39.5