BrightSide Workbench Full Report + Source Code
All Classes Namespaces Files Functions Variables Pages
org.turro.financials.cart.CartAmounts Class Reference

Public Member Functions

 CartAmounts (Cart cart)
 
CartTaxableSet getTaxables ()
 
double getAmount ()
 
double getDiscount ()
 
double getTotal ()
 

Detailed Description

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

Definition at line 25 of file CartAmounts.java.

Constructor & Destructor Documentation

◆ CartAmounts()

org.turro.financials.cart.CartAmounts.CartAmounts ( Cart  cart)

Definition at line 30 of file CartAmounts.java.

30  {
31  this.cart = cart;
32  createAmounts();
33  }

Member Function Documentation

◆ getAmount()

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

Definition at line 39 of file CartAmounts.java.

39  {
40  double amount = 0.0;
41  for(CartTaxable at : taxables) {
42  amount += at.getAmount();
43  }
44  return amount;
45  }

◆ getDiscount()

double org.turro.financials.cart.CartAmounts.getDiscount ( )

Definition at line 47 of file CartAmounts.java.

47  {
48  double amount = 0.0;
49  for(CartTaxable at : taxables) {
50  amount += at.getDiscount();
51  }
52  return amount;
53  }

◆ getTaxables()

CartTaxableSet org.turro.financials.cart.CartAmounts.getTaxables ( )

Definition at line 35 of file CartAmounts.java.

35  {
36  return taxables;
37  }

◆ getTotal()

double org.turro.financials.cart.CartAmounts.getTotal ( )

Definition at line 55 of file CartAmounts.java.

55  {
56  double amount = 0.0;
57  for(CartTaxable at : taxables) {
58  if(at.isPerCent(0.0)) {
59  amount += at.getTaxable();
60  } else {
61  amount += at.getTotal();
62  }
63  }
64  return amount;
65  }

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