Corregir bugs y aniadir la opcion de eliminar transacciones
This commit is contained in:
@@ -6,7 +6,6 @@ import java.util.ArrayList;
|
||||
public class Meses {
|
||||
private ArrayList<Mes> meses;
|
||||
private int mesActual=0;
|
||||
|
||||
public Meses() {
|
||||
this.meses = new ArrayList<Mes>();
|
||||
}
|
||||
@@ -57,19 +56,21 @@ private ArrayList<Mes> meses;
|
||||
}
|
||||
this.meses.add(new Mes(new ArrayList<Gestion>(), anio, mes));
|
||||
this.mesActual = this.meses.size()-1;
|
||||
System.out.println(this.meses.size()-1);
|
||||
}
|
||||
|
||||
public ArrayList<Gestion> getGestionesActuales(){
|
||||
return this.meses.get(this.mesActual).getGestiones();
|
||||
}
|
||||
|
||||
public float getTotal() {
|
||||
return this.meses.get(this.mesActual).getTotal();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Mes{
|
||||
private int anio;
|
||||
private Month mes;
|
||||
int total;
|
||||
ArrayList<Gestion> gestiones;
|
||||
Mes(ArrayList<Gestion> gestiones, int anio, Month mes){
|
||||
this.gestiones = gestiones;
|
||||
@@ -101,4 +102,12 @@ class Mes{
|
||||
return this.gestiones;
|
||||
}
|
||||
|
||||
float getTotal() {
|
||||
float ret = 0;
|
||||
for(Gestion gestion:this.gestiones) {
|
||||
ret += gestion.getTotal();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user