Se me olvido cambiar el nombre del modelo
This commit is contained in:
@@ -38,7 +38,6 @@ import danielcortes.xyz.models.efectivo.SQLiteEfectivoDAO;
|
||||
import danielcortes.xyz.models.egreso.EgresoDAO;
|
||||
import danielcortes.xyz.models.egreso.MysqlEgresoDAO;
|
||||
import danielcortes.xyz.models.egreso.SQLiteEgresoDAO;
|
||||
import danielcortes.xyz.models.informe.SQLiteInformeMensualContentDAO;
|
||||
import danielcortes.xyz.models.ingreso.IngresoDAO;
|
||||
import danielcortes.xyz.models.ingreso.MysqlIngresoDAO;
|
||||
import danielcortes.xyz.models.ingreso.SQLiteIngresoDAO;
|
||||
@@ -50,7 +49,6 @@ import danielcortes.xyz.models.tipo_ingreso.SQLiteTipoIngresoDAO;
|
||||
import danielcortes.xyz.models.tipo_ingreso.TipoIngresoDAO;
|
||||
import danielcortes.xyz.views.ManagerView;
|
||||
import javax.swing.*;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Main {
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
package danielcortes.xyz.informes;
|
||||
|
||||
import danielcortes.xyz.models.caja.SQLiteCajaDAO;
|
||||
import danielcortes.xyz.models.informe.InformeMensualContent;
|
||||
import danielcortes.xyz.models.informe.SQLiteInformeMensualContentDAO;
|
||||
import danielcortes.xyz.models.informe.InformeLibroDeVentasContent;
|
||||
import danielcortes.xyz.models.informe.SQLiteInformeLibroDeVentasContentDAO;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
@@ -65,7 +65,7 @@ public class InformeLibroDeVentas {
|
||||
|
||||
private final String[] dias = {"Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"};
|
||||
|
||||
private ArrayList<InformeMensualContent> informe;
|
||||
private ArrayList<InformeLibroDeVentasContent> informe;
|
||||
private int informeSize;
|
||||
private File saveFile;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class InformeLibroDeVentas {
|
||||
public InformeLibroDeVentas(LocalDate date, File saveFile) {
|
||||
new SQLiteCajaDAO().createCajasForMonth(date);
|
||||
|
||||
this.informe = new ArrayList<>(new SQLiteInformeMensualContentDAO().getInformeMensual(date));
|
||||
this.informe = new ArrayList<>(new SQLiteInformeLibroDeVentasContentDAO().getInformeMensual(date));
|
||||
this.informeSize = this.informe.size();
|
||||
this.saveFile = saveFile;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class InformeLibroDeVentas {
|
||||
}
|
||||
|
||||
private void sortInforme(){
|
||||
this.informe.sort(Comparator.comparing(InformeMensualContent::getFecha));
|
||||
this.informe.sort(Comparator.comparing(InformeLibroDeVentasContent::getFecha));
|
||||
}
|
||||
|
||||
private void fillHeaders() {
|
||||
@@ -108,7 +108,7 @@ public class InformeLibroDeVentas {
|
||||
private void fillData() {
|
||||
int x = 2;
|
||||
|
||||
for(InformeMensualContent data : this.informe){
|
||||
for(InformeLibroDeVentasContent data : this.informe){
|
||||
int y = 0;
|
||||
Row dataRow = sheet.createRow(x);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ package danielcortes.xyz.models.informe;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class InformeMensualContent {
|
||||
public class InformeLibroDeVentasContent {
|
||||
private int dia;
|
||||
private LocalDate fecha;
|
||||
private String manualesInicial;
|
||||
@@ -220,7 +220,7 @@ public class InformeMensualContent {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InformeMensualContent{" +
|
||||
return "InformeLibroDeVentasContent{" +
|
||||
"dia=" + dia +
|
||||
", fecha=" + fecha +
|
||||
", manualesInicial='" + manualesInicial + '\'' +
|
||||
@@ -27,11 +27,11 @@ package danielcortes.xyz.models.informe;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class InformeMensualContentDAO {
|
||||
public abstract class InformeLibroDeVentasContentDAO {
|
||||
/**
|
||||
* Genera el contenido del informe mensual
|
||||
* @param date fecha que esta dentro del mes en el que se necesita el informe
|
||||
* @return Lista con las columnas principales necesarias para el informe
|
||||
*/
|
||||
public abstract Collection<InformeMensualContent> getInformeMensual(LocalDate date);
|
||||
public abstract Collection<InformeLibroDeVentasContent> getInformeMensual(LocalDate date);
|
||||
}
|
||||
@@ -34,15 +34,15 @@ import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
public class SQLiteInformeMensualContentDAO extends InformeMensualContentDAO {
|
||||
private HashMap<Integer, InformeMensualContent> map;
|
||||
public class SQLiteInformeLibroDeVentasContentDAO extends InformeLibroDeVentasContentDAO {
|
||||
private HashMap<Integer, InformeLibroDeVentasContent> map;
|
||||
|
||||
public SQLiteInformeMensualContentDAO() {
|
||||
public SQLiteInformeLibroDeVentasContentDAO() {
|
||||
this.map = new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<InformeMensualContent> getInformeMensual(LocalDate date) {
|
||||
public Collection<InformeLibroDeVentasContent> getInformeMensual(LocalDate date) {
|
||||
try {
|
||||
Connection conn = new SQLiteConnectionHolder().getConnection();
|
||||
String queryTotales =
|
||||
@@ -96,7 +96,7 @@ public class SQLiteInformeMensualContentDAO extends InformeMensualContentDAO {
|
||||
|
||||
private void fillTotalesFromResultSet(ResultSet rs) throws SQLException {
|
||||
while (rs.next()) {
|
||||
InformeMensualContent informe = new InformeMensualContent();
|
||||
InformeLibroDeVentasContent informe = new InformeLibroDeVentasContent();
|
||||
informe.setDia(rs.getInt("dia"));
|
||||
informe.setFecha(LocalDate.parse(rs.getString("fecha")));
|
||||
informe.setManuales(rs.getInt("manuales"));
|
||||
@@ -113,7 +113,7 @@ public class SQLiteInformeMensualContentDAO extends InformeMensualContentDAO {
|
||||
private void fillBoletasFromResultSet(ResultSet rs) throws SQLException {
|
||||
Comparator<String> comparator = new NaturalOrderComparator();
|
||||
while (rs.next()) {
|
||||
InformeMensualContent informe = map.get(rs.getInt("caja"));
|
||||
InformeLibroDeVentasContent informe = map.get(rs.getInt("caja"));
|
||||
int tipoIngreso = rs.getInt("tipo_ingreso");
|
||||
switch (tipoIngreso) {
|
||||
case 1:
|
||||
Reference in New Issue
Block a user