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

Public Member Functions

 ModelSet (int exercise)
 
double getTotalInputVat (int month)
 
double getTotalOutputVat (int month)
 
int getExercise ()
 
String getDeclaredPositiveAccount ()
 
String getDeclaredNegativeAccount ()
 
DeclaredMonth getDeclaredMonth (int month)
 
Dao getDao ()
 
void generateRegister (int month)
 

Detailed Description

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

Definition at line 36 of file m303m/ModelSet.java.

Constructor & Destructor Documentation

◆ ModelSet()

org.turro.financials.treasury.m303m.ModelSet.ModelSet ( int  exercise)

Definition at line 42 of file m303m/ModelSet.java.

42  {
43  this.exercise = exercise;
44  createEntries();
45  declaredMonth[0] = new DeclaredMonth(this, 1);
46  declaredMonth[1] = new DeclaredMonth(this, 2);
47  declaredMonth[2] = new DeclaredMonth(this, 3);
48  declaredMonth[3] = new DeclaredMonth(this, 4);
49  declaredMonth[4] = new DeclaredMonth(this, 5);
50  declaredMonth[5] = new DeclaredMonth(this, 6);
51  declaredMonth[6] = new DeclaredMonth(this, 7);
52  declaredMonth[7] = new DeclaredMonth(this, 8);
53  declaredMonth[8] = new DeclaredMonth(this, 9);
54  declaredMonth[9] = new DeclaredMonth(this, 10);
55  declaredMonth[10] = new DeclaredMonth(this, 11);
56  declaredMonth[11] = new DeclaredMonth(this, 12);
57  }

Member Function Documentation

◆ generateRegister()

void org.turro.financials.treasury.m303m.ModelSet.generateRegister ( int  month)

Definition at line 98 of file m303m/ModelSet.java.

98  {
99  RegisterGenerator reg = new RegisterGenerator();
100  RegisterView formalView = ViewWrapper.getFormalView();
101  reg.getRegister().setView(formalView);
102  reg.getRegister().setRegisterDate(getDeclaredMonth(month).getRegisterDate());
103 
104  double total = 0.0;
105 
106  for(ModelEntry me : this) {
107  Collection<VatEntry> vats = me.getMonth(month).getVatMap().values();
108  for(VatEntry ve : vats) {
109  Account acc = new Account();
110  acc.setId(ve.getAccount());
111  if(ve.getMonth().getEntry().getType().getBookId() == 2L) {
112  reg.addAccount(acc, "Mod. 303 M" + (month+1), ve.getToDeclareAmountVat(), 0.0);
113  total -= ve.getToDeclareAmountVat();
114  } else {
115  reg.addAccount(acc, "Mod. 303 M" + (month+1), 0.0, ve.getToDeclareAmountVat());
116  total += ve.getToDeclareAmountVat();
117  }
118  }
119  }
120 
121  if(total < 0) {
122  Account acc = new Account();
123  acc.setId(getDeclaredPositiveAccount());
124  reg.addAccount(acc, "Mod. 303 M" + (month+1), 0.0, -total);
125  } else {
126  Account acc = new Account();
127  acc.setId(getDeclaredNegativeAccount());
128  reg.addAccount(acc, "Mod. 303 M" + (month+1), total, 0.0);
129  }
130 
131  FinancialsMenu.showRegister(reg.getRegister());
132  }
Here is the call graph for this function:

◆ getDao()

Dao org.turro.financials.treasury.m303m.ModelSet.getDao ( )

Definition at line 91 of file m303m/ModelSet.java.

91  {
92  if(dao == null) {
93  dao = new FinancialsPU();
94  }
95  return dao;
96  }

◆ getDeclaredMonth()

DeclaredMonth org.turro.financials.treasury.m303m.ModelSet.getDeclaredMonth ( int  month)

Definition at line 87 of file m303m/ModelSet.java.

87  {
88  return declaredMonth[month];
89  }
Here is the caller graph for this function:

◆ getDeclaredNegativeAccount()

String org.turro.financials.treasury.m303m.ModelSet.getDeclaredNegativeAccount ( )

Definition at line 83 of file m303m/ModelSet.java.

83  {
84  return "4700000000";
85  }
Here is the caller graph for this function:

◆ getDeclaredPositiveAccount()

String org.turro.financials.treasury.m303m.ModelSet.getDeclaredPositiveAccount ( )

Definition at line 79 of file m303m/ModelSet.java.

79  {
80  return "4750000000";
81  }
Here is the caller graph for this function:

◆ getExercise()

int org.turro.financials.treasury.m303m.ModelSet.getExercise ( )

Definition at line 75 of file m303m/ModelSet.java.

75  {
76  return exercise;
77  }

◆ getTotalInputVat()

double org.turro.financials.treasury.m303m.ModelSet.getTotalInputVat ( int  month)

Definition at line 59 of file m303m/ModelSet.java.

59  {
60  double result = 0.0;
61  for(ModelEntry me : this) {
62  result += me.getMonth(month).getTotalInputVat();
63  }
64  return result;
65  }
Here is the call graph for this function:

◆ getTotalOutputVat()

double org.turro.financials.treasury.m303m.ModelSet.getTotalOutputVat ( int  month)

Definition at line 67 of file m303m/ModelSet.java.

67  {
68  double result = 0.0;
69  for(ModelEntry me : this) {
70  result += me.getMonth(month).getTotalOutputVat();
71  }
72  return result;
73  }
Here is the call graph for this function:

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