El libro de ventas no estaba generando los totales

Se debio a una confusion con las clases,originalmente pensaba contener
los totales en la clase LibroDeVentas pero como prefia mantener ese dato
como una formula en excel lo obvie, despues al momento de crear el
importe a excel, vi el metodo get total y se me olvido por completo que
debia ser una formula.

Cosas pasaron, pero ahora esta bien
This commit is contained in:
Daniel Cortés
2019-03-25 00:03:42 -03:00
parent b525a92f86
commit 5a46dde8e5
4 changed files with 7 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ import java.time.YearMonth;
import java.util.HashMap;
public class InformeLibroDeVentas{
HashMap<LocalDate, LibroDeVentas> informe;
private HashMap<LocalDate, LibroDeVentas> informe;
private InformeLibroDeVentas(){}
public LibroDeVentas get(LocalDate localDate){
@@ -26,7 +26,6 @@ public class InformeLibroDeVentas{
this.informe.put(date, libroDeVentas);
}
public static InformeLibroDeVentas generate(YearMonth mes) {
InformeLibroDeVentas informeLibroDeVentas = new InformeLibroDeVentas();
informeLibroDeVentas.informe = new HashMap<>();

View File

@@ -157,7 +157,8 @@ public class InformeLibroDeVentasToExcel {
dataRow.createCell(cellCounter++).setCellValue(data.getExentas());
dataRow.createCell(cellCounter++).setCellFormula(
"E" + (rowCounter + 1) + "+J" + (rowCounter + 1) + "+M" + (rowCounter + 1));
"E" + (rowCounter + 1) + "+J" + (rowCounter + 1) + "+M" + (rowCounter + 1)
);
dataRow.createCell(cellCounter++)
.setCellValue(data.getFacturasInicial() == null ? "0" : data.getFacturasInicial());
@@ -171,7 +172,10 @@ public class InformeLibroDeVentasToExcel {
.setCellValue(data.getGuiasFinal() == null ? "0" : data.getGuiasFinal());
dataRow.createCell(cellCounter++).setCellValue(data.getGuias());
dataRow.createCell(cellCounter++).setCellValue(data.getTotal());
dataRow.createCell(cellCounter++).setCellFormula(
"E" + (rowCounter + 1) + "+J" + (rowCounter + 1) + "+M" + (rowCounter + 1) + "+Q" +
(rowCounter + 1) + "+T" + (rowCounter + 1)
);
if (rowCounter == 2) {
dataRow.createCell(cellCounter).setCellFormula(("U" + (rowCounter + 1)));

View File

@@ -71,7 +71,6 @@ public class LibroDeVentas {
private String guiasInicial;
private String guiasFinal;
private int guias;
private int total;
public int getDia() {
return dia;
@@ -225,14 +224,6 @@ public class LibroDeVentas {
this.guias = guias;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
@Override
public String toString() {
return "LibroDeVentas{" +
@@ -255,7 +246,6 @@ public class LibroDeVentas {
", guiasInicial='" + guiasInicial + '\'' +
", guiasFinal='" + guiasFinal + '\'' +
", guias=" + guias +
", total=" + total +
'}';
}
}