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

Public Member Functions

 DocumentAmountsByBook (Document document, BookDefinition bookDefinition)
 
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 31 of file DocumentAmountsByBook.java.

Constructor & Destructor Documentation

◆ DocumentAmountsByBook()

org.turro.financials.model.document.DocumentAmountsByBook.DocumentAmountsByBook ( Document  document,
BookDefinition  bookDefinition 
)

Definition at line 38 of file DocumentAmountsByBook.java.

38  {
39  this.document = document;
40  this.bookDefinition = bookDefinition;
41  createAmounts();
42  }

Member Function Documentation

◆ getAmount()

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

Definition at line 52 of file DocumentAmountsByBook.java.

52  {
53  double amount = 0.0;
54  for(AmountTaxable at : taxables) {
55  amount += at.getAmount();
56  }
57  return amount;
58  }

◆ getCurrency()

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

Definition at line 118 of file DocumentAmountsByBook.java.

118  {
119  if(currency == null && document.getContract() != null) {
120  currency = document.getContract().getCurrency();
121  }
122  return currency == null ? Currencies.getDefault() : currency;
123  }
Here is the call graph for this function:

◆ getDiscount()

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

Definition at line 60 of file DocumentAmountsByBook.java.

60  {
61  double amount = 0.0;
62  for(AmountTaxable at : taxables) {
63  amount += at.getDiscount();
64  }
65  return amount;
66  }

◆ getRetentions()

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

Definition at line 48 of file DocumentAmountsByBook.java.

48  {
49  return retentions;
50  }

◆ getTaxables()

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

Definition at line 44 of file DocumentAmountsByBook.java.

44  {
45  return taxables;
46  }

◆ getTotal()

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

Definition at line 68 of file DocumentAmountsByBook.java.

68  {
69  double amount = 0.0;
70  for(AmountTaxable at : taxables) {
71  if(at.isPerCent(0.0)) { //Contract operating modifier was set
72  amount += at.getTaxable();
73  } else {
74  amount += at.getTotal();
75  }
76  }
77  for(AmountRetained ar : retentions) {
78  amount -= ar.getRetained();
79  }
80  return amount;
81  }

◆ hasReq()

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

Definition at line 83 of file DocumentAmountsByBook.java.

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

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