BrightSide Workbench Full Report + Source Code
org.turro.financials.cart.CartItem Class Reference
Inheritance diagram for org.turro.financials.cart.CartItem:
Collaboration diagram for org.turro.financials.cart.CartItem:

Public Member Functions

int getOrder ()
 
void setOrder (int order)
 
long getProductId ()
 
void setProductId (long productId)
 
double getQuantity ()
 
void setQuantity (double quantity)
 
double getTax ()
 
void setTax (double tax)
 
double getPrice ()
 
void setPrice (double price)
 
String getConcept ()
 
void setConcept (String concept)
 
boolean isNeedsDelivery ()
 
boolean isDeliveryItem ()
 
void setDeliveryItem (boolean deliveryItem)
 
boolean isNeedsConcept ()
 
Double getTaxable ()
 
double getAmount ()
 
double getTaxAmount ()
 
boolean isValid ()
 
void makeValid ()
 
Product getProduct ()
 
int compareTo (CartItem o)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 31 of file CartItem.java.

Member Function Documentation

◆ compareTo()

int org.turro.financials.cart.CartItem.compareTo ( CartItem  o)

Definition at line 154 of file CartItem.java.

154  {
155  int result = CompareUtil.compare(getOrder(), o.getOrder());
156  if(result == 0) {
157  result = CompareUtil.compare(isValid(), o.isValid());
158  }
159  if(result == 0) {
160  result = CompareUtil.compare(getProduct().getId(), o.getProduct().getId());
161  }
162  return result;
163  }
Here is the call graph for this function:

◆ getAmount()

double org.turro.financials.cart.CartItem.getAmount ( )

Definition at line 109 of file CartItem.java.

109  {
110  return new Round((getTaxable() * (1 + tax / 100))).decimals(2).value();
111  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConcept()

String org.turro.financials.cart.CartItem.getConcept ( )

Definition at line 79 of file CartItem.java.

79  {
80  return concept;
81  }

◆ getOrder()

int org.turro.financials.cart.CartItem.getOrder ( )

Definition at line 39 of file CartItem.java.

39  {
40  return order;
41  }
Here is the caller graph for this function:

◆ getPrice()

double org.turro.financials.cart.CartItem.getPrice ( )

Definition at line 71 of file CartItem.java.

71  {
72  return price;
73  }

◆ getProduct()

Product org.turro.financials.cart.CartItem.getProduct ( )

Definition at line 140 of file CartItem.java.

140  {
141  if(productId != 0) {
142  if(product == null || productId != product.getId()) {
143  product = new FinancialsPU().find(Product.class, productId);
144  }
145  } else {
146  product = null;
147  }
148  return product;
149  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProductId()

long org.turro.financials.cart.CartItem.getProductId ( )

Definition at line 47 of file CartItem.java.

47  {
48  return productId;
49  }

◆ getQuantity()

double org.turro.financials.cart.CartItem.getQuantity ( )

Definition at line 55 of file CartItem.java.

55  {
56  return quantity;
57  }

◆ getTax()

double org.turro.financials.cart.CartItem.getTax ( )

Definition at line 63 of file CartItem.java.

63  {
64  return tax;
65  }

◆ getTaxable()

Double org.turro.financials.cart.CartItem.getTaxable ( )

Definition at line 105 of file CartItem.java.

105  {
106  return new Round(price * quantity).decimals(2).value();
107  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTaxAmount()

double org.turro.financials.cart.CartItem.getTaxAmount ( )

Definition at line 113 of file CartItem.java.

113  {
114  return getAmount() - getTaxable();
115  }
Here is the call graph for this function:

◆ isDeliveryItem()

boolean org.turro.financials.cart.CartItem.isDeliveryItem ( )

Definition at line 91 of file CartItem.java.

91  {
92  return deliveryItem;
93  }

◆ isNeedsConcept()

boolean org.turro.financials.cart.CartItem.isNeedsConcept ( )

Definition at line 99 of file CartItem.java.

99  {
100  return needsConcept;
101  }

◆ isNeedsDelivery()

boolean org.turro.financials.cart.CartItem.isNeedsDelivery ( )

Definition at line 87 of file CartItem.java.

87  {
88  return needsDelivery;
89  }

◆ isValid()

boolean org.turro.financials.cart.CartItem.isValid ( )

Definition at line 117 of file CartItem.java.

117  {
118  return getProduct() != null &&
119  quantity != 0.0;
120  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeValid()

void org.turro.financials.cart.CartItem.makeValid ( )

Definition at line 122 of file CartItem.java.

122  {
123  if(getProduct() != null) {
124  if(quantity == 0.0) {
125  quantity = 1.0;
126  }
127  if(tax == 0.0) {
128  tax = getProduct().getTax();
129  }
130  if(price == 0.0) {
131  price = getProduct().getPrice();
132  }
133  needsDelivery = getProduct().isDelivery();
134  needsConcept = getProduct().isConcept();
135  }
136  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConcept()

void org.turro.financials.cart.CartItem.setConcept ( String  concept)

Definition at line 83 of file CartItem.java.

83  {
84  this.concept = concept;
85  }
Here is the caller graph for this function:

◆ setDeliveryItem()

void org.turro.financials.cart.CartItem.setDeliveryItem ( boolean  deliveryItem)

Definition at line 95 of file CartItem.java.

95  {
96  this.deliveryItem = deliveryItem;
97  }
Here is the caller graph for this function:

◆ setOrder()

void org.turro.financials.cart.CartItem.setOrder ( int  order)

Definition at line 43 of file CartItem.java.

43  {
44  this.order = order;
45  }

◆ setPrice()

void org.turro.financials.cart.CartItem.setPrice ( double  price)

Definition at line 75 of file CartItem.java.

75  {
76  this.price = price;
77  }
Here is the caller graph for this function:

◆ setProductId()

void org.turro.financials.cart.CartItem.setProductId ( long  productId)

Definition at line 51 of file CartItem.java.

51  {
52  this.productId = productId;
53  }
Here is the caller graph for this function:

◆ setQuantity()

void org.turro.financials.cart.CartItem.setQuantity ( double  quantity)

Definition at line 59 of file CartItem.java.

59  {
60  this.quantity = Math.round(quantity);
61  }
Here is the caller graph for this function:

◆ setTax()

void org.turro.financials.cart.CartItem.setTax ( double  tax)

Definition at line 67 of file CartItem.java.

67  {
68  this.tax = tax;
69  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: