Tecnicamente esta terminada la funcionalidad basica

This commit is contained in:
Daniel Cortes
2018-12-28 04:32:35 -03:00
parent b90951e8ca
commit 87fb2f8abb
11 changed files with 299 additions and 105 deletions

View File

@@ -64,6 +64,8 @@ create table ingresos
( (
id int(10) unsigned primary key auto_increment, id int(10) unsigned primary key auto_increment,
valor int(10) not null, valor int(10) not null,
nro_inicial varchar(191) not null,
nro_final varchar(191) not null,
tipo_ingreso_id int(10) unsigned not null, tipo_ingreso_id int(10) unsigned not null,
caja_id int(10) unsigned not null, caja_id int(10) unsigned not null,
foreign key fk_tipo_ingreso (tipo_ingreso_id) references tipos_ingreso (id) on update cascade on delete restrict, foreign key fk_tipo_ingreso (tipo_ingreso_id) references tipos_ingreso (id) on update cascade on delete restrict,

View File

@@ -34,6 +34,7 @@ import danielcortes.xyz.models.ingreso.IngresoDAO;
import danielcortes.xyz.views.ArqueoView; import danielcortes.xyz.views.ArqueoView;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
public class ArqueoController { public class ArqueoController {
@@ -71,7 +72,7 @@ public class ArqueoController {
private void fillEfectivo() { private void fillEfectivo() {
this.efectivo = this.efectivoDAO.findByCaja(this.caja); this.efectivo = this.efectivoDAO.findByCaja(this.caja);
this.view.getVeinteMilField().setText(String.valueOf(efectivo.getVeinteMil())); this.view.getVeinteMilField().setText(String.valueOf(efectivo.getVeinteMil()));
this.view.getDiezField().setText(String.valueOf(efectivo.getDiezMil())); this.view.getDiezMilField().setText(String.valueOf(efectivo.getDiezMil()));
this.view.getCincoMilField().setText(String.valueOf(efectivo.getCincoMil())); this.view.getCincoMilField().setText(String.valueOf(efectivo.getCincoMil()));
this.view.getDosMilField().setText(String.valueOf(efectivo.getDosMil())); this.view.getDosMilField().setText(String.valueOf(efectivo.getDosMil()));
this.view.getMilField().setText(String.valueOf(efectivo.getMil())); this.view.getMilField().setText(String.valueOf(efectivo.getMil()));
@@ -142,6 +143,11 @@ public class ArqueoController {
this.view.getArqueoField().setText(String.valueOf(arqueo)); this.view.getArqueoField().setText(String.valueOf(arqueo));
this.view.getAjusteField().setText(String.valueOf(ajuste)); this.view.getAjusteField().setText(String.valueOf(ajuste));
if(ajuste < 0) {
this.view.getAjusteField().setForeground(new Color(255,0,0));
}else{
this.view.getAjusteField().setForeground(new Color(0,0,0));
}
} }

View File

@@ -90,6 +90,8 @@ public class IngresosController {
this.view.getIngresosTable().getSelectionModel().addListSelectionListener(e -> onSelectTableRowListener()); this.view.getIngresosTable().getSelectionModel().addListSelectionListener(e -> onSelectTableRowListener());
this.view.getGuardarButton().addActionListener(e -> guardarActionListener()); this.view.getGuardarButton().addActionListener(e -> guardarActionListener());
this.view.getValorField().addActionListener(e -> guardarActionListener()); this.view.getValorField().addActionListener(e -> guardarActionListener());
this.view.getNroInicialField().addActionListener(e -> guardarActionListener());
this.view.getNroFinalField().addActionListener(e -> guardarActionListener());
this.view.getEliminarButton().addActionListener(e -> eliminarActionListener()); this.view.getEliminarButton().addActionListener(e -> eliminarActionListener());
this.view.getEditarButton().addActionListener(e -> editarActionListener()); this.view.getEditarButton().addActionListener(e -> editarActionListener());
@@ -115,12 +117,17 @@ public class IngresosController {
private void guardarActionListener() { private void guardarActionListener() {
this.normalizeInputs(); this.normalizeInputs();
String valor = this.view.getValorField().getText(); String valor = this.view.getValorField().getText();
String nroInicial = this.view.getNroInicialField().getText();
String nroFinal = this.view.getNroFinalField().getText();
TipoIngreso tipoIngreso = (TipoIngreso) this.view.getTipoCombo().getSelectedItem(); TipoIngreso tipoIngreso = (TipoIngreso) this.view.getTipoCombo().getSelectedItem();
System.out.println(nroInicial);
System.out.println(nroFinal);
if(editing) { if(editing) {
this.editarIngreso(valor, tipoIngreso, this.caja); this.editarIngreso(valor, nroInicial, nroFinal, tipoIngreso, this.caja);
} else { } else {
this.guardarIngreso(valor, tipoIngreso, this.caja); this.guardarIngreso(valor, nroInicial, nroFinal, tipoIngreso, this.caja);
} }
this.resetFocus(); this.resetFocus();
} }
@@ -147,6 +154,8 @@ public class IngresosController {
this.view.getTipoCombo().setSelectedItem(ingreso.getTipoIngreso()); this.view.getTipoCombo().setSelectedItem(ingreso.getTipoIngreso());
this.view.getValorField().setText(String.valueOf(ingreso.getValor())); this.view.getValorField().setText(String.valueOf(ingreso.getValor()));
this.view.getNroInicialField().setText(String.valueOf(ingreso.getNroInicial()));
this.view.getNroFinalField().setText(String.valueOf(ingreso.getNroFinal()));
} }
} }
@@ -170,12 +179,14 @@ public class IngresosController {
} }
} }
private void guardarIngreso(String valor, TipoIngreso tipoIngreso, Caja caja){ private void guardarIngreso(String valor, String nroInicial, String nroFinal, TipoIngreso tipoIngreso, Caja caja){
if(this.validateInput(valor, tipoIngreso, caja)){ if(this.validateInput(valor, nroInicial, nroFinal, tipoIngreso, caja)){
Ingreso ingreso = new Ingreso(); Ingreso ingreso = new Ingreso();
ingreso.setTipoIngreso(tipoIngreso); ingreso.setTipoIngreso(tipoIngreso);
ingreso.setCaja(caja); ingreso.setCaja(caja);
ingreso.setValor(Integer.valueOf(valor)); ingreso.setValor(Integer.valueOf(valor));
ingreso.setNroInicial(nroInicial);
ingreso.setNroFinal(nroFinal);
this.ingresoDAO.insertIngreso(ingreso); this.ingresoDAO.insertIngreso(ingreso);
this.view.getIngresosTableModel().addRow(ingreso); this.view.getIngresosTableModel().addRow(ingreso);
@@ -185,10 +196,12 @@ public class IngresosController {
} }
} }
private void editarIngreso(String valor, TipoIngreso tipoIngreso, Caja caja){ private void editarIngreso(String valor, String nroInicial, String nroFinal, TipoIngreso tipoIngreso, Caja caja){
if(this.validateInput(valor, tipoIngreso, caja)){ if(this.validateInput(valor, nroInicial, nroFinal, tipoIngreso, caja)){
this.editingIngreso.setTipoIngreso(tipoIngreso); this.editingIngreso.setTipoIngreso(tipoIngreso);
this.editingIngreso.setValor(Integer.valueOf(valor)); this.editingIngreso.setValor(Integer.valueOf(valor));
this.editingIngreso.setNroInicial(nroInicial);
this.editingIngreso.setNroFinal(nroFinal);
this.ingresoDAO.updateIngreso(this.editingIngreso); this.ingresoDAO.updateIngreso(this.editingIngreso);
this.view.getIngresosTableModel().setIngreso(this.editingId, this.editingIngreso); this.view.getIngresosTableModel().setIngreso(this.editingId, this.editingIngreso);
this.updateTotalIngresos(); this.updateTotalIngresos();
@@ -197,10 +210,12 @@ public class IngresosController {
} }
} }
private boolean validateInput(String valor, TipoIngreso tipoIngreso, Caja caja) { private boolean validateInput(String valor, String nroInicial, String nroFinal, TipoIngreso tipoIngreso, Caja caja) {
this.hideErrorMessages(); this.hideErrorMessages();
boolean valorValidation = this.validateValor(valor); boolean valorValidation = this.validateValor(valor);
boolean nroInicialValidation = this.validateNroInicial(nroInicial);
boolean nroFinalValidation = this.validateNroFinal(nroFinal);
boolean tipoIngresoValidation = this.validateTipoIngreso(tipoIngreso); boolean tipoIngresoValidation = this.validateTipoIngreso(tipoIngreso);
boolean cajaValidation = this.validateCaja(caja); boolean cajaValidation = this.validateCaja(caja);
@@ -241,6 +256,36 @@ public class IngresosController {
} }
private boolean validateNroInicial(String nroInicial){
if (nroInicial == null) {
this.view.getErrorNroInicial().setText("Hubo un problema con los datos");
this.view.getErrorNroInicial().setVisible(true);
return false;
}
if (nroInicial.isEmpty()) {
this.view.getErrorNroInicial().setText("El campo esta vacio");
this.view.getErrorNroInicial().setVisible(true);
return false;
}
return true;
}
private boolean validateNroFinal(String nroFinal){
if (nroFinal == null) {
this.view.getErrorNroFinal().setText("Hubo un problema con los datos");
this.view.getErrorNroFinal().setVisible(true);
return false;
}
if (nroFinal.isEmpty()) {
this.view.getErrorNroFinal().setText("El campo esta vacio");
this.view.getErrorNroFinal().setVisible(true);
return false;
}
return true;
}
private boolean validateTipoIngreso(TipoIngreso tipoIngreso) { private boolean validateTipoIngreso(TipoIngreso tipoIngreso) {
if (tipoIngreso == null) { if (tipoIngreso == null) {
this.view.getErrorTipoIngreso().setText("Hubo un problema con los datos"); this.view.getErrorTipoIngreso().setText("Hubo un problema con los datos");
@@ -253,15 +298,21 @@ public class IngresosController {
private void hideErrorMessages() { private void hideErrorMessages() {
this.view.getErrorTipoIngreso().setVisible(false); this.view.getErrorTipoIngreso().setVisible(false);
this.view.getErrorValor().setVisible(false); this.view.getErrorValor().setVisible(false);
this.view.getErrorNroInicial().setVisible(false);
this.view.getErrorNroFinal().setVisible(false);
} }
private void clearInputs() { private void clearInputs() {
this.view.getTipoCombo().setSelectedIndex(0); this.view.getTipoCombo().setSelectedIndex(0);
this.view.getValorField().setText(""); this.view.getValorField().setText("");
this.view.getNroInicialField().setText("");
this.view.getNroFinalField().setText("");
} }
private void normalizeInputs(){ private void normalizeInputs(){
this.view.getValorField().setText(this.view.getValorField().getText().trim()); this.view.getValorField().setText(this.view.getValorField().getText().trim());
this.view.getNroInicialField().setText(this.view.getNroInicialField().getText().trim());
this.view.getNroFinalField().setText(this.view.getNroFinalField().getText().trim());
} }
private void resetFocus(){ private void resetFocus(){

View File

@@ -152,7 +152,6 @@ public class MysqlEfectivoDAO implements EfectivoDAO {
ps.setInt(1, efectivo.getCaja().getId()); ps.setInt(1, efectivo.getCaja().getId());
updates = ps.executeUpdate(); updates = ps.executeUpdate();
System.out.println(updates);
ps.close(); ps.close();
ps = conn.prepareStatement("select last_insert_id()"); ps = conn.prepareStatement("select last_insert_id()");

View File

@@ -30,22 +30,11 @@ import danielcortes.xyz.models.tipo_ingreso.TipoIngreso;
public class Ingreso { public class Ingreso {
private int id; private int id;
private int valor; private int valor;
private String nroInicial;
private String nroFinal;
private TipoIngreso tipoIngreso; private TipoIngreso tipoIngreso;
private Caja caja; private Caja caja;
public Ingreso(int id, int valor, TipoIngreso tipoIngreso ) {
this.id = id;
this.valor = valor;
this.tipoIngreso = tipoIngreso;
}
public Ingreso( int valor, TipoIngreso tipoIngreso) {
this.valor = valor;
this.tipoIngreso = tipoIngreso;
}
public Ingreso(){}
public int getId() { public int getId() {
return id; return id;
} }
@@ -54,14 +43,6 @@ public class Ingreso {
this.id = id; this.id = id;
} }
public TipoIngreso getTipoIngreso() {
return tipoIngreso;
}
public void setTipoIngreso(TipoIngreso tipoIngreso) {
this.tipoIngreso = tipoIngreso;
}
public int getValor() { public int getValor() {
return valor; return valor;
} }
@@ -70,6 +51,30 @@ public class Ingreso {
this.valor = valor; this.valor = valor;
} }
public String getNroInicial() {
return nroInicial;
}
public void setNroInicial(String nroInicial) {
this.nroInicial = nroInicial;
}
public String getNroFinal() {
return nroFinal;
}
public void setNroFinal(String nroFinal) {
this.nroFinal = nroFinal;
}
public TipoIngreso getTipoIngreso() {
return tipoIngreso;
}
public void setTipoIngreso(TipoIngreso tipoIngreso) {
this.tipoIngreso = tipoIngreso;
}
public Caja getCaja() { public Caja getCaja() {
return caja; return caja;
} }

View File

@@ -130,10 +130,12 @@ public class MysqlIngresoDAO implements IngresoDAO{
int updates; int updates;
try { try {
Connection conn = mysqlConnection.getConnection(); Connection conn = mysqlConnection.getConnection();
PreparedStatement ps = conn.prepareStatement("insert into ingresos (valor, tipo_ingreso_id, caja_id) values (?,?,?)"); PreparedStatement ps = conn.prepareStatement("insert into ingresos (valor, nro_inicial, nro_final, tipo_ingreso_id, caja_id) values (?,?,?,?,?)");
ps.setInt(1, ingreso.getValor()); ps.setInt(1, ingreso.getValor());
ps.setInt(2, ingreso.getTipoIngreso().getId()); ps.setString(2, ingreso.getNroInicial());
ps.setInt(3, ingreso.getCaja().getId()); ps.setString(3, ingreso.getNroFinal());
ps.setInt(4, ingreso.getTipoIngreso().getId());
ps.setInt(5, ingreso.getCaja().getId());
updates = ps.executeUpdate(); updates = ps.executeUpdate();
ps.close(); ps.close();
@@ -157,11 +159,13 @@ public class MysqlIngresoDAO implements IngresoDAO{
int updates; int updates;
try { try {
Connection conn = mysqlConnection.getConnection(); Connection conn = mysqlConnection.getConnection();
PreparedStatement ps = conn.prepareStatement("update ingresos set valor = ? , tipo_ingreso_id = ?, caja_id = ? where id = ?"); PreparedStatement ps = conn.prepareStatement("update ingresos set valor = ? , nro_inicial = ?, nro_final = ?, tipo_ingreso_id = ?, caja_id = ? where id = ?");
ps.setInt(1,ingreso.getValor()); ps.setInt(1,ingreso.getValor());
ps.setInt(2, ingreso.getTipoIngreso().getId()); ps.setString(2, ingreso.getNroInicial());
ps.setInt(3, ingreso.getCaja().getId()); ps.setString(3, ingreso.getNroFinal());
ps.setInt(4, ingreso.getId()); ps.setInt(4, ingreso.getTipoIngreso().getId());
ps.setInt(5, ingreso.getCaja().getId());
ps.setInt(6, ingreso.getId());
updates = ps.executeUpdate(); updates = ps.executeUpdate();
@@ -227,6 +231,8 @@ public class MysqlIngresoDAO implements IngresoDAO{
ingreso.setId(rs.getInt("id")); ingreso.setId(rs.getInt("id"));
ingreso.setValor(rs.getInt("valor")); ingreso.setValor(rs.getInt("valor"));
ingreso.setNroInicial(rs.getString("nro_inicial"));
ingreso.setNroFinal(rs.getString("nro_final"));
ingreso.setTipoIngreso(tipoIngreso); ingreso.setTipoIngreso(tipoIngreso);
ingreso.setCaja(caja); ingreso.setCaja(caja);

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="danielcortes.xyz.views.ArqueoView"> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="danielcortes.xyz.views.ArqueoView">
<grid id="27dc6" binding="contentPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="27dc6" binding="contentPanel" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
<xy x="20" y="20" width="616" height="626"/> <xy x="20" y="20" width="616" height="646"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="none"> <border type="none">
@@ -86,7 +86,7 @@
</component> </component>
</children> </children>
</grid> </grid>
<grid id="84446" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="84446" 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"/> <margin top="10" left="10" bottom="10" right="10"/>
<constraints> <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"/> <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"/>
@@ -172,7 +172,7 @@
</component> </component>
<component id="cee37" class="javax.swing.JLabel"> <component id="cee37" class="javax.swing.JLabel">
<constraints> <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"/> <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> </constraints>
<properties> <properties>
<text value="Arqueo"/> <text value="Arqueo"/>
@@ -180,40 +180,48 @@
</component> </component>
<component id="b0664" class="javax.swing.JTextField" binding="arqueoField"> <component id="b0664" class="javax.swing.JTextField" binding="arqueoField">
<constraints> <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"> <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"/> <preferred-size width="150" height="-1"/>
</grid> </grid>
</constraints> </constraints>
<properties> <properties>
<editable value="false"/> <editable value="false"/>
<font style="1"/>
<text value="0"/> <text value="0"/>
</properties> </properties>
</component> </component>
<component id="509b2" class="javax.swing.JTextField" binding="ajusteField"> <component id="509b2" class="javax.swing.JTextField" binding="ajusteField">
<constraints> <constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"> <grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/> <preferred-size width="150" height="-1"/>
</grid> </grid>
</constraints> </constraints>
<properties> <properties>
<editable value="false"/> <editable value="false"/>
<font style="1"/>
<text value="0"/> <text value="0"/>
</properties> </properties>
</component> </component>
<component id="bafd7" class="javax.swing.JLabel"> <component id="bafd7" class="javax.swing.JLabel">
<constraints> <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"/> <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> </constraints>
<properties> <properties>
<text value="Ajuste "/> <text value="Ajuste "/>
</properties> </properties>
</component> </component>
<component id="679e2" class="javax.swing.JSeparator">
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
</children> </children>
</grid> </grid>
<grid id="3f85f" layout-manager="GridLayoutManager" row-count="19" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="3f85f" layout-manager="GridLayoutManager" row-count="19" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/> <margin top="10" left="10" bottom="10" right="10"/>
<constraints> <constraints>
<grid row="0" column="0" row-span="2" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> <grid row="0" column="0" row-span="3" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="etched" title="Detalle Efectivo"> <border type="etched" title="Detalle Efectivo">
@@ -484,6 +492,16 @@
</component> </component>
</children> </children>
</grid> </grid>
<vspacer id="28775">
<constraints>
<grid row="2" 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>
<vspacer id="93947">
<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"/>
</constraints>
</vspacer>
</children> </children>
</grid> </grid>
</form> </form>

View File

@@ -26,6 +26,7 @@ package danielcortes.xyz.views;
import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager; import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
@@ -204,7 +205,7 @@ public class ArqueoView {
*/ */
private void $$$setupUI$$$() { private void $$$setupUI$$$() {
contentPanel = new JPanel(); contentPanel = new JPanel();
contentPanel.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1));
final JPanel panel1 = new JPanel(); final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(5, 2, new Insets(10, 10, 10, 10), -1, -1)); panel1.setLayout(new GridLayoutManager(5, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel1, new GridConstraints(0, 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)); contentPanel.add(panel1, new GridConstraints(0, 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));
@@ -235,7 +236,7 @@ public class ArqueoView {
errorTarjetas.setVisible(false); errorTarjetas.setVisible(false);
panel1.add(errorTarjetas, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel1.add(errorTarjetas, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel2 = new JPanel(); final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(6, 2, new Insets(10, 10, 10, 10), -1, -1)); panel2.setLayout(new GridLayoutManager(7, 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)); 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(), "Resumen")); panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Resumen"));
final JLabel label3 = new JLabel(); final JLabel label3 = new JLabel();
@@ -268,21 +269,27 @@ public class ArqueoView {
panel2.add(ingresosField, 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)); panel2.add(ingresosField, 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));
final JLabel label7 = new JLabel(); final JLabel label7 = new JLabel();
label7.setText("Arqueo"); label7.setText("Arqueo");
panel2.add(label7, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel2.add(label7, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
arqueoField = new JTextField(); arqueoField = new JTextField();
arqueoField.setEditable(false); arqueoField.setEditable(false);
Font arqueoFieldFont = this.$$$getFont$$$(null, Font.BOLD, -1, arqueoField.getFont());
if (arqueoFieldFont != null) arqueoField.setFont(arqueoFieldFont);
arqueoField.setText("0"); arqueoField.setText("0");
panel2.add(arqueoField, 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)); panel2.add(arqueoField, 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));
ajusteField = new JTextField(); ajusteField = new JTextField();
ajusteField.setEditable(false); ajusteField.setEditable(false);
Font ajusteFieldFont = this.$$$getFont$$$(null, Font.BOLD, -1, ajusteField.getFont());
if (ajusteFieldFont != null) ajusteField.setFont(ajusteFieldFont);
ajusteField.setText("0"); ajusteField.setText("0");
panel2.add(ajusteField, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); panel2.add(ajusteField, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label8 = new JLabel(); final JLabel label8 = new JLabel();
label8.setText("Ajuste "); label8.setText("Ajuste ");
panel2.add(label8, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel2.add(label8, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JSeparator separator1 = new JSeparator();
panel2.add(separator1, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JPanel panel3 = new JPanel(); final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(19, 2, new Insets(10, 10, 10, 10), -1, -1)); panel3.setLayout(new GridLayoutManager(19, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel3, new GridConstraints(0, 0, 2, 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)); contentPanel.add(panel3, new GridConstraints(0, 0, 3, 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(), "Detalle Efectivo", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, -1, -1, panel3.getFont()))); panel3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Detalle Efectivo", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, -1, -1, panel3.getFont())));
final JLabel label9 = new JLabel(); final JLabel label9 = new JLabel();
label9.setText("$20000"); label9.setText("$20000");
@@ -386,6 +393,10 @@ public class ArqueoView {
errorDiez.setText("Error"); errorDiez.setText("Error");
errorDiez.setVisible(false); errorDiez.setVisible(false);
panel3.add(errorDiez, new GridConstraints(17, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel3.add(errorDiez, new GridConstraints(17, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
contentPanel.add(spacer1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final Spacer spacer2 = new Spacer();
contentPanel.add(spacer2, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
} }
/** /**

View File

@@ -29,7 +29,7 @@
</component> </component>
</children> </children>
</scrollpane> </scrollpane>
<grid id="7fa26" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="7fa26" layout-manager="GridLayoutManager" row-count="3" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <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"/> <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"/>
@@ -39,31 +39,15 @@
<children> <children>
<component id="50b32" class="javax.swing.JLabel"> <component id="50b32" class="javax.swing.JLabel">
<constraints> <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"/> <grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
<properties> <properties>
<text value="Tipo"/> <text value="Tipo"/>
</properties> </properties>
</component> </component>
<component id="d0439" 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="Valor"/>
</properties>
</component>
<component id="375b0" class="javax.swing.JTextField" binding="valorField">
<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="b5d8c" class="javax.swing.JComboBox" binding="tipoCombo"> <component id="b5d8c" class="javax.swing.JComboBox" binding="tipoCombo">
<constraints> <constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <grid row="1" column="3" 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"/> <preferred-size width="150" height="-1"/>
</grid> </grid>
</constraints> </constraints>
@@ -71,9 +55,57 @@
<model/> <model/>
</properties> </properties>
</component> </component>
<component id="d0439" 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="Valor"/>
</properties>
</component>
<component id="375b0" class="javax.swing.JTextField" binding="valorField">
<constraints>
<grid row="1" column="0" 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="9bb1" 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="N° Inicial"/>
</properties>
</component>
<component id="3f626" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="2" 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="N° Final"/>
</properties>
</component>
<component id="461c1" class="javax.swing.JTextField" binding="nroInicialField">
<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="949e" class="javax.swing.JTextField" binding="nroFinalField">
<constraints>
<grid row="1" column="2" 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="d11b0" class="javax.swing.JLabel" binding="errorTipoIngreso"> <component id="d11b0" class="javax.swing.JLabel" binding="errorTipoIngreso">
<constraints> <constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="2" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
<properties> <properties>
<foreground color="-65536"/> <foreground color="-65536"/>
@@ -82,6 +114,16 @@
</properties> </properties>
</component> </component>
<component id="4b7ff" class="javax.swing.JLabel" binding="errorValor"> <component id="4b7ff" class="javax.swing.JLabel" binding="errorValor">
<constraints>
<grid row="2" 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>
<foreground color="-65536"/>
<text value="Label"/>
<visible value="false"/>
</properties>
</component>
<component id="7d011" class="javax.swing.JLabel" binding="errorNroInicial">
<constraints> <constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="2" 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> </constraints>
@@ -91,6 +133,16 @@
<visible value="false"/> <visible value="false"/>
</properties> </properties>
</component> </component>
<component id="ef90" class="javax.swing.JLabel" binding="errorNroFinal">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<foreground color="-65536"/>
<text value="Label"/>
<visible value="false"/>
</properties>
</component>
</children> </children>
</grid> </grid>
<grid id="ea865" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="ea865" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">

View File

@@ -44,6 +44,10 @@ public class IngresosView {
private JLabel errorTipoIngreso; private JLabel errorTipoIngreso;
private JLabel errorValor; private JLabel errorValor;
private JButton editarButton; private JButton editarButton;
private JTextField nroInicialField;
private JTextField nroFinalField;
private JLabel errorNroInicial;
private JLabel errorNroFinal;
private IngresosTableModel ingresosTableModel; private IngresosTableModel ingresosTableModel;
@@ -74,10 +78,6 @@ public class IngresosView {
return eliminarButton; return eliminarButton;
} }
public JButton getEditarButton() {
return editarButton;
}
public JTextField getTotalIngresoField() { public JTextField getTotalIngresoField() {
return totalIngresoField; return totalIngresoField;
} }
@@ -90,10 +90,6 @@ public class IngresosView {
return tipoCombo; return tipoCombo;
} }
public IngresosTableModel getIngresosTableModel() {
return ingresosTableModel;
}
public JLabel getErrorTipoIngreso() { public JLabel getErrorTipoIngreso() {
return errorTipoIngreso; return errorTipoIngreso;
} }
@@ -102,6 +98,30 @@ public class IngresosView {
return errorValor; return errorValor;
} }
public JButton getEditarButton() {
return editarButton;
}
public JTextField getNroInicialField() {
return nroInicialField;
}
public JTextField getNroFinalField() {
return nroFinalField;
}
public JLabel getErrorNroInicial() {
return errorNroInicial;
}
public JLabel getErrorNroFinal() {
return errorNroFinal;
}
public IngresosTableModel getIngresosTableModel() {
return ingresosTableModel;
}
{ {
// GUI initializer generated by IntelliJ IDEA GUI Designer // GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<< // >>> IMPORTANT!! <<<
@@ -128,39 +148,59 @@ public class IngresosView {
panel1.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); panel1.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
scrollPane1.setViewportView(ingresosTable); scrollPane1.setViewportView(ingresosTable);
final JPanel panel2 = new JPanel(); final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1)); panel2.setLayout(new GridLayoutManager(3, 4, new Insets(0, 0, 0, 0), -1, -1));
panel1.add(panel2, 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.add(panel2, 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));
final JLabel label1 = new JLabel(); final JLabel label1 = new JLabel();
label1.setText("Tipo"); label1.setText("Tipo");
panel2.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel2.add(label1, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label2 = new JLabel();
label2.setText("Valor");
panel2.add(label2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
valorField = new JTextField();
panel2.add(valorField, 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));
tipoCombo = new JComboBox(); tipoCombo = new JComboBox();
final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel(); final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();
tipoCombo.setModel(defaultComboBoxModel1); tipoCombo.setModel(defaultComboBoxModel1);
panel2.add(tipoCombo, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); panel2.add(tipoCombo, new GridConstraints(1, 3, 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 label2 = new JLabel();
label2.setText("Valor");
panel2.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
valorField = new JTextField();
panel2.add(valorField, new GridConstraints(1, 0, 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 label3 = new JLabel();
label3.setText("N° Inicial");
panel2.add(label3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label4 = new JLabel();
label4.setText("N° Final");
panel2.add(label4, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
nroInicialField = new JTextField();
panel2.add(nroInicialField, 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));
nroFinalField = new JTextField();
panel2.add(nroFinalField, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
errorTipoIngreso = new JLabel(); errorTipoIngreso = new JLabel();
errorTipoIngreso.setForeground(new Color(-65536)); errorTipoIngreso.setForeground(new Color(-65536));
errorTipoIngreso.setText("Label"); errorTipoIngreso.setText("Label");
errorTipoIngreso.setVisible(false); errorTipoIngreso.setVisible(false);
panel2.add(errorTipoIngreso, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel2.add(errorTipoIngreso, new GridConstraints(2, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
errorValor = new JLabel(); errorValor = new JLabel();
errorValor.setForeground(new Color(-65536)); errorValor.setForeground(new Color(-65536));
errorValor.setText("Label"); errorValor.setText("Label");
errorValor.setVisible(false); errorValor.setVisible(false);
panel2.add(errorValor, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel2.add(errorValor, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
errorNroInicial = new JLabel();
errorNroInicial.setForeground(new Color(-65536));
errorNroInicial.setText("Label");
errorNroInicial.setVisible(false);
panel2.add(errorNroInicial, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
errorNroFinal = new JLabel();
errorNroFinal.setForeground(new Color(-65536));
errorNroFinal.setText("Label");
errorNroFinal.setVisible(false);
panel2.add(errorNroFinal, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel(); final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); panel3.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
panel1.add(panel3, 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)); panel1.add(panel3, 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));
final JPanel panel4 = new JPanel(); final JPanel panel4 = new JPanel();
panel4.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); panel4.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
panel3.add(panel4, 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)); panel3.add(panel4, 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));
final JLabel label3 = new JLabel(); final JLabel label5 = new JLabel();
label3.setText("Total Ingresos"); label5.setText("Total Ingresos");
panel4.add(label3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel4.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
totalIngresoField = new JTextField(); totalIngresoField = new JTextField();
totalIngresoField.setEditable(false); totalIngresoField.setEditable(false);
panel4.add(totalIngresoField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); panel4.add(totalIngresoField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));

View File

@@ -35,7 +35,7 @@ public class IngresosTableModel extends AbstractTableModel {
public IngresosTableModel() { public IngresosTableModel() {
super(); super();
this.columns = new String[]{"Tipo", "Valor"}; this.columns = new String[]{"Valor", "N° Inicial", "N° Final", "Tipo"};
this.rows = new ArrayList<>(); this.rows = new ArrayList<>();
} }
@@ -72,9 +72,13 @@ public class IngresosTableModel extends AbstractTableModel {
public Object getValueAt(int row, int col) { public Object getValueAt(int row, int col) {
switch (col) { switch (col) {
case 0: case 0:
return this.rows.get(row).getTipoIngreso().getNombre();
case 1:
return this.rows.get(row).getValor(); return this.rows.get(row).getValor();
case 1:
return this.rows.get(row).getNroInicial();
case 2:
return this.rows.get(row).getNroFinal();
case 3:
return this.rows.get(row).getTipoIngreso().getNombre();
} }
return null; return null;
} }