Se a cambiado la organizacion de las ventanas y se creo la vista de estado resultado junto con su modelo

This commit is contained in:
Daniel Cortes
2019-02-15 19:24:32 -03:00
parent 6388285108
commit ea5bccdaba
21 changed files with 2307 additions and 21 deletions

View File

@@ -142,3 +142,28 @@ create table calculo_fondo
caja_id integer not null,
foreign key (caja_id) references caja (id) on update cascade on delete restrict
);
-- Quinta migracion, tabla para generar y guardar el estado de resultado
drop table if exists estado_resultado;
create table estado_resultado
(
id integer primary key,
mes date unique not null,
costo_venta integer null,
cuenta_corriente_factura integer null,
cuenta_corriente_boleta integer null,
cuenta_corriente_sin_respaldo integer null,
remuneraciones integer null,
finiquitos integer null,
aguinaldo integer null,
bonos_personal integer null,
honorarios_contador integer null,
arriendo integer null,
agua integer null,
luz integer null,
gas integer null,
telefono integer null,
otro_servicio integer null,
ppm real null,
ivaFavor int null
);

Binary file not shown.

View File

@@ -0,0 +1,281 @@
package danielcortes.xyz.controllers;
import danielcortes.xyz.data.DAOManager;
import danielcortes.xyz.models.estado_resultado.EstadoResultado;
import danielcortes.xyz.models.estado_resultado.EstadoResultadoDAO;
import danielcortes.xyz.models.tipo_egreso.TipoEgreso;
import danielcortes.xyz.views.EstadoResultadoView;
import danielcortes.xyz.views.listeners.FocusLostListener;
import java.time.YearMonth;
public class EstadoResultadoController {
private EstadoResultadoView view;
private EstadoResultado estadoResultado;
private YearMonth mes;
public EstadoResultadoController(EstadoResultadoView view) {
this.view = view;
this.setupViewEvents();
this.updateMonth();
}
private void setupViewEvents() {
this.view.getMonthCombo().addActionListener(e -> this.updateMonth());
this.view.getYearSpinner().addChangeListener(e -> this.updateMonth());
this.view.getGastosGeneralesCuentaCorrienteFactura().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosGenerales());
this.view.getGastosGeneralesCuentaCorrienteBoleta().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosGenerales());
this.view.getGastosGeneralesCuentaCorrienteSinRespaldo().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosGenerales());
this.view.getServiciosAgua().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateServicios());
this.view.getServiciosLuz().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateServicios());
this.view.getServiciosGas().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateServicios());
this.view.getServiciosTelefono().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateServicios());
this.view.getServiciosOtro().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateServicios());
this.view.getGastosOperacionalesCostoVenta().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosOperacionales());
this.view.getGastosOperacionalesRemuneraciones().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosOperacionales());
this.view.getGastosOperacionalesFiniquitos().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosOperacionales());
this.view.getGastosOperacionalesAguinaldo().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosOperacionales());
this.view.getGastosOperacionalesBonos().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosOperacionales());
this.view.getGastosOperacionalesHonorariosContador().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosOperacionales());
this.view.getGastosOperacionalesArriendo().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateGastosOperacionales());
this.view.getResumenIVAFavor().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateResumen());
this.view.getResumenPPM().addFocusListener((FocusLostListener) e -> EstadoResultadoController.this.updateResumen());
this.view.getGuardarButton().addActionListener(e -> EstadoResultadoController.this.guardarListener());
}
private void guardarListener() {
EstadoResultadoDAO dao = DAOManager.getEstadoResultadoDAO();
dao.updateEstadoResultado(this.estadoResultado);
}
private void updateMonth() {
this.mes = this.view.getMonth();
this.estadoResultado = DAOManager.getEstadoResultadoDAO().findByMonth(this.mes);
if (estadoResultado == null) {
this.estadoResultado = EstadoResultado.emptyEstadoResultado;
this.estadoResultado.setMes(this.mes);
DAOManager.getEstadoResultadoDAO().insertEstadoResultado(estadoResultado);
}
this.fillVentas();
this.fillGastosGenerales();
this.fillServicios();
this.fillGastosOperacionales();
this.fillResumen();
}
private void fillVentas() {
int ventaBruta = DAOManager.getIngresoDAO().getTotalIngresoMes(this.mes);
int ventaExentas = DAOManager.getIngresoDAO().getTotalExentasMes(this.mes);
int ventaIVA = (int) Math.round((double) ventaBruta * .19d);
int ventaNeta = ventaBruta - ventaIVA;
int ventaNetaYExentas = ventaExentas + ventaNeta;
this.view.getVentaBrutaField().setValue(ventaBruta);
this.view.getVentaIVAField().setValue(ventaIVA);
this.view.getVentaNetaField().setValue(ventaNeta);
this.view.getVentaExentasField().setValue(ventaExentas);
this.view.getVentasNetaExentasField().setValue(ventaNetaYExentas);
}
private void fillGastosGenerales() {
TipoEgreso facturaMateriaPrima = DAOManager.getTipoEgresoDAO().findByNombre("Factura Materia Prima").get(0);
TipoEgreso facturaGastosGenerales = DAOManager.getTipoEgresoDAO().findByNombre("Factura Gastos Generales").get(0);
TipoEgreso gastoGeneralConBoleta = DAOManager.getTipoEgresoDAO().findByNombre("Gasto General Con Boleta").get(0);
TipoEgreso gastoMenorMateriaPrima = DAOManager.getTipoEgresoDAO().findByNombre("Gasto Menor Materia Prima").get(0);
TipoEgreso gastoGeneralSinRespaldo = DAOManager.getTipoEgresoDAO().findByNombre("Gasto General Sin Respaldo").get(0);
int cuentaCorrienteFactura = this.estadoResultado.getCuentaCorrienteFactura();
int cuentaCorrienteBoleta = this.estadoResultado.getCuentaCorrienteBoleta();
int cuentaCorrienteSinRespaldo = this.estadoResultado.getCuentaCorrienteSinRespaldo();
int efectivoFacturaMateriaPrima = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, facturaMateriaPrima);
int efectivoFacturaGastosGenerales = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, facturaGastosGenerales);
int efectivoGastoGeneralConBoleta = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, gastoGeneralConBoleta);
int efectivoGastoMenorMateriaPrima = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, gastoMenorMateriaPrima);
int efectivoGastoGeneralSinRespaldo = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, gastoGeneralSinRespaldo);
int gastoTotal = efectivoFacturaMateriaPrima + efectivoFacturaGastosGenerales + efectivoGastoGeneralConBoleta + efectivoGastoMenorMateriaPrima + efectivoGastoGeneralSinRespaldo + cuentaCorrienteBoleta + cuentaCorrienteFactura + cuentaCorrienteSinRespaldo;
this.view.getGastosGeneralesEfectivoFacturaField().setValue(efectivoFacturaGastosGenerales + efectivoFacturaMateriaPrima);
this.view.getGastosGeneralesEfectivoBoletaField().setValue(efectivoGastoGeneralConBoleta + efectivoGastoMenorMateriaPrima);
this.view.getGastosGeneralesEfectivoSinRespaldo().setValue(efectivoGastoGeneralSinRespaldo);
this.view.getGastosGeneralesCuentaCorrienteFactura().setValue(cuentaCorrienteFactura);
this.view.getGastosGeneralesCuentaCorrienteBoleta().setValue(cuentaCorrienteBoleta);
this.view.getGastosGeneralesCuentaCorrienteSinRespaldo().setValue(cuentaCorrienteSinRespaldo);
this.view.getGastosGeneralesTotal().setValue(gastoTotal);
}
private void fillGastosOperacionales() {
TipoEgreso tipoPagoPartime = DAOManager.getTipoEgresoDAO().findByNombre("Pago Partime").get(0);
int costosVenta = this.estadoResultado.getCostoVenta();
int remuneraciones = this.estadoResultado.getRemuneraciones();
int finiquitos = this.estadoResultado.getFiniquitos();
int aguinaldo = this.estadoResultado.getAguinaldo();
int bonosPersonal = this.estadoResultado.getBonosPersonal();
int honorariosContador = this.estadoResultado.getHonorariosContador();
int arriendo = this.estadoResultado.getArriendo();
int partime = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, tipoPagoPartime);
int total = costosVenta + remuneraciones + finiquitos + aguinaldo + bonosPersonal
+ honorariosContador + arriendo + partime;
this.view.getGastosOperacionalesCostoVenta().setValue(costosVenta);
this.view.getGastosOperacionalesRemuneraciones().setValue(remuneraciones);
this.view.getGastosOperacionalesFiniquitos().setValue(finiquitos);
this.view.getGastosOperacionalesAguinaldo().setValue(aguinaldo);
this.view.getGastosOperacionalesBonos().setValue(bonosPersonal);
this.view.getGastosOperacionalesHonorariosContador().setValue(honorariosContador);
this.view.getGastosOperacionalesArriendo().setValue(arriendo);
this.view.getGastosOperacionalesPartime().setValue(partime);
this.view.getGastosOperacionalesTotal().setValue(total);
}
private void fillServicios() {
int agua = this.estadoResultado.getAgua();
int luz = this.estadoResultado.getLuz();
int gas = this.estadoResultado.getGas();
int telefono = this.estadoResultado.getTelefono();
int otro = this.estadoResultado.getOtroServicio();
int total = agua + luz + gas + telefono + otro;
this.view.getServiciosAgua().setValue(agua);
this.view.getServiciosLuz().setValue(luz);
this.view.getServiciosGas().setValue(gas);
this.view.getServiciosTelefono().setValue(telefono);
this.view.getServiciosOtro().setValue(telefono);
this.view.getServiciosTotal().setValue(total);
}
private void fillResumen() {
double ppm = this.estadoResultado.getPpm();
int aFavor = this.estadoResultado.getIvaFavor();
this.view.getResumenPPM().setValue(ppm);
this.view.getResumenIVAFavor().setValue(aFavor);
this.updateResumen();
}
private void updateGastosGenerales() {
int oldCuentaCorrienteFactura = this.estadoResultado.getCuentaCorrienteFactura();
int oldCuentaCorrienteBoleta = this.estadoResultado.getCuentaCorrienteBoleta();
int oldCuentaCorrienteSinRespaldo = this.estadoResultado.getCuentaCorrienteSinRespaldo();
int oldTotal = this.view.getGastosGeneralesTotal().getValue();
int cuentaCorrienteFactura = this.view.getGastosGeneralesCuentaCorrienteFactura().getValue();
int cuentaCorrienteBoleta = this.view.getGastosGeneralesCuentaCorrienteBoleta().getValue();
int cuentaCorrienteSinRespaldo = this.view.getGastosGeneralesCuentaCorrienteSinRespaldo().getValue();
this.estadoResultado.setCuentaCorrienteFactura(cuentaCorrienteFactura);
this.estadoResultado.setCuentaCorrienteBoleta(cuentaCorrienteBoleta);
this.estadoResultado.setCuentaCorrienteSinRespaldo(cuentaCorrienteSinRespaldo);
int total = oldTotal
- (oldCuentaCorrienteFactura + oldCuentaCorrienteBoleta + oldCuentaCorrienteSinRespaldo)
+ (cuentaCorrienteFactura + cuentaCorrienteBoleta + cuentaCorrienteSinRespaldo);
this.view.getGastosGeneralesTotal().setValue(total);
this.updateResumen();
}
private void updateServicios() {
int oldAgua = this.estadoResultado.getAgua();
int oldLuz = this.estadoResultado.getLuz();
int oldGas = this.estadoResultado.getGas();
int oldTelefono = this.estadoResultado.getTelefono();
int oldOtro = this.estadoResultado.getOtroServicio();
int oldTotal = this.view.getServiciosTotal().getValue();
int agua = this.view.getServiciosAgua().getValue();
int luz = this.view.getServiciosLuz().getValue();
int gas = this.view.getServiciosGas().getValue();
int telefono = this.view.getServiciosTelefono().getValue();
int otro = this.view.getServiciosOtro().getValue();
this.estadoResultado.setAgua(agua);
this.estadoResultado.setLuz(luz);
this.estadoResultado.setGas(gas);
this.estadoResultado.setTelefono(telefono);
this.estadoResultado.setOtroServicio(otro);
int total = oldTotal
- (oldAgua + oldLuz + oldGas + oldTelefono + oldOtro)
+ (agua + luz + gas + telefono + otro);
this.view.getServiciosTotal().setValue(total);
this.updateResumen();
}
private void updateGastosOperacionales() {
int oldCostoVenta = this.estadoResultado.getCostoVenta();
int oldRemuneraciones = this.estadoResultado.getRemuneraciones();
int oldFiniquitos = this.estadoResultado.getFiniquitos();
int oldAguinaldo = this.estadoResultado.getAguinaldo();
int oldBonos = this.estadoResultado.getBonosPersonal();
int oldHonorarios = this.estadoResultado.getHonorariosContador();
int oldArriendo = this.estadoResultado.getArriendo();
int oldTotal = this.view.getGastosOperacionalesTotal().getValue();
int costoVenta = this.view.getGastosOperacionalesCostoVenta().getValue();
int remuneraciones = this.view.getGastosOperacionalesRemuneraciones().getValue();
int finiquitos = this.view.getGastosOperacionalesFiniquitos().getValue();
int aguinaldo = this.view.getGastosOperacionalesAguinaldo().getValue();
int bonos = this.view.getGastosOperacionalesBonos().getValue();
int honorarios = this.view.getGastosOperacionalesHonorariosContador().getValue();
int arriendo = this.view.getGastosOperacionalesArriendo().getValue();
this.estadoResultado.setCostoVenta(costoVenta);
this.estadoResultado.setRemuneraciones(remuneraciones);
this.estadoResultado.setFiniquitos(finiquitos);
this.estadoResultado.setAguinaldo(aguinaldo);
this.estadoResultado.setBonosPersonal(bonos);
this.estadoResultado.setHonorariosContador(honorarios);
this.estadoResultado.setArriendo(arriendo);
int total = oldTotal
- (oldCostoVenta + oldRemuneraciones + oldFiniquitos + oldAguinaldo + oldBonos + oldHonorarios + oldArriendo)
+ (costoVenta + remuneraciones + finiquitos + aguinaldo + bonos + honorarios + arriendo);
this.view.getGastosOperacionalesTotal().setValue(total);
this.updateResumen();
}
private void updateResumen() {
int bruto = this.view.getVentaBrutaField().getValue();
int totalGastosOperacionales = this.view.getGastosOperacionalesTotal().getValue();
int totalGastosGenerales = this.view.getGastosGeneralesTotal().getValue();
int totalServicios = this.view.getServiciosTotal().getValue();
int netoExentas = this.view.getVentasNetaExentasField().getValue();
int iva = this.view.getVentaIVAField().getValue();
double ppm = this.view.getResumenPPM().getValue();
int ivaFavor = this.view.getResumenIVAFavor().getValue();
int utilidad = bruto - totalGastosGenerales - totalGastosOperacionales - totalServicios;
int ppmMes = (int) Math.round(ppm * (double)netoExentas / 100d);
int IVAPPM = iva + ppmMes;
int aPagar = IVAPPM - ivaFavor;
int resultado = utilidad - aPagar;
this.view.getResumenUtilidad().setValue(utilidad);
this.view.getResumenPPMMes().setValue(ppmMes);
this.view.getResumenIVAMes().setValue(iva);
this.view.getResumenIVAPPM().setValue(IVAPPM);
this.view.getResumenAPagar().setValue(aPagar);
this.view.getResumenResultado().setValue(resultado);
this.estadoResultado.setPpm(ppm);
this.estadoResultado.setIvaFavor(ivaFavor);
}
}

View File

@@ -29,6 +29,7 @@ import danielcortes.xyz.informes.InformeEgresos;
import danielcortes.xyz.informes.InformeLibroDeVentas;
import danielcortes.xyz.models.tipo_egreso.TipoEgreso;
import danielcortes.xyz.utils.StringUtils;
import danielcortes.xyz.views.EstadoResultadoView;
import danielcortes.xyz.views.InformesView;
import danielcortes.xyz.views.dialogs.MonthSelectDialog;
import danielcortes.xyz.views.dialogs.TipoEgresoSelectDialog;
@@ -53,6 +54,21 @@ public class InformesController {
private void setupViewEvents() {
this.view.getInformeLibroDeVentasButton().addActionListener(e -> generarInformeLibroDeVentasListener());
this.view.getGenerarEgresosFacturasMateriaPrimaButton().addActionListener(e -> generarInformeEgresosListener());
this.view.getEstadoResultadoButton().addActionListener(e -> {
EstadoResultadoView view = new EstadoResultadoView();
EstadoResultadoController controller = new EstadoResultadoController(view);
JFrame frame = new JFrame("Estado Resultado"+ ": " + Configuration.get("nombre_caja"));
frame.setContentPane(view.getContentPanel());
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(1000,600);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
this.view.getSalirButton().addActionListener(e -> {
((JFrame) this.view.getContentPanel().getParent().getParent().getParent()).dispose();
});
}
private void generarInformeLibroDeVentasListener() {

View File

@@ -12,8 +12,6 @@ import java.awt.*;
public class MainController {
private MainView view;
private CajasController cajasController;
public MainController(MainView view){
this.view = view;
this.setupViewEvents();
@@ -38,6 +36,9 @@ public class MainController {
this.executeView(view.getContentPanel(), "Informes Mensuales", new Dimension(250, 500));
});
this.view.getSalirButton().addActionListener(e -> {
System.exit(0);
});
}
private void executeView(JComponent view, String title, Dimension d){

View File

@@ -34,6 +34,8 @@ import danielcortes.xyz.models.efectivo.EfectivoDAO;
import danielcortes.xyz.models.efectivo.SQLiteEfectivoDAO;
import danielcortes.xyz.models.egreso.EgresoDAO;
import danielcortes.xyz.models.egreso.SQLiteEgresoDAO;
import danielcortes.xyz.models.estado_resultado.EstadoResultadoDAO;
import danielcortes.xyz.models.estado_resultado.SQLiteEstadoResultadoDAO;
import danielcortes.xyz.models.informes.egresos.InformeEgresosContentDAO;
import danielcortes.xyz.models.informes.egresos.SQLiteInformeEgresosContentDAO;
import danielcortes.xyz.models.informes.libro_de_ventas.InformeLibroDeVentasContentDAO;
@@ -56,6 +58,7 @@ public class DAOManager {
private static final IngresoDAO ingresoDAO;
private static final TipoEgresoDAO tipoEgresoDAO;
private static final TipoIngresoDAO tipoIngresoDAO;
private static final EstadoResultadoDAO estadoResultadoDAO;
static {
cajaDAO = new SQLiteCajaDAO();
@@ -68,6 +71,7 @@ public class DAOManager {
ingresoDAO = new SQLiteIngresoDAO();
tipoEgresoDAO = new SQLiteTipoEgresoDAO();
tipoIngresoDAO = new SQLiteTipoIngresoDAO();
estadoResultadoDAO = new SQLiteEstadoResultadoDAO();
}
public static CajaDAO getCajaDAO() {
@@ -109,4 +113,8 @@ public class DAOManager {
public static TipoIngresoDAO getTipoIngresoDAO() {
return tipoIngresoDAO;
}
public static EstadoResultadoDAO getEstadoResultadoDAO() {
return estadoResultadoDAO;
}
}

View File

@@ -34,6 +34,7 @@ import danielcortes.xyz.models.tipo_egreso.TipoEgresoDAO;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -62,6 +63,8 @@ public abstract class EgresoDAO {
public abstract int getTotalEgreso(Caja caja);
public abstract int getTotalEgresoMesPorTipo(YearMonth mes, TipoEgreso tipo);
List<Egreso> egresosFromResultSet(ResultSet rs) throws SQLException {
ArrayList<Egreso> egresoList = new ArrayList<>();
while (rs.next()) {

View File

@@ -32,6 +32,8 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -243,4 +245,32 @@ public class SQLiteEgresoDAO extends EgresoDAO {
}
return total;
}
@Override
public int getTotalEgresoMesPorTipo(YearMonth mes, TipoEgreso tipo) {
int total = 0;
try (Connection conn = connectionHolder.getConnection()) {
LocalDate start = mes.atDay(1);
LocalDate end = mes.atEndOfMonth();
String query = "select sum(valor) from egresos inner join caja on (egresos.caja_id = caja.id) where fecha between ? and ? and tipo_egreso_id = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, start.toString());
ps.setString(2, end.toString());
ps.setInt(3, tipo.getId());
ResultSet rs = ps.executeQuery();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}, {2}, {3}", new Object[]{query, start, end, tipo});
rs.next();
total = rs.getInt(1);
rs.close();
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
}
return total;
}
}

View File

@@ -0,0 +1,201 @@
package danielcortes.xyz.models.estado_resultado;
import java.time.YearMonth;
public class EstadoResultado {
public static final EstadoResultado emptyEstadoResultado;
static {
emptyEstadoResultado = new EstadoResultado();
emptyEstadoResultado.costoVenta = 0;
emptyEstadoResultado.cuentaCorrienteBoleta = 0;
emptyEstadoResultado.cuentaCorrienteFactura = 0;
emptyEstadoResultado.cuentaCorrienteSinRespaldo = 0;
emptyEstadoResultado.remuneraciones = 0;
emptyEstadoResultado.finiquitos = 0;
emptyEstadoResultado.aguinaldo = 0;
emptyEstadoResultado.bonosPersonal = 0;
emptyEstadoResultado.honorariosContador = 0;
emptyEstadoResultado.arriendo = 0;
emptyEstadoResultado.agua = 0;
emptyEstadoResultado.luz = 0;
emptyEstadoResultado.gas = 0;
emptyEstadoResultado.telefono = 0;
emptyEstadoResultado.otroServicio = 0;
emptyEstadoResultado.ppm = 0d;
emptyEstadoResultado.ivaFavor = 0;
}
private int id;
private YearMonth mes;
private int costoVenta;
private int cuentaCorrienteFactura;
private int cuentaCorrienteBoleta;
private int cuentaCorrienteSinRespaldo;
private int remuneraciones;
private int finiquitos;
private int aguinaldo;
private int bonosPersonal;
private int honorariosContador;
private int arriendo;
private int agua;
private int luz;
private int gas;
private int telefono;
private int otroServicio;
private double ppm;
private int ivaFavor;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public YearMonth getMes() {
return mes;
}
public void setMes(YearMonth mes) {
this.mes = mes;
}
public int getCostoVenta() {
return costoVenta;
}
public void setCostoVenta(int costoVenta) {
this.costoVenta = costoVenta;
}
public int getCuentaCorrienteFactura() {
return cuentaCorrienteFactura;
}
public void setCuentaCorrienteFactura(int cuentaCorrienteFactura) {
this.cuentaCorrienteFactura = cuentaCorrienteFactura;
}
public int getCuentaCorrienteBoleta() {
return cuentaCorrienteBoleta;
}
public void setCuentaCorrienteBoleta(int cuentaCorrienteBoleta) {
this.cuentaCorrienteBoleta = cuentaCorrienteBoleta;
}
public int getCuentaCorrienteSinRespaldo() {
return cuentaCorrienteSinRespaldo;
}
public void setCuentaCorrienteSinRespaldo(int cuentaCorrienteSinRespaldo) {
this.cuentaCorrienteSinRespaldo = cuentaCorrienteSinRespaldo;
}
public int getRemuneraciones() {
return remuneraciones;
}
public void setRemuneraciones(int remuneraciones) {
this.remuneraciones = remuneraciones;
}
public int getFiniquitos() {
return finiquitos;
}
public void setFiniquitos(int finiquitos) {
this.finiquitos = finiquitos;
}
public int getAguinaldo() {
return aguinaldo;
}
public void setAguinaldo(int aguinaldo) {
this.aguinaldo = aguinaldo;
}
public int getBonosPersonal() {
return bonosPersonal;
}
public void setBonosPersonal(int bonosPersonal) {
this.bonosPersonal = bonosPersonal;
}
public int getHonorariosContador() {
return honorariosContador;
}
public void setHonorariosContador(int honorariosContador) {
this.honorariosContador = honorariosContador;
}
public int getArriendo() {
return arriendo;
}
public void setArriendo(int arriendo) {
this.arriendo = arriendo;
}
public int getAgua() {
return agua;
}
public void setAgua(int agua) {
this.agua = agua;
}
public int getLuz() {
return luz;
}
public void setLuz(int luz) {
this.luz = luz;
}
public int getGas() {
return gas;
}
public void setGas(int gas) {
this.gas = gas;
}
public int getTelefono() {
return telefono;
}
public void setTelefono(int telefono) {
this.telefono = telefono;
}
public int getOtroServicio() {
return otroServicio;
}
public void setOtroServicio(int otroServicio) {
this.otroServicio = otroServicio;
}
public double getPpm() {
return ppm;
}
public void setPpm(double ppm) {
this.ppm = ppm;
}
public void setIvaFavor(int ivaFavor) {
this.ivaFavor = ivaFavor;
}
public int getIvaFavor() {
return ivaFavor;
}
}

View File

@@ -0,0 +1,55 @@
package danielcortes.xyz.models.estado_resultado;
import danielcortes.xyz.models.egreso.EgresoDAO;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
public abstract class EstadoResultadoDAO {
protected static final Logger LOGGER = Logger.getLogger(EgresoDAO.class.getName());
public abstract List<EstadoResultado> findAll();
public abstract EstadoResultado findById(int id);
public abstract EstadoResultado findByMonth(YearMonth month);
public abstract boolean insertEstadoResultado(EstadoResultado estadoResultado);
public abstract boolean updateEstadoResultado(EstadoResultado estadoResultado);
public abstract boolean deleteEstadoResultado(EstadoResultado estadoResultado);
List<EstadoResultado> estadoResultadosFromResultSet(ResultSet rs) throws SQLException {
List<EstadoResultado> estadoResultadoList = new ArrayList<>();
while(rs.next()) {
EstadoResultado estadoResultado = new EstadoResultado();
estadoResultado.setId(rs.getInt("id"));
estadoResultado.setMes(YearMonth.from(LocalDate.parse(rs.getString("mes"))));
estadoResultado.setCostoVenta(rs.getInt("costo_venta"));
estadoResultado.setCuentaCorrienteFactura(rs.getInt("cuenta_corriente_factura"));
estadoResultado.setCuentaCorrienteBoleta(rs.getInt("cuenta_corriente_boleta"));
estadoResultado.setCuentaCorrienteSinRespaldo(rs.getInt("cuenta_corriente_sin_respaldo"));
estadoResultado.setRemuneraciones(rs.getInt("remuneraciones"));
estadoResultado.setFiniquitos(rs.getInt("finiquitos"));
estadoResultado.setAguinaldo(rs.getInt("aguinaldo"));
estadoResultado.setBonosPersonal(rs.getInt("bonos_personal"));
estadoResultado.setHonorariosContador(rs.getInt("honorarios_contador"));
estadoResultado.setArriendo(rs.getInt("arriendo"));
estadoResultado.setAgua(rs.getInt("agua"));
estadoResultado.setLuz(rs.getInt("luz"));
estadoResultado.setGas(rs.getInt("gas"));
estadoResultado.setTelefono(rs.getInt("telefono"));
estadoResultado.setOtroServicio(rs.getInt("otro_servicio"));
estadoResultado.setPpm(rs.getDouble("ppm"));
estadoResultado.setIvaFavor(rs.getInt("ivaFavor"));
estadoResultadoList.add(estadoResultado);
}
return estadoResultadoList;
}
}

View File

@@ -0,0 +1,194 @@
package danielcortes.xyz.models.estado_resultado;
import danielcortes.xyz.data.SQLiteConnectionHolder;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
public class SQLiteEstadoResultadoDAO extends EstadoResultadoDAO {
private SQLiteConnectionHolder connectionHolder;
public SQLiteEstadoResultadoDAO() {
this.connectionHolder = new SQLiteConnectionHolder();
}
@Override
public List<EstadoResultado> findAll() {
List<EstadoResultado> estadoResultadoList = new ArrayList<>();
try (Connection conn = connectionHolder.getConnection()) {
String query = "select * from estado_resultado";
PreparedStatement ps = conn.prepareStatement(query);
ResultSet rs = ps.executeQuery();
LOGGER.log(Level.FINE, "QUERY: {0}", new Object[]{query});
estadoResultadoList = this.estadoResultadosFromResultSet(rs);
rs.close();
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
}
return estadoResultadoList;
}
@Override
public EstadoResultado findById(int id) {
EstadoResultado estadoResultado = null;
try (Connection conn = connectionHolder.getConnection()) {
String query = "select * from estado_resultado where id = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setInt(1, id);
ResultSet rs = ps.executeQuery();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, id});
estadoResultado = this.estadoResultadosFromResultSet(rs).get(0);
rs.close();
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
}
return estadoResultado;
}
@Override
public EstadoResultado findByMonth(YearMonth month) {
EstadoResultado estadoResultado = null;
try (Connection conn = connectionHolder.getConnection()) {
String query = "select * from estado_resultado where mes = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, month.atDay(1).toString());
ResultSet rs = ps.executeQuery();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, month});
List<EstadoResultado> estadosResultado = this.estadoResultadosFromResultSet(rs);
if (estadosResultado.size() > 0) {
estadoResultado = estadosResultado.get(0);
}
rs.close();
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
}
return estadoResultado;
}
@Override
public boolean insertEstadoResultado(EstadoResultado estadoResultado) {
int updates;
try (Connection conn = connectionHolder.getConnection()) {
String query = "insert into estado_resultado (mes, costo_venta, cuenta_corriente_factura, cuenta_corriente_boleta, cuenta_corriente_sin_respaldo, remuneraciones, finiquitos, aguinaldo, bonos_personal, honorarios_contador, arriendo, agua, luz, gas, telefono, otro_servicio, ppm, ivaFavor) values (?, ?, ?, ?, ?, ? , ?, ? , ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, estadoResultado.getMes().atDay(1).toString());
ps.setInt(2, estadoResultado.getCostoVenta());
ps.setInt(3, estadoResultado.getCuentaCorrienteFactura());
ps.setInt(4, estadoResultado.getCuentaCorrienteBoleta());
ps.setInt(5, estadoResultado.getCuentaCorrienteSinRespaldo());
ps.setInt(6, estadoResultado.getRemuneraciones());
ps.setInt(7, estadoResultado.getFiniquitos());
ps.setInt(8, estadoResultado.getAguinaldo());
ps.setInt(9, estadoResultado.getBonosPersonal());
ps.setInt(10, estadoResultado.getHonorariosContador());
ps.setInt(11, estadoResultado.getArriendo());
ps.setInt(12, estadoResultado.getAgua());
ps.setInt(13, estadoResultado.getLuz());
ps.setInt(14, estadoResultado.getGas());
ps.setInt(15, estadoResultado.getTelefono());
ps.setInt(16, estadoResultado.getOtroServicio());
ps.setDouble(17, estadoResultado.getPpm());
ps.setDouble(18, estadoResultado.getIvaFavor());
updates = ps.executeUpdate();
LOGGER.log(Level.FINE, "QUERY: {0} | values: [{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}] | updates: {19}", new Object[]{query, estadoResultado.getMes(), estadoResultado.getCostoVenta(), estadoResultado.getCuentaCorrienteFactura(), estadoResultado.getCuentaCorrienteBoleta(), estadoResultado.getCuentaCorrienteSinRespaldo(), estadoResultado.getRemuneraciones(), estadoResultado.getFiniquitos(), estadoResultado.getAguinaldo(), estadoResultado.getBonosPersonal(), estadoResultado.getHonorariosContador(), estadoResultado.getArriendo(), estadoResultado.getAgua(), estadoResultado.getLuz(), estadoResultado.getGas(), estadoResultado.getTelefono(), estadoResultado.getOtroServicio(), estadoResultado.getPpm(),estadoResultado.getIvaFavor(), updates});
ps.close();
query = "select last_insert_rowid()";
ps = conn.prepareStatement(query);
ResultSet rs = ps.executeQuery();
LOGGER.log(Level.FINE, "QUERY: {0}", query);
rs.next();
estadoResultado.setId(rs.getInt(1));
rs.close();
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
return false;
}
return updates > 0;
}
@Override
public boolean updateEstadoResultado(EstadoResultado estadoResultado) {
int updates;
try (Connection conn = connectionHolder.getConnection()) {
String query = "update estado_resultado set mes = ?, costo_venta = ?, cuenta_corriente_factura = ?, cuenta_corriente_boleta = ?, cuenta_corriente_sin_respaldo = ?, remuneraciones = ?, finiquitos = ?, aguinaldo = ?, bonos_personal = ?, honorarios_contador = ?, arriendo = ?, agua = ?, luz = ?, gas = ?, telefono = ?, otro_servicio = ?, ppm = ?, ivaFavor = ? where id = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, estadoResultado.getMes().atDay(1).toString());
ps.setInt(2, estadoResultado.getCostoVenta());
ps.setInt(3, estadoResultado.getCuentaCorrienteFactura());
ps.setInt(4, estadoResultado.getCuentaCorrienteBoleta());
ps.setInt(5, estadoResultado.getCuentaCorrienteSinRespaldo());
ps.setInt(6, estadoResultado.getRemuneraciones());
ps.setInt(7, estadoResultado.getFiniquitos());
ps.setInt(8, estadoResultado.getAguinaldo());
ps.setInt(9, estadoResultado.getBonosPersonal());
ps.setInt(10, estadoResultado.getHonorariosContador());
ps.setInt(11, estadoResultado.getArriendo());
ps.setInt(12, estadoResultado.getAgua());
ps.setInt(13, estadoResultado.getLuz());
ps.setInt(14, estadoResultado.getGas());
ps.setInt(15, estadoResultado.getTelefono());
ps.setInt(16, estadoResultado.getOtroServicio());
ps.setDouble(17, estadoResultado.getPpm());
ps.setDouble(18, estadoResultado.getIvaFavor());
ps.setInt(19, estadoResultado.getId());
updates = ps.executeUpdate();
LOGGER.log(Level.FINE, "QUERY: {0} | values: [{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}] | updates: {20}", new Object[]{query, estadoResultado.getMes(), estadoResultado.getCostoVenta(), estadoResultado.getCuentaCorrienteFactura(), estadoResultado.getCuentaCorrienteBoleta(), estadoResultado.getCuentaCorrienteSinRespaldo(), estadoResultado.getRemuneraciones(), estadoResultado.getFiniquitos(), estadoResultado.getAguinaldo(), estadoResultado.getBonosPersonal(), estadoResultado.getHonorariosContador(), estadoResultado.getArriendo(), estadoResultado.getAgua(), estadoResultado.getLuz(), estadoResultado.getGas(), estadoResultado.getTelefono(), estadoResultado.getOtroServicio(), estadoResultado.getPpm(),estadoResultado.getIvaFavor(), estadoResultado.getId(), updates});
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
return false;
}
return updates > 0;
}
@Override
public boolean deleteEstadoResultado(EstadoResultado estadoResultado) {
int updates;
try (Connection conn = connectionHolder.getConnection()) {
String query = "delete from estado_resultado where id = ?";
PreparedStatement ps = conn.prepareStatement(query);
ps.setInt(1, estadoResultado.getId());
updates = ps.executeUpdate();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1} | updates: {2}", new Object[]{query, estadoResultado.getId(), updates});
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
return false;
}
return updates > 0;
}
}

View File

@@ -35,6 +35,7 @@ import danielcortes.xyz.models.tipo_ingreso.TipoIngresoDAO;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -61,7 +62,12 @@ public abstract class IngresoDAO {
public abstract int getTotalIngreso(Caja caja);
List<Ingreso> ingresosFromResultSet(ResultSet rs) throws SQLException {
public abstract int getTotalIngresoMes(YearMonth mes);
public abstract int getTotalExentasMes(YearMonth mes);
List<Ingreso> ingresosFromResultSet(ResultSet rs) throws SQLException {
ArrayList<Ingreso> ingresosList = new ArrayList<>();
while (rs.next()) {
int tipoIngresoId = rs.getInt("tipo_ingreso_id");

View File

@@ -32,6 +32,8 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -227,4 +229,56 @@ public class SQLiteIngresoDAO extends IngresoDAO {
}
return total;
}
@Override
public int getTotalIngresoMes(YearMonth mes) {
int total = 0;
try (Connection conn = connectionHolder.getConnection()) {
LocalDate start = mes.atDay(1);
LocalDate end = mes.atEndOfMonth();
String query =
"select sum(valor) from ingresos inner join caja on (ingresos.caja_id == caja.id) where caja.fecha between ? and ? and ingresos.tipo_ingreso_id != 5";
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, start.toString());
ps.setString(2, end.toString());
ResultSet rs = ps.executeQuery();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}, {2}", new Object[]{query, start, end});
rs.next();
total = rs.getInt(1);
rs.close();
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
}
return total;
}
@Override
public int getTotalExentasMes(YearMonth mes) {
int total = 0;
try (Connection conn = connectionHolder.getConnection()) {
LocalDate start = mes.atDay(1);
LocalDate end = mes.atEndOfMonth();
String query =
"select sum(valor) from ingresos inner join caja on (ingresos.caja_id == caja.id) where caja.fecha between ? and ? and ingresos.tipo_ingreso_id = 5";
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, start.toString());
ps.setString(2, end.toString());
ResultSet rs = ps.executeQuery();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}, {2}", new Object[]{query, start, end});
rs.next();
total = rs.getInt(1);
rs.close();
ps.close();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
}
return total;
}
}

View File

@@ -0,0 +1,770 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="danielcortes.xyz.views.EstadoResultadoView">
<grid id="27dc6" binding="contentPanel" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<xy x="20" y="20" width="1065" height="689"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="c74b6" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="etched" title="Venta"/>
<children>
<component id="d30bf" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Bruto:"/>
</properties>
</component>
<component id="843b4" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Neto:"/>
</properties>
</component>
<component id="bd553" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="IVA:"/>
</properties>
</component>
<component id="3c89a" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Exentas:"/>
</properties>
</component>
<component id="766cf" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Neto + Exentas:"/>
</properties>
</component>
<component id="7a913" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="ventaBrutaField">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="ce533" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="ventaNetaField">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="fc1d7" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="ventaIVAField">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="a0098" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="ventaExentasField">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="6dac4" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="ventasNetaExentasField">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<vspacer id="b5cc0">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
<grid id="8ea34" layout-manager="GridLayoutManager" row-count="10" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="etched" title="Gastos Operacionales"/>
<children>
<component id="31a0c" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Costo de Venta:"/>
</properties>
</component>
<component id="89131" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Remuneraciones:"/>
</properties>
</component>
<component id="2e9a8" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Finiquitos:"/>
</properties>
</component>
<component id="6a68d" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Aguinaldo:"/>
</properties>
</component>
<component id="ab901" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Partime:"/>
</properties>
</component>
<component id="888b6" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Bonos Personal:"/>
</properties>
</component>
<component id="283a0" class="javax.swing.JLabel">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Honorarios Contador:"/>
</properties>
</component>
<component id="8a3d0" class="javax.swing.JLabel">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Arriendo:"/>
</properties>
</component>
<component id="39b25" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesCostoVenta">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="b218a" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesRemuneraciones">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="8618e" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesFiniquitos">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="a05d5" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesAguinaldo">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="ca573" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesPartime">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="62ef2" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesBonos">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="40436" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesHonorariosContador">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="6878a" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesArriendo">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="95eb2" class="javax.swing.JLabel">
<constraints>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Total:"/>
</properties>
</component>
<component id="f6000" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesTotal">
<constraints>
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<vspacer id="9a61e">
<constraints>
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
<grid id="9aa5a" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="etched" title="Servicios"/>
<children>
<component id="b6cce" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Agua:"/>
</properties>
</component>
<component id="550e0" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Luz:"/>
</properties>
</component>
<component id="f8dfc" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Gas:"/>
</properties>
</component>
<component id="9f5a4" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Telefono:"/>
</properties>
</component>
<component id="86732" class="javax.swing.JLabel">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Total:"/>
</properties>
</component>
<component id="d21b2" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="serviciosAgua">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="7ee5d" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="serviciosLuz">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="8d14c" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="serviciosGas">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="b1be8" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="serviciosTelefono">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="8fbc5" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="serviciosTotal">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<vspacer id="d36a2">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="1553f" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="serviciosOtro">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="374a4" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Otros:"/>
</properties>
</component>
</children>
</grid>
<grid id="5322a" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="etched" title="Gastos Generales"/>
<children>
<component id="3cff5" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosGeneralesCuentaCorrienteFactura">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="74d9c" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosGeneralesCuentaCorrienteBoleta">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="3fd07" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosGeneralesCuentaCorrienteSinRespaldo">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="78ad6" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosGeneralesEfectivoFacturaField">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="9583c" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosGeneralesEfectivoBoletaField">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="f32e7" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosGeneralesEfectivoSinRespaldo">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="bf8dd" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosGeneralesTotal">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="f328" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="CTA CTE Con Factura:"/>
</properties>
</component>
<component id="16181" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="CTA CTE Con Boleta:"/>
</properties>
</component>
<component id="43271" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="CTA CTE Sin Respaldo:"/>
</properties>
</component>
<component id="1a36e" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Efectivo Con Factura:"/>
</properties>
</component>
<component id="f808b" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Efectivo Con Boleta:"/>
</properties>
</component>
<component id="51411" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Efectivo Sin Respaldo"/>
</properties>
</component>
<component id="1a6a6" class="javax.swing.JLabel">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Total:"/>
</properties>
</component>
<vspacer id="93bec">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
<grid id="b518" layout-manager="GridLayoutManager" row-count="9" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="etched" title="Resumen"/>
<children>
<component id="32238" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="resumenUtilidad">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="241d5" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="resumenPPMMes">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="4694b" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="resumenIVAMes">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="d00e1" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="resumenIVAFavor">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="true"/>
</properties>
</component>
<component id="48770" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="resumenResultado">
<constraints>
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="29571" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Utilidad:"/>
</properties>
</component>
<component id="5fbc7" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="PPM Mes:"/>
</properties>
</component>
<component id="57f79" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="+ IVA Mes:"/>
</properties>
</component>
<component id="f7b30" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="- IVA A Favor:"/>
</properties>
</component>
<component id="2195d" class="javax.swing.JLabel">
<constraints>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Resultado:"/>
</properties>
</component>
<vspacer id="bda77">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="94da9" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="PPM:"/>
</properties>
</component>
<component id="25141" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="resumenAPagar">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="a3c74" class="javax.swing.JLabel">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="A Pagar PPM + IVA"/>
</properties>
</component>
<component id="daaca" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="resumenIVAPPM">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="88988" class="danielcortes.xyz.views.components.DoubleFormatedTextField" binding="resumenPPM">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="5" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
<grid id="b9feb" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="ef0dc" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="edd49" class="javax.swing.JSpinner" binding="yearSpinner" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="200" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="d6c6e" class="javax.swing.JComboBox" binding="monthCombo" custom-create="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="200" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="b5371" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Mes"/>
</properties>
</component>
<component id="40281" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Año"/>
</properties>
</component>
</children>
</grid>
<grid id="4dfc5" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="fca3a" class="javax.swing.JButton" binding="guardarButton" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value="Guardar"/>
</properties>
</component>
<component id="bf3d" class="javax.swing.JButton" binding="exportarButton" default-binding="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value="Exportar"/>
</properties>
</component>
<vspacer id="43843">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
<hspacer id="75cf5">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,536 @@
package danielcortes.xyz.views;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import danielcortes.xyz.views.components.DoubleFormatedTextField;
import danielcortes.xyz.views.components.NumberFormatedTextField;
import danielcortes.xyz.views.components.YearSpinnerModel;
import javax.swing.*;
import java.awt.*;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.ArrayList;
public class EstadoResultadoView {
private NumberFormatedTextField ventaBrutaField;
private NumberFormatedTextField ventaNetaField;
private NumberFormatedTextField ventaIVAField;
private NumberFormatedTextField ventaExentasField;
private NumberFormatedTextField ventasNetaExentasField;
private NumberFormatedTextField gastosOperacionalesCostoVenta;
private NumberFormatedTextField gastosOperacionalesRemuneraciones;
private NumberFormatedTextField gastosOperacionalesFiniquitos;
private NumberFormatedTextField gastosOperacionalesAguinaldo;
private NumberFormatedTextField gastosOperacionalesPartime;
private NumberFormatedTextField gastosOperacionalesBonos;
private NumberFormatedTextField gastosOperacionalesHonorariosContador;
private NumberFormatedTextField gastosOperacionalesArriendo;
private NumberFormatedTextField gastosOperacionalesTotal;
private NumberFormatedTextField serviciosAgua;
private NumberFormatedTextField serviciosLuz;
private NumberFormatedTextField serviciosGas;
private NumberFormatedTextField serviciosTelefono;
private NumberFormatedTextField serviciosTotal;
private NumberFormatedTextField gastosGeneralesCuentaCorrienteFactura;
private NumberFormatedTextField gastosGeneralesCuentaCorrienteBoleta;
private NumberFormatedTextField gastosGeneralesCuentaCorrienteSinRespaldo;
private NumberFormatedTextField gastosGeneralesEfectivoFacturaField;
private NumberFormatedTextField gastosGeneralesEfectivoBoletaField;
private NumberFormatedTextField gastosGeneralesEfectivoSinRespaldo;
private NumberFormatedTextField gastosGeneralesTotal;
private NumberFormatedTextField resumenUtilidad;
private NumberFormatedTextField resumenPPMMes;
private NumberFormatedTextField resumenIVAMes;
private NumberFormatedTextField resumenIVAFavor;
private NumberFormatedTextField resumenResultado;
private JSpinner yearSpinner;
private JComboBox monthCombo;
private JPanel contentPanel;
private NumberFormatedTextField serviciosOtro;
private NumberFormatedTextField resumenAPagar;
private NumberFormatedTextField resumenIVAPPM;
private DoubleFormatedTextField resumenPPM;
private JButton guardarButton;
private JButton exportarButton;
private ArrayList<String> months;
public EstadoResultadoView() {
$$$setupUI$$$();
}
public JPanel getContentPanel() {
return contentPanel;
}
public YearMonth getMonth() {
int year = Integer.valueOf((String) yearSpinner.getValue());
int month = this.months.indexOf((String) this.monthCombo.getSelectedItem()) + 1;
YearMonth yearMonth = YearMonth.of(year, month);
return yearMonth;
}
public JSpinner getYearSpinner() {
return yearSpinner;
}
public JComboBox getMonthCombo() {
return monthCombo;
}
public NumberFormatedTextField getVentaBrutaField() {
return ventaBrutaField;
}
public NumberFormatedTextField getVentaNetaField() {
return ventaNetaField;
}
public NumberFormatedTextField getVentaIVAField() {
return ventaIVAField;
}
public NumberFormatedTextField getVentaExentasField() {
return ventaExentasField;
}
public NumberFormatedTextField getVentasNetaExentasField() {
return ventasNetaExentasField;
}
public NumberFormatedTextField getGastosOperacionalesCostoVenta() {
return gastosOperacionalesCostoVenta;
}
public NumberFormatedTextField getGastosOperacionalesRemuneraciones() {
return gastosOperacionalesRemuneraciones;
}
public NumberFormatedTextField getGastosOperacionalesFiniquitos() {
return gastosOperacionalesFiniquitos;
}
public NumberFormatedTextField getGastosOperacionalesAguinaldo() {
return gastosOperacionalesAguinaldo;
}
public NumberFormatedTextField getGastosOperacionalesPartime() {
return gastosOperacionalesPartime;
}
public NumberFormatedTextField getGastosOperacionalesBonos() {
return gastosOperacionalesBonos;
}
public NumberFormatedTextField getGastosOperacionalesHonorariosContador() {
return gastosOperacionalesHonorariosContador;
}
public NumberFormatedTextField getGastosOperacionalesArriendo() {
return gastosOperacionalesArriendo;
}
public NumberFormatedTextField getGastosOperacionalesTotal() {
return gastosOperacionalesTotal;
}
public NumberFormatedTextField getServiciosAgua() {
return serviciosAgua;
}
public NumberFormatedTextField getServiciosLuz() {
return serviciosLuz;
}
public NumberFormatedTextField getServiciosGas() {
return serviciosGas;
}
public NumberFormatedTextField getServiciosTelefono() {
return serviciosTelefono;
}
public NumberFormatedTextField getServiciosTotal() {
return serviciosTotal;
}
public NumberFormatedTextField getGastosGeneralesCuentaCorrienteFactura() {
return gastosGeneralesCuentaCorrienteFactura;
}
public NumberFormatedTextField getGastosGeneralesCuentaCorrienteBoleta() {
return gastosGeneralesCuentaCorrienteBoleta;
}
public NumberFormatedTextField getGastosGeneralesCuentaCorrienteSinRespaldo() {
return gastosGeneralesCuentaCorrienteSinRespaldo;
}
public NumberFormatedTextField getGastosGeneralesEfectivoFacturaField() {
return gastosGeneralesEfectivoFacturaField;
}
public NumberFormatedTextField getGastosGeneralesEfectivoBoletaField() {
return gastosGeneralesEfectivoBoletaField;
}
public NumberFormatedTextField getGastosGeneralesEfectivoSinRespaldo() {
return gastosGeneralesEfectivoSinRespaldo;
}
public NumberFormatedTextField getGastosGeneralesTotal() {
return gastosGeneralesTotal;
}
public NumberFormatedTextField getResumenUtilidad() {
return resumenUtilidad;
}
public NumberFormatedTextField getResumenPPMMes() {
return resumenPPMMes;
}
public NumberFormatedTextField getResumenIVAMes() {
return resumenIVAMes;
}
public NumberFormatedTextField getResumenIVAFavor() {
return resumenIVAFavor;
}
public NumberFormatedTextField getResumenResultado() {
return resumenResultado;
}
public NumberFormatedTextField getServiciosOtro() {
return serviciosOtro;
}
public NumberFormatedTextField getResumenAPagar() {
return resumenAPagar;
}
public NumberFormatedTextField getResumenIVAPPM() {
return resumenIVAPPM;
}
public DoubleFormatedTextField getResumenPPM() {
return resumenPPM;
}
public JButton getGuardarButton() {
return guardarButton;
}
public JButton getExportarButton() {
return exportarButton;
}
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
createUIComponents();
contentPanel = new JPanel();
contentPanel.setLayout(new GridLayoutManager(3, 3, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(6, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Venta"));
final JLabel label1 = new JLabel();
label1.setText("Bruto:");
panel1.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label2 = new JLabel();
label2.setText("Neto:");
panel1.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label3 = new JLabel();
label3.setText("IVA:");
panel1.add(label3, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label4 = new JLabel();
label4.setText("Exentas:");
panel1.add(label4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label5 = new JLabel();
label5.setText("Neto + Exentas:");
panel1.add(label5, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
ventaBrutaField = new NumberFormatedTextField();
ventaBrutaField.setEditable(false);
panel1.add(ventaBrutaField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
ventaNetaField = new NumberFormatedTextField();
ventaNetaField.setEditable(false);
panel1.add(ventaNetaField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
ventaIVAField = new NumberFormatedTextField();
ventaIVAField.setEditable(false);
panel1.add(ventaIVAField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
ventaExentasField = new NumberFormatedTextField();
ventaExentasField.setEditable(false);
panel1.add(ventaExentasField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
ventasNetaExentasField = new NumberFormatedTextField();
ventasNetaExentasField.setEditable(false);
panel1.add(ventasNetaExentasField, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(10, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel2, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Gastos Operacionales"));
final JLabel label6 = new JLabel();
label6.setText("Costo de Venta:");
panel2.add(label6, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label7 = new JLabel();
label7.setText("Remuneraciones:");
panel2.add(label7, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label8 = new JLabel();
label8.setText("Finiquitos:");
panel2.add(label8, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label9 = new JLabel();
label9.setText("Aguinaldo:");
panel2.add(label9, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label10 = new JLabel();
label10.setText("Partime:");
panel2.add(label10, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label11 = new JLabel();
label11.setText("Bonos Personal:");
panel2.add(label11, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label12 = new JLabel();
label12.setText("Honorarios Contador:");
panel2.add(label12, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label13 = new JLabel();
label13.setText("Arriendo:");
panel2.add(label13, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
gastosOperacionalesCostoVenta = new NumberFormatedTextField();
panel2.add(gastosOperacionalesCostoVenta, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesRemuneraciones = new NumberFormatedTextField();
panel2.add(gastosOperacionalesRemuneraciones, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesFiniquitos = new NumberFormatedTextField();
panel2.add(gastosOperacionalesFiniquitos, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesAguinaldo = new NumberFormatedTextField();
panel2.add(gastosOperacionalesAguinaldo, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesPartime = new NumberFormatedTextField();
gastosOperacionalesPartime.setEditable(false);
panel2.add(gastosOperacionalesPartime, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesBonos = new NumberFormatedTextField();
panel2.add(gastosOperacionalesBonos, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesHonorariosContador = new NumberFormatedTextField();
panel2.add(gastosOperacionalesHonorariosContador, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesArriendo = new NumberFormatedTextField();
panel2.add(gastosOperacionalesArriendo, new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label14 = new JLabel();
label14.setText("Total:");
panel2.add(label14, new GridConstraints(9, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
gastosOperacionalesTotal = new NumberFormatedTextField();
gastosOperacionalesTotal.setEditable(false);
panel2.add(gastosOperacionalesTotal, new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final Spacer spacer2 = new Spacer();
panel2.add(spacer2, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(7, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel3, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Servicios"));
final JLabel label15 = new JLabel();
label15.setText("Agua:");
panel3.add(label15, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label16 = new JLabel();
label16.setText("Luz:");
panel3.add(label16, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label17 = new JLabel();
label17.setText("Gas:");
panel3.add(label17, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label18 = new JLabel();
label18.setText("Telefono:");
panel3.add(label18, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label19 = new JLabel();
label19.setText("Total:");
panel3.add(label19, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
serviciosAgua = new NumberFormatedTextField();
panel3.add(serviciosAgua, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
serviciosLuz = new NumberFormatedTextField();
panel3.add(serviciosLuz, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
serviciosGas = new NumberFormatedTextField();
panel3.add(serviciosGas, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
serviciosTelefono = new NumberFormatedTextField();
panel3.add(serviciosTelefono, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
serviciosTotal = new NumberFormatedTextField();
serviciosTotal.setEditable(false);
panel3.add(serviciosTotal, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final Spacer spacer3 = new Spacer();
panel3.add(spacer3, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
serviciosOtro = new NumberFormatedTextField();
panel3.add(serviciosOtro, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label20 = new JLabel();
label20.setText("Otros:");
panel3.add(label20, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel4 = new JPanel();
panel4.setLayout(new GridLayoutManager(8, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel4, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel4.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Gastos Generales"));
gastosGeneralesCuentaCorrienteFactura = new NumberFormatedTextField();
panel4.add(gastosGeneralesCuentaCorrienteFactura, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosGeneralesCuentaCorrienteBoleta = new NumberFormatedTextField();
panel4.add(gastosGeneralesCuentaCorrienteBoleta, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosGeneralesCuentaCorrienteSinRespaldo = new NumberFormatedTextField();
panel4.add(gastosGeneralesCuentaCorrienteSinRespaldo, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosGeneralesEfectivoFacturaField = new NumberFormatedTextField();
gastosGeneralesEfectivoFacturaField.setEditable(false);
panel4.add(gastosGeneralesEfectivoFacturaField, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosGeneralesEfectivoBoletaField = new NumberFormatedTextField();
gastosGeneralesEfectivoBoletaField.setEditable(false);
panel4.add(gastosGeneralesEfectivoBoletaField, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosGeneralesEfectivoSinRespaldo = new NumberFormatedTextField();
gastosGeneralesEfectivoSinRespaldo.setEditable(false);
panel4.add(gastosGeneralesEfectivoSinRespaldo, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosGeneralesTotal = new NumberFormatedTextField();
gastosGeneralesTotal.setEditable(false);
panel4.add(gastosGeneralesTotal, new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label21 = new JLabel();
label21.setText("CTA CTE Con Factura:");
panel4.add(label21, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label22 = new JLabel();
label22.setText("CTA CTE Con Boleta:");
panel4.add(label22, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label23 = new JLabel();
label23.setText("CTA CTE Sin Respaldo:");
panel4.add(label23, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label24 = new JLabel();
label24.setText("Efectivo Con Factura:");
panel4.add(label24, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label25 = new JLabel();
label25.setText("Efectivo Con Boleta:");
panel4.add(label25, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label26 = new JLabel();
label26.setText("Efectivo Sin Respaldo");
panel4.add(label26, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label27 = new JLabel();
label27.setText("Total:");
panel4.add(label27, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer4 = new Spacer();
panel4.add(spacer4, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JPanel panel5 = new JPanel();
panel5.setLayout(new GridLayoutManager(9, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel5, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel5.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Resumen"));
resumenUtilidad = new NumberFormatedTextField();
resumenUtilidad.setEditable(false);
panel5.add(resumenUtilidad, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
resumenPPMMes = new NumberFormatedTextField();
resumenPPMMes.setEditable(false);
panel5.add(resumenPPMMes, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
resumenIVAMes = new NumberFormatedTextField();
resumenIVAMes.setEditable(false);
panel5.add(resumenIVAMes, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
resumenIVAFavor = new NumberFormatedTextField();
resumenIVAFavor.setEditable(true);
panel5.add(resumenIVAFavor, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
resumenResultado = new NumberFormatedTextField();
resumenResultado.setEditable(false);
panel5.add(resumenResultado, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label28 = new JLabel();
label28.setText("Utilidad:");
panel5.add(label28, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label29 = new JLabel();
label29.setText("PPM Mes:");
panel5.add(label29, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label30 = new JLabel();
label30.setText("+ IVA Mes:");
panel5.add(label30, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label31 = new JLabel();
label31.setText("- IVA A Favor:");
panel5.add(label31, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label32 = new JLabel();
label32.setText("Resultado:");
panel5.add(label32, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer5 = new Spacer();
panel5.add(spacer5, new GridConstraints(7, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JLabel label33 = new JLabel();
label33.setText("PPM:");
panel5.add(label33, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
resumenAPagar = new NumberFormatedTextField();
resumenAPagar.setEditable(false);
panel5.add(resumenAPagar, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label34 = new JLabel();
label34.setText("A Pagar PPM + IVA");
panel5.add(label34, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
resumenIVAPPM = new NumberFormatedTextField();
resumenIVAPPM.setEditable(false);
panel5.add(resumenIVAPPM, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
resumenPPM = new DoubleFormatedTextField();
panel5.add(resumenPPM, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JPanel panel6 = new JPanel();
panel6.setLayout(new GridLayoutManager(1, 3, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel6, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel7 = new JPanel();
panel7.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
panel6.add(panel7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel7.add(yearSpinner, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(200, -1), null, 0, false));
panel7.add(monthCombo, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(200, -1), null, 0, false));
final JLabel label35 = new JLabel();
label35.setText("Mes");
panel7.add(label35, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label36 = new JLabel();
label36.setText("Año");
panel7.add(label36, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel8 = new JPanel();
panel8.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
panel6.add(panel8, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
guardarButton = new JButton();
guardarButton.setText("Guardar");
panel8.add(guardarButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
exportarButton = new JButton();
exportarButton.setText("Exportar");
panel8.add(exportarButton, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final Spacer spacer6 = new Spacer();
panel8.add(spacer6, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final Spacer spacer7 = new Spacer();
panel6.add(spacer7, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPanel;
}
private void createUIComponents() {
createYearSpinner();
createMonthCombo();
}
private void createYearSpinner() {
SpinnerModel model = new YearSpinnerModel();
this.yearSpinner = new JSpinner();
this.yearSpinner.setModel(model);
((JSpinner.DefaultEditor) this.yearSpinner.getEditor()).getTextField().setEditable(true);
}
private void createMonthCombo() {
months = new ArrayList<>();
months.add("Enero");
months.add("Febrero");
months.add("Marzo");
months.add("Abril");
months.add("Mayo");
months.add("Junio");
months.add("Julio");
months.add("Agosto");
months.add("Septiembre");
months.add("Octubre");
months.add("Noviembre");
months.add("Diciembre");
monthCombo = new JComboBox<>();
for (String month : months) {
monthCombo.addItem(month);
}
int currentMonth = LocalDate.now().getMonth().getValue() - 1;
monthCombo.setSelectedIndex(currentMonth);
}
}

View File

@@ -8,7 +8,7 @@
<properties/>
<border type="none"/>
<children>
<grid id="ae41b" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="ae41b" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -34,9 +34,25 @@
</component>
<vspacer id="91971">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="354cd" class="javax.swing.JButton" binding="estadoResultadoButton" default-binding="true">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Estado Resultado"/>
</properties>
</component>
<component id="64177" class="javax.swing.JButton" binding="salirButton" default-binding="true">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Salir"/>
</properties>
</component>
</children>
</grid>
</children>

View File

@@ -35,6 +35,8 @@ public class InformesView {
private JButton generarLibroVentasButton;
private JPanel contentPanel;
private JButton GenerarEgresosFacturasMateriaPrimaButton;
private JButton estadoResultadoButton;
private JButton salirButton;
public JPanel getContentPanel() {
return contentPanel;
@@ -48,6 +50,13 @@ public class InformesView {
return GenerarEgresosFacturasMateriaPrimaButton;
}
public JButton getEstadoResultadoButton() {
return estadoResultadoButton;
}
public JButton getSalirButton() {
return salirButton;
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
@@ -67,7 +76,7 @@ public class InformesView {
contentPanel = new JPanel();
contentPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(3, 1, new Insets(10, 10, 10, 10), -1, -1));
panel1.setLayout(new GridLayoutManager(5, 1, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Informes Mensuales"));
generarLibroVentasButton = new JButton();
@@ -77,7 +86,13 @@ public class InformesView {
GenerarEgresosFacturasMateriaPrimaButton.setText("Informe de Egresos");
panel1.add(GenerarEgresosFacturasMateriaPrimaButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
panel1.add(spacer1, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
estadoResultadoButton = new JButton();
estadoResultadoButton.setText("Estado Resultado");
panel1.add(estadoResultadoButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
salirButton = new JButton();
salirButton.setText("Salir");
panel1.add(salirButton, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
/**

View File

@@ -24,17 +24,9 @@
<text value="Cajas"/>
</properties>
</component>
<component id="a7f47" class="javax.swing.JButton" binding="informesGeneralesButton">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Informes Generales"/>
</properties>
</component>
<vspacer id="bce90">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="23ee8" class="javax.swing.JButton" binding="informesMensualesButton">
@@ -45,6 +37,14 @@
<text value="Informes Mensuales"/>
</properties>
</component>
<component id="5a8d1" class="javax.swing.JButton" binding="salirButton" default-binding="true">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Salir"/>
</properties>
</component>
</children>
</grid>
</children>

View File

@@ -13,6 +13,7 @@ public class MainView {
private JButton cajasButton;
private JButton informesGeneralesButton;
private JPanel buttonPanel;
private JButton salirButton;
public JPanel getContentPanel() {
return contentPanel;
@@ -34,6 +35,9 @@ public class MainView {
return informesGeneralesButton;
}
public JButton getSalirButton() {
return salirButton;
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
@@ -59,14 +63,14 @@ public class MainView {
cajasButton = new JButton();
cajasButton.setText("Cajas");
buttonPanel.add(cajasButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
informesGeneralesButton = new JButton();
informesGeneralesButton.setText("Informes Generales");
buttonPanel.add(informesGeneralesButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
buttonPanel.add(spacer1, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
buttonPanel.add(spacer1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
informesMensualesButton = new JButton();
informesMensualesButton.setText("Informes Mensuales");
buttonPanel.add(informesMensualesButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
salirButton = new JButton();
salirButton.setText("Salir");
buttonPanel.add(salirButton, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
/**

View File

@@ -0,0 +1,61 @@
package danielcortes.xyz.views.components;
import org.mariuszgromada.math.mxparser.Expression;
import javax.swing.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.text.NumberFormat;
public class DoubleFormatedTextField extends JTextField {
private double value;
private NumberFormat nf;
public DoubleFormatedTextField() {
super();
this.nf = NumberFormat.getIntegerInstance();
this.nf.setMaximumFractionDigits(2);
this.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
DoubleFormatedTextField.this.select(0, getText().length());
}
@Override
public void focusLost(FocusEvent e) {
DoubleFormatedTextField.this.readValue();
DoubleFormatedTextField.this.formatText();
}
});
}
public double getValue() {
this.readValue();
return this.value;
}
public void setValue(double value) {
this.value = value;
this.formatText();
}
private void readValue() {
String currentText = this.getText();
String stripedDots = currentText.replace(".", "");
String replacedPeriods = stripedDots.replace(",", ".");
Expression expression = new Expression(replacedPeriods);
if (expression.checkSyntax()) {
this.value = expression.calculate();
} else {
this.value = 0;
}
}
private void formatText() {
this.setText(nf.format(this.value));
}
}

View File

@@ -0,0 +1,10 @@
package danielcortes.xyz.views.listeners;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
public interface FocusLostListener extends FocusListener {
@Override
default void focusGained(FocusEvent e){ }
}