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);
@Column (name = "item_created", nullable = false)
private Date itemCreated;
- /**
- * Discount on item
- */
- @Column (name = "item_product_discount")
- private Float itemDiscount;
-
/**
* Primary key
*/
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
* 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;
}
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())) {
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;
}
@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
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());