BrightSide Workbench Full Report + Source Code
org.turro.financials.model.document.DocumentAmounts Class Reference

Public Member Functions

 DocumentAmounts (Document document)
 
AmountTaxableSet getTaxables ()
 
AmountRetainedSet getRetentions ()
 
double getAmount ()
 
double getDiscount ()
 
double getTotal ()
 
boolean hasReq ()
 
Currency getCurrency ()
 

Detailed Description

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

Definition at line 30 of file DocumentAmounts.java.

Constructor & Destructor Documentation

◆ DocumentAmounts()

org.turro.financials.model.document.DocumentAmounts.DocumentAmounts ( Document  document)

Definition at line 36 of file DocumentAmounts.java.

36  {
37  this.document = document;
38  createAmounts();
39  }

Member Function Documentation

◆ getAmount()

double org.turro.financials.model.document.DocumentAmounts.getAmount ( )

Definition at line 49 of file DocumentAmounts.java.

49  {
50  double amount = 0.0;
51  for(AmountTaxable at : taxables) {
52  amount += at.getAmount();
53  }
54  return amount;
55  }

◆ getCurrency()

Currency org.turro.financials.model.document.DocumentAmounts.getCurrency ( )

Definition at line 113 of file DocumentAmounts.java.

113  {
114  if(currency == null && document.getContract() != null) {
115  currency = document.getContract().getCurrency();
116  }
117  return currency == null ? Currencies.getDefault() : currency;
118  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDiscount()

double org.turro.financials.model.document.DocumentAmounts.getDiscount ( )

Definition at line 57 of file DocumentAmounts.java.

57  {
58  double amount = 0.0;
59  for(AmountTaxable at : taxables) {
60  amount += at.getDiscount();
61  }
62  return amount;
63  }

◆ getRetentions()

AmountRetainedSet org.turro.financials.model.document.DocumentAmounts.getRetentions ( )

Definition at line 45 of file DocumentAmounts.java.

45  {
46  return retentions;
47  }
Here is the caller graph for this function:

◆ getTaxables()

AmountTaxableSet org.turro.financials.model.document.DocumentAmounts.getTaxables ( )

Definition at line 41 of file DocumentAmounts.java.

41  {
42  return taxables;
43  }
Here is the caller graph for this function:

◆ getTotal()

double org.turro.financials.model.document.DocumentAmounts.getTotal ( )

Definition at line 65 of file DocumentAmounts.java.

65  {
66  double amount = 0.0;
67  for(AmountTaxable at : taxables) {
68  if(at.isPerCent(0.0)) { //Contract operating modifier was set
69  amount += at.getTaxable();
70  } else {
71  amount += at.getTotal();
72  }
73  }
74  for(AmountRetained ar : retentions) {
75  amount -= ar.getRetained();
76  }
77  return amount;
78  }
Here is the caller graph for this function:

◆ hasReq()

boolean org.turro.financials.model.document.DocumentAmounts.hasReq ( )

Definition at line 80 of file DocumentAmounts.java.

80  {
81  return document.getContract() != null &&
83  }
Here is the call graph for this function:
Here is the caller graph for this function:

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