19 package org.turro.financials.treasury.m303m;
21 import java.util.Collection;
22 import java.util.TreeSet;
23 import org.turro.financials.db.FinancialsPU;
24 import org.turro.financials.entity.Account;
25 import org.turro.financials.entity.RegisterView;
26 import org.turro.financials.menu.FinancialsMenu;
27 import org.turro.financials.model.register.RegisterGenerator;
28 import org.turro.financials.model.register.ViewWrapper;
29 import org.turro.financials.treasury.m303.ModelType;
30 import org.turro.jpa.Dao;
36 public class ModelSet extends TreeSet<ModelEntry> {
43 this.exercise = exercise;
88 return declaredMonth[month];
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();
115 reg.
addAccount(acc,
"Mod. 303 M" + (month+1), 0.0, ve.getToDeclareAmountVat());
116 total += ve.getToDeclareAmountVat();
124 reg.
addAccount(acc,
"Mod. 303 M" + (month+1), 0.0, -total);
128 reg.
addAccount(acc,
"Mod. 303 M" + (month+1), total, 0.0);
134 private void createEntries() {
138 for(ModelEntry me :
this) {
139 for(
int month = 0; month < 12; month++) {
140 for(VatEntry ve : me.getMonth(month).getVatMap().values()) {
142 VatEntry prev = me.getMonth(month - 1).getVatMap().get((
int) ve.getVat() * 10);
144 ve.setPendingVat(prev.getDeclaredVat() - prev.getAmountVat() + prev.getPendingVat());
147 me.getMonth(month).addToDeclareOp(ve.getToDeclareAmountOp());
148 me.getMonth(month).addToDeclareVat(ve.getToDeclareAmountVat());
void setView(RegisterView view)
void setRegisterDate(Date registerDate)
void addAccount(Account account, String concept, double balance)
static RegisterView getFormalView()
double getTotalInputVat()
double getTotalOutputVat()
Map< Integer, VatEntry > getVatMap()
EntryMonth getMonth(int index)
double getTotalInputVat(int month)
String getDeclaredNegativeAccount()
DeclaredMonth getDeclaredMonth(int month)
double getTotalOutputVat(int month)
String getDeclaredPositiveAccount()
void generateRegister(int month)