changes

parent 6130fe83
...@@ -6,3 +6,4 @@ nbbuild/ ...@@ -6,3 +6,4 @@ nbbuild/
dist/ dist/
nbdist/ nbdist/
.nb-gradle/ .nb-gradle/
/target/
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
<exec.mainClass>com.mycompany.reporteexcel.panel</exec.mainClass> <exec.mainClass>com.mycompany.reporteexcel.panel</exec.mainClass>
</properties> </properties>
<dependencies> <dependencies>
......
...@@ -182,26 +182,30 @@ public class ExcelService { ...@@ -182,26 +182,30 @@ public class ExcelService {
public void setCellFormat(XSSFCell cell, String format, String value) { public void setCellFormat(XSSFCell cell, String format, String value) {
switch (format) { switch (format) {
case "number" -> { case "number":
cell.setCellType(CellType.NUMERIC); cell.setCellType(CellType.NUMERIC);
XSSFCellStyle style = cell.getCellStyle(); XSSFCellStyle style = cell.getCellStyle();
DataFormat dataFormat = cell.getSheet().getWorkbook().createDataFormat(); DataFormat dataFormat = cell.getSheet().getWorkbook().createDataFormat();
style.setDataFormat(dataFormat.getFormat("0.00")); style.setDataFormat(dataFormat.getFormat("0.00"));
cell.setCellStyle(style); cell.setCellStyle(style);
cell.setCellValue(Double.parseDouble(value)); cell.setCellValue(Double.parseDouble(value));
} ;
case "date" -> { break;
case "date":
cell.setCellType(CellType.NUMERIC); cell.setCellType(CellType.NUMERIC);
cell.setCellValue(value); cell.setCellValue(value);
} ;
case "formula" -> { break;
case "formula":
cell.setCellType(CellType.FORMULA); cell.setCellType(CellType.FORMULA);
cell.setCellFormula(value); cell.setCellFormula(value);
} ;
default -> { break;
default:
cell.setCellType(CellType.STRING); cell.setCellType(CellType.STRING);
cell.setCellValue(value); cell.setCellValue(value);
} ;
break;
} }
} }
......
...@@ -328,57 +328,57 @@ public class panel extends javax.swing.JFrame { ...@@ -328,57 +328,57 @@ public class panel extends javax.swing.JFrame {
final int empresaInt; final int empresaInt;
switch (empresaValue) { switch (empresaValue) {
case "FRANQUICIA" -> case "FRANQUICIA" :
empresaInt = 2571; empresaInt = 2571;break;
case "SEDE" -> case "SEDE":
empresaInt = 2572; empresaInt = 2572;break;
default -> default :
empresaInt = 0; empresaInt = 0;break;
} }
String razonSocialValue = razonSocial.getSelectedItem().toString(); String razonSocialValue = razonSocial.getSelectedItem().toString();
final int razonSocialInt; final int razonSocialInt;
switch (razonSocialValue) { switch (razonSocialValue) {
case "MARSHAL" -> case "MARSHAL":
razonSocialInt = 5455; razonSocialInt = 5455;break;
case "AVANTE" -> case "AVANTE":
razonSocialInt = 5458; razonSocialInt = 5458;break;
case "ESCOBAR" -> case "ESCOBAR":
razonSocialInt = 5459; razonSocialInt = 5459;break;
case "JOEL JAICO" -> case "JOEL JAICO":
razonSocialInt = 5461; razonSocialInt = 5461;break;
case "PAVENT SCHOLL" -> case "PAVENT SCHOLL":
razonSocialInt = 5463; razonSocialInt = 5463;break;
case "HERSURA" -> case "HERSURA":
razonSocialInt = 5464; razonSocialInt = 5464;break;
case "ROBERT RIVERA" -> case "ROBERT RIVERA":
razonSocialInt = 5466; razonSocialInt = 5466;break;
case "SACO OLIVEROS HUAYCAN" -> case "SACO OLIVEROS HUAYCAN":
razonSocialInt = 7034; razonSocialInt = 7034;break;
case "CAJAMARCA" -> case "CAJAMARCA":
razonSocialInt = 7371; razonSocialInt = 7371;break;
case "OLIVER SCHOOL" -> case "OLIVER SCHOOL":
razonSocialInt = 7395; razonSocialInt = 7395;break;
case "COLEGIO SACO OLIVEROS PRO S.A.C." -> case "COLEGIO SACO OLIVEROS PRO S.A.C.":
razonSocialInt = 7435; razonSocialInt = 7435;break;
case "ASOCIACIÓN WESLEY" -> case "ASOCIACIÓN WESLEY":
razonSocialInt = 7440; razonSocialInt = 7440;break;
case "GRUPO EDUCA LIMA S.A.C." -> case "GRUPO EDUCA LIMA S.A.C.":
razonSocialInt = 7449; razonSocialInt = 7449;break;
case "GAMANSA EDUCADORES SRL" -> case "GAMANSA EDUCADORES SRL":
razonSocialInt = 7472; razonSocialInt = 7472;break;
case "ASOCIACION EDUCATIVA FAROVI" -> case "ASOCIACION EDUCATIVA FAROVI":
razonSocialInt = 8706; razonSocialInt = 8706;break;
case "SACO OLIVEROS" -> case "SACO OLIVEROS":
razonSocialInt = 1; razonSocialInt = 1;break;
case "APEIRON" -> case "APEIRON":
razonSocialInt = 2; razonSocialInt = 2;break;
case "SISTEMA HELICOIDAL" -> case "SISTEMA HELICOIDAL":
razonSocialInt = 3; razonSocialInt = 3;break;
case "SOCIEDAD SACO OLIVEROS S.A.C." -> case "SOCIEDAD SACO OLIVEROS S.A.C.":
razonSocialInt = 6796; razonSocialInt = 6796;break;
default -> default:
razonSocialInt = 0; razonSocialInt = 0;break;
} }
String periodoValue = periodo.getSelectedItem().toString(); String periodoValue = periodo.getSelectedItem().toString();
...@@ -433,7 +433,7 @@ public class panel extends javax.swing.JFrame { ...@@ -433,7 +433,7 @@ public class panel extends javax.swing.JFrame {
mensaje.setText("Obteniendo información..."); mensaje.setText("Obteniendo información...");
}); });
var obj = api.conseguirDataReporte(empresaInt, razonSocialInt, periodoInt.get(), fecha, conceptoPago); JSONObject obj = api.conseguirDataReporte(empresaInt, razonSocialInt, periodoInt.get(), fecha, conceptoPago);
SwingUtilities.invokeLater(() -> mensaje.setText("Generando Excel...")); SwingUtilities.invokeLater(() -> mensaje.setText("Generando Excel..."));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment