BrightSide Workbench Full Report + Source Code
org.turro.financials.treasury.settlement.SettlementSet Class Reference
Inheritance diagram for org.turro.financials.treasury.settlement.SettlementSet:
Collaboration diagram for org.turro.financials.treasury.settlement.SettlementSet:

Public Member Functions

Date getDate ()
 
void setDate (Date date)
 
Date getSettlementDate ()
 
void setSettlementDate (Date settlementDate)
 
Dao getDao ()
 
Date getInitialDate ()
 
double getDebtorTotal ()
 
double getCreditorTotal ()
 
void generateRegister (Contract store)
 

Detailed Description

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

Definition at line 38 of file SettlementSet.java.

Member Function Documentation

◆ generateRegister()

void org.turro.financials.treasury.settlement.SettlementSet.generateRegister ( Contract  store)

Definition at line 146 of file SettlementSet.java.

146  {
147  RegisterGenerator reg = new RegisterGenerator();
148  RegisterView formalView = ViewWrapper.getFormalView();
149  reg.getRegister().setView(formalView);
150  reg.getRegister().setRegisterDate(date);
151 
152  double total = 0.0;
153 
154  for(SettlementEntry se : this) {
155  Account acc = new Account();
156  acc.setId(se.getAccount());
157  if(se.isChecked() && se.isCreditorIRPF()) {
158  reg.addAccount(acc, I_.get("Settlement") + " " + I_.get("Treasury"), se.getAmount(), 0);
159  total -= se.getAmount();
160  }
161  }
162 
163  if(total < 0.0) {
164  Account acc = new Account();
165  acc.setId("4751000000");
166  reg.addAccount(acc, I_.get("Settlement") + " " + I_.get("Treasury"), 0.0, -total);
167  } else if(total > 0.0) {
168  Account acc = new Account();
169  acc.setId("4730000000");
170  reg.addAccount(acc, I_.get("Settlement") + " " + I_.get("Treasury"), total, 0.0);
171  }
172 
173  FinancialsMenu.showRegister(reg.getRegister());
174 
175  RegisterGenerator reg2 = new RegisterGenerator();
176  reg2.getRegister().setView(formalView);
177  reg2.getRegister().setRegisterDate(settlementDate);
178 
179  if(total < 0.0) {
180  Account acc = new Account();
181  acc.setId("4751000000");
182  reg2.addAccount(acc, I_.get("Settlement") + " " + I_.get("Treasury"), -total, 0.0);
183  } else if(total > 0.0) {
184  Account acc = new Account();
185  acc.setId("4730000000");
186  reg2.addAccount(acc, I_.get("Settlement") + " " + I_.get("Treasury"), 0.0, total);
187  }
188 
189  for(SettlementEntry se : this) {
190  Account acc = new Account();
191  acc.setId(se.getAccount());
192  if(se.isChecked() && se.isCreditorVAT()) {
193  reg2.addAccount(acc, I_.get("Settlement") + " " + I_.get("Treasury"), se.getAmount(), 0);
194  total -= se.getAmount();
195  } else if(se.isChecked() && se.isDebtor()) {
196  reg2.addAccount(acc, I_.get("Settlement") + " " + I_.get("Treasury"), 0, se.getAmount());
197  total += se.getAmount();
198  }
199  }
200 
201  if(total < 0.0) {
202  reg2.addAccount(store, I_.get("Settlement") + " " + I_.get("Treasury"), 0.0, -total);
203  } else if(total > 0.0) {
204  reg2.addAccount(store, I_.get("Settlement") + " " + I_.get("Treasury"), total, 0.0);
205  }
206 
207  FinancialsMenu.showRegister(reg2.getRegister());
208  }
Here is the call graph for this function:

◆ getCreditorTotal()

double org.turro.financials.treasury.settlement.SettlementSet.getCreditorTotal ( )

Definition at line 136 of file SettlementSet.java.

136  {
137  double total = 0.0;
138  for(SettlementEntry se : this) {
139  if(se.isChecked() && (se.isCreditorVAT() || se.isCreditorIRPF())) {
140  total += se.getAmount();
141  }
142  }
143  return total;
144  }
Here is the call graph for this function:

◆ getDao()

Dao org.turro.financials.treasury.settlement.SettlementSet.getDao ( )

Definition at line 65 of file SettlementSet.java.

65  {
66  if(dao == null) {
67  dao = new FinancialsPU();
68  }
69  return dao;
70  }

◆ getDate()

Date org.turro.financials.treasury.settlement.SettlementSet.getDate ( )

Definition at line 48 of file SettlementSet.java.

48  {
49  return date;
50  }

◆ getDebtorTotal()

double org.turro.financials.treasury.settlement.SettlementSet.getDebtorTotal ( )

Definition at line 126 of file SettlementSet.java.

126  {
127  double total = 0.0;
128  for(SettlementEntry se : this) {
129  if(se.isChecked() && se.isDebtor()) {
130  total += se.getAmount();
131  }
132  }
133  return total;
134  }
Here is the call graph for this function:

◆ getInitialDate()

Date org.turro.financials.treasury.settlement.SettlementSet.getInitialDate ( )

Definition at line 122 of file SettlementSet.java.

122  {
123  return new CheckDate(date).setMonth(1).setDay(1).getDate();
124  }

◆ getSettlementDate()

Date org.turro.financials.treasury.settlement.SettlementSet.getSettlementDate ( )

Definition at line 57 of file SettlementSet.java.

57  {
58  return settlementDate;
59  }

◆ setDate()

void org.turro.financials.treasury.settlement.SettlementSet.setDate ( Date  date)

Definition at line 52 of file SettlementSet.java.

52  {
53  this.date = date;
54  fillData();
55  }

◆ setSettlementDate()

void org.turro.financials.treasury.settlement.SettlementSet.setSettlementDate ( Date  settlementDate)

Definition at line 61 of file SettlementSet.java.

61  {
62  this.settlementDate = settlementDate;
63  }

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