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

Public Member Functions

 ModelSet (int exercise)
 
double getTotalInputVat (int quarter)
 
double getTotalOutputVat (int quarter)
 
int getExercise ()
 
String getDeclaredPositiveAccount ()
 
String getDeclaredNegativeAccount ()
 
DeclaredQuarter getDeclaredQuarter (int quarter)
 
Dao getDao ()
 
void generateRegister (int quarter)
 

Detailed Description

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

Definition at line 34 of file m303/ModelSet.java.

Constructor & Destructor Documentation

◆ ModelSet()

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

Definition at line 40 of file m303/ModelSet.java.

40  {
41  this.exercise = exercise;
42  createEntries();
43  declaredQuarter[0] = new DeclaredQuarter(this, 1);
44  declaredQuarter[1] = new DeclaredQuarter(this, 2);
45  declaredQuarter[2] = new DeclaredQuarter(this, 3);
46  declaredQuarter[3] = new DeclaredQuarter(this, 4);
47  }

Member Function Documentation

◆ generateRegister()

void org.turro.financials.treasury.m303.ModelSet.generateRegister ( int  quarter)

Definition at line 88 of file m303/ModelSet.java.

88  {
89  RegisterGenerator reg = new RegisterGenerator();
90  RegisterView formalView = ViewWrapper.getFormalView();
91  reg.getRegister().setView(formalView);
92  reg.getRegister().setRegisterDate(getDeclaredQuarter(quarter).getRegisterDate());
93 
94  double total = 0.0;
95 
96  for(ModelEntry me : this) {
97  Collection<VatEntry> vats = me.getQuarter(quarter).getVatMap().values();
98  for(VatEntry ve : vats) {
99  Account acc = new Account();
100  acc.setId(ve.getAccount());
101  if(ve.getQuarter().getEntry().getType().getBookId() == 2L) {
102  reg.addAccount(acc, "Mod. 303 Q" + (quarter+1), ve.getToDeclareAmountVat(), 0.0);
103  total -= ve.getToDeclareAmountVat();
104  } else {
105  reg.addAccount(acc, "Mod. 303 Q" + (quarter+1), 0.0, ve.getToDeclareAmountVat());
106  total += ve.getToDeclareAmountVat();
107  }
108  }
109  }
110 
111  if(total < 0) {
112  Account acc = new Account();
113  acc.setId(getDeclaredPositiveAccount());
114  reg.addAccount(acc, "Mod. 303 Q" + (quarter+1), 0.0, -total);
115  } else {
116  Account acc = new Account();
117  acc.setId(getDeclaredNegativeAccount());
118  reg.addAccount(acc, "Mod. 303 Q" + (quarter+1), total, 0.0);
119  }
120 
121  FinancialsMenu.showRegister(reg.getRegister());
122  }
DeclaredQuarter getDeclaredQuarter(int quarter)
Here is the call graph for this function:

◆ getDao()

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

Definition at line 81 of file m303/ModelSet.java.

81  {
82  if(dao == null) {
83  dao = new FinancialsPU();
84  }
85  return dao;
86  }

◆ getDeclaredNegativeAccount()

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

Definition at line 73 of file m303/ModelSet.java.

73  {
74  return "4700000000";
75  }
Here is the caller graph for this function:

◆ getDeclaredPositiveAccount()

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

Definition at line 69 of file m303/ModelSet.java.

69  {
70  return "4750000000";
71  }
Here is the caller graph for this function:

◆ getDeclaredQuarter()

DeclaredQuarter org.turro.financials.treasury.m303.ModelSet.getDeclaredQuarter ( int  quarter)

Definition at line 77 of file m303/ModelSet.java.

77  {
78  return declaredQuarter[quarter];
79  }
Here is the caller graph for this function:

◆ getExercise()

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

Definition at line 65 of file m303/ModelSet.java.

65  {
66  return exercise;
67  }

◆ getTotalInputVat()

double org.turro.financials.treasury.m303.ModelSet.getTotalInputVat ( int  quarter)

Definition at line 49 of file m303/ModelSet.java.

49  {
50  double result = 0.0;
51  for(ModelEntry me : this) {
52  result += me.getQuarter(quarter).getTotalInputVat();
53  }
54  return result;
55  }
Here is the call graph for this function:

◆ getTotalOutputVat()

double org.turro.financials.treasury.m303.ModelSet.getTotalOutputVat ( int  quarter)

Definition at line 57 of file m303/ModelSet.java.

57  {
58  double result = 0.0;
59  for(ModelEntry me : this) {
60  result += me.getQuarter(quarter).getTotalOutputVat();
61  }
62  return result;
63  }
Here is the call graph for this function:

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