diff --git a/dist/Programa Caja.jar b/dist/Programa Caja.jar index c434697..5c6f002 100644 Binary files a/dist/Programa Caja.jar and b/dist/Programa Caja.jar differ diff --git a/src/danielcortes/xyz/informes/InformeEgresosToExcel.java b/src/danielcortes/xyz/informes/InformeEgresosToExcel.java index 05e6b7c..9c09602 100644 --- a/src/danielcortes/xyz/informes/InformeEgresosToExcel.java +++ b/src/danielcortes/xyz/informes/InformeEgresosToExcel.java @@ -106,8 +106,9 @@ public class InformeEgresosToExcel { Row totalRow = sheet.createRow(currentRow++); totalRows.add(totalRow); totalRow.createCell(2).setCellValue("TOTAL DIARIO"); - totalRow.createCell(3) - .setCellFormula("SUM(D" + (firstRow + 1) + ":D" + (lastRow + 1) + ")"); + totalRow.createCell(3).setCellFormula( + String.format("SUM(D%s:D%s)", firstRow + 1, lastRow + 1) + ); } currentDay = currentDay.plusDays(1); @@ -115,9 +116,12 @@ public class InformeEgresosToExcel { } private void fillTotales() { - String operation = totalRows.stream().map(row -> "D" + (row.getRowNum() + 1)) - .reduce((a, b) -> String.join("+", a, b)).get(); - this.totalFinal = sheet.createRow(this.dataRows.get(this.dataRows.size()-1).getRowNum() + 2); + String operation = totalRows + .stream() + .map(row -> "D" + (row.getRowNum() + 1)) + .reduce((a, b) -> String.join("+", a, b)) + .get(); + this.totalFinal = sheet.createRow(this.dataRows.get(this.dataRows.size() - 1).getRowNum() + 2); this.totalFinal.createCell(2).setCellValue("TOTAL MENSUAL"); this.totalFinal.createCell(3).setCellFormula(operation); diff --git a/src/danielcortes/xyz/informes/InformeLibroDeVentasToExcel.java b/src/danielcortes/xyz/informes/InformeLibroDeVentasToExcel.java index 3275bce..35aea4c 100644 --- a/src/danielcortes/xyz/informes/InformeLibroDeVentasToExcel.java +++ b/src/danielcortes/xyz/informes/InformeLibroDeVentasToExcel.java @@ -110,54 +110,44 @@ public class InformeLibroDeVentasToExcel { dataRow.createCell(cellCounter++).setCellValue(this.dias[data.getDia() - 1]); dataRow.createCell(cellCounter++).setCellValue(fecha); - dataRow.createCell(cellCounter++) - .setCellValue(data.getManualesInicial() == null ? "0" : data.getManualesInicial()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getManualesFinal() == null ? "0" : data.getManualesFinal()); + dataRow.createCell(cellCounter++).setCellValue(data.getManualesInicial() == null ? "0" : data.getManualesInicial()); + dataRow.createCell(cellCounter++).setCellValue(data.getManualesFinal() == null ? "0" : data.getManualesFinal()); dataRow.createCell(cellCounter++).setCellValue(data.getManuales()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getFiscalesZInicial() == null ? "0" : data.getFiscalesZInicial()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getFiscalesZFinal() == null ? "0" : data.getFiscalesZFinal()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getFiscalesInicial() == null ? "0" : data.getFiscalesInicial()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getFiscalesFinal() == null ? "0" : data.getFiscalesFinal()); + dataRow.createCell(cellCounter++).setCellValue(data.getFiscalesZInicial() == null ? "0" : data.getFiscalesZInicial()); + dataRow.createCell(cellCounter++).setCellValue(data.getFiscalesZFinal() == null ? "0" : data.getFiscalesZFinal()); + dataRow.createCell(cellCounter++).setCellValue(data.getFiscalesInicial() == null ? "0" : data.getFiscalesInicial()); + dataRow.createCell(cellCounter++).setCellValue(data.getFiscalesFinal() == null ? "0" : data.getFiscalesFinal()); dataRow.createCell(cellCounter++).setCellValue(data.getFiscales()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getExentasInicial() == null ? "0" : data.getExentasInicial()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getExentasFinal() == null ? "0" : data.getExentasFinal()); + dataRow.createCell(cellCounter++).setCellValue(data.getExentasInicial() == null ? "0" : data.getExentasInicial()); + dataRow.createCell(cellCounter++).setCellValue(data.getExentasFinal() == null ? "0" : data.getExentasFinal()); dataRow.createCell(cellCounter++).setCellValue(data.getExentas()); dataRow.createCell(cellCounter++).setCellFormula( - "E" + (rowCounter + 1) + "+J" + (rowCounter + 1) + "+M" + (rowCounter + 1) + String.format("E%s+J%s+M%s", rowCounter + 1, rowCounter + 1, rowCounter + 1) ); - dataRow.createCell(cellCounter++) - .setCellValue(data.getFacturasInicial() == null ? "0" : data.getFacturasInicial()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getFacturasFinal() == null ? "0" : data.getFacturasFinal()); + dataRow.createCell(cellCounter++).setCellValue(data.getFacturasInicial() == null ? "0" : data.getFacturasInicial()); + dataRow.createCell(cellCounter++).setCellValue(data.getFacturasFinal() == null ? "0" : data.getFacturasFinal()); dataRow.createCell(cellCounter++).setCellValue(data.getFacturas()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getGuiasInicial() == null ? "0" : data.getGuiasInicial()); - dataRow.createCell(cellCounter++) - .setCellValue(data.getGuiasFinal() == null ? "0" : data.getGuiasFinal()); + dataRow.createCell(cellCounter++).setCellValue(data.getGuiasInicial() == null ? "0" : data.getGuiasInicial()); + dataRow.createCell(cellCounter++).setCellValue(data.getGuiasFinal() == null ? "0" : data.getGuiasFinal()); dataRow.createCell(cellCounter++).setCellValue(data.getGuias()); dataRow.createCell(cellCounter++).setCellFormula( - "E" + (rowCounter + 1) + "+J" + (rowCounter + 1) + "+M" + (rowCounter + 1) + "+Q" + - (rowCounter + 1) + "+T" + (rowCounter + 1) + String.format("E%s+J%s+M%s+Q%s+T%s", rowCounter + 1, rowCounter + 1, rowCounter + 1, rowCounter + 1, rowCounter + 1) ); if (rowCounter == 2) { - dataRow.createCell(cellCounter++).setCellFormula(("U" + (rowCounter + 1))); + dataRow.createCell(cellCounter++).setCellFormula( + String.format("U%s", rowCounter + 1) + ); } else { - dataRow.createCell(cellCounter++) - .setCellFormula(("U" + (rowCounter + 1)) + ("+") + ("V" + (rowCounter))); + dataRow.createCell(cellCounter++).setCellFormula( + String.format("U%s+V%s", rowCounter + 1, rowCounter) + ); } dataRow.createCell(cellCounter).setCellFormula(