18 package org.turro.financials.treasury.m303;
20 import java.util.Collection;
21 import java.util.TreeSet;
22 import org.turro.financials.db.FinancialsPU;
23 import org.turro.financials.entity.Account;
24 import org.turro.financials.entity.RegisterView;
25 import org.turro.financials.menu.FinancialsMenu;
26 import org.turro.financials.model.register.RegisterGenerator;
27 import org.turro.financials.model.register.ViewWrapper;
28 import org.turro.jpa.Dao;
34 public class ModelSet extends TreeSet<ModelEntry> {
41 this.exercise = exercise;
78 return declaredQuarter[quarter];
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();
105 reg.
addAccount(acc,
"Mod. 303 Q" + (quarter+1), 0.0, ve.getToDeclareAmountVat());
106 total += ve.getToDeclareAmountVat();
114 reg.
addAccount(acc,
"Mod. 303 Q" + (quarter+1), 0.0, -total);
118 reg.
addAccount(acc,
"Mod. 303 Q" + (quarter+1), total, 0.0);
124 private void createEntries() {
128 for(ModelEntry me :
this) {
129 for(
int quarter = 0; quarter < 4; quarter++) {
130 for(VatEntry ve : me.getQuarter(quarter).getVatMap().values()) {
132 VatEntry prev = me.getQuarter(quarter - 1).getVatMap().get((
int) ve.getVat() * 10);
134 ve.setPendingVat(prev.getDeclaredVat() - prev.getAmountVat() + prev.getPendingVat());
137 me.getQuarter(quarter).addToDeclareOp(ve.getToDeclareAmountOp());
138 me.getQuarter(quarter).addToDeclareVat(ve.getToDeclareAmountVat());
void setView(RegisterView view)
void setRegisterDate(Date registerDate)
void addAccount(Account account, String concept, double balance)
static RegisterView getFormalView()
double getTotalOutputVat()
Map< Integer, VatEntry > getVatMap()
double getTotalInputVat()
EntryQuarter getQuarter(int index)
String getDeclaredNegativeAccount()
DeclaredQuarter getDeclaredQuarter(int quarter)
double getTotalInputVat(int quarter)
double getTotalOutputVat(int quarter)
void generateRegister(int quarter)
String getDeclaredPositiveAccount()