Creado titulo en el informe
Esto es con el fin de identificar a que local pertence cuando sea impreso
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package danielcortes.xyz.informes;
|
||||
|
||||
import danielcortes.xyz.data.Configuration;
|
||||
import danielcortes.xyz.data.DAOManager;
|
||||
import danielcortes.xyz.models.estado_resultado.EstadoResultado;
|
||||
import danielcortes.xyz.models.tipo_egreso.TipoEgreso;
|
||||
import danielcortes.xyz.utils.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
@@ -13,10 +15,12 @@ import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class InformeEstadoResultado {
|
||||
private ArrayList<Row> titles;
|
||||
private ArrayList<Row> headers;
|
||||
private ArrayList<Row> footers;
|
||||
private ArrayList<Row> ventaRows;
|
||||
@@ -45,6 +49,7 @@ public class InformeEstadoResultado {
|
||||
this.sheet = wb.createSheet();
|
||||
this.createHelper = wb.getCreationHelper();
|
||||
|
||||
this.titles = new ArrayList<>();
|
||||
this.headers = new ArrayList<>();
|
||||
this.footers = new ArrayList<>();
|
||||
this.ventaRows = new ArrayList<>();
|
||||
@@ -56,6 +61,24 @@ public class InformeEstadoResultado {
|
||||
this.styles = this.generateStyles();
|
||||
}
|
||||
|
||||
private void fillTitle() {
|
||||
int startRow = 0;
|
||||
Row titleMes= this.sheet.createRow(startRow++);
|
||||
Row titleLocal = this.sheet.createRow(startRow++);
|
||||
|
||||
this.titles.add(titleMes);
|
||||
this.titles.add(titleLocal);
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM yyyy");
|
||||
String formatedMes= this.mes.format(formatter);
|
||||
|
||||
titleMes.createCell(0).setCellValue("Estado Resultado");
|
||||
titleMes.createCell(1).setCellValue(StringUtils.capitalize(formatedMes));
|
||||
|
||||
titleLocal.createCell(0).setCellValue("Local");
|
||||
titleLocal.createCell(1).setCellValue(StringUtils.capitalize(Configuration.get("nombre_caja")));
|
||||
}
|
||||
|
||||
private void fillVentaData() {
|
||||
int startId = 2;
|
||||
|
||||
@@ -368,6 +391,7 @@ public class InformeEstadoResultado {
|
||||
}
|
||||
|
||||
public void generarInforme() {
|
||||
fillTitle();
|
||||
fillVentaData();
|
||||
fillGastosOperacionalesData();
|
||||
fillServiciosData();
|
||||
|
||||
Reference in New Issue
Block a user