diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index de9427e..6c497d4 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -11,10 +11,15 @@
-
-
-
+
+
+
+
+
+
+
+
@@ -57,6 +62,13 @@
+
+
+
+
+
+
+
@@ -71,48 +83,43 @@
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -183,14 +190,11 @@
@@ -301,22 +308,22 @@
-
+
-
-
+
-
+
+
@@ -327,6 +334,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -565,7 +583,8 @@
-
+
+
1545280618093
@@ -868,11 +887,18 @@
1547325551265
-
+
+ 1547327482896
+
+
+
+ 1547327482896
+
+
-
+
@@ -885,6 +911,7 @@
+
@@ -913,13 +940,48 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -977,7 +1039,6 @@
-
@@ -1002,43 +1063,14 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1067,62 +1099,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1190,20 +1166,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1229,48 +1191,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1393,32 +1313,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1488,13 +1382,6 @@
-
-
-
-
-
-
-
@@ -1506,18 +1393,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1547,8 +1422,8 @@
-
-
+
+
@@ -1562,29 +1437,209 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/database/sqlite.sql b/database/sqlite.sql
index 93f35dc..7d8eb0b 100644
--- a/database/sqlite.sql
+++ b/database/sqlite.sql
@@ -127,4 +127,9 @@ alter table ingresos add column nro_z_final text;
/**
Segunda migracion, se necesita un tipo de ingresos de boleta exenta
*/
- insert into tipos_ingreso (nombre) values ('Boleta Exenta')
+ insert into tipos_ingreso (nombre) values ('Boleta Exenta');
+
+ /**
+ Tercera migracion, necesidad de un campo de retiro en documentos
+ */
+ alter table documentos add column retiros integer default 0;
diff --git a/dist/caja.jar b/dist/caja.jar
index ac6be48..cd3fa78 100644
Binary files a/dist/caja.jar and b/dist/caja.jar differ
diff --git a/dist/database.sqlite b/dist/database.sqlite
deleted file mode 100644
index e69de29..0000000
diff --git a/src/danielcortes/xyz/controllers/ArqueoController.java b/src/danielcortes/xyz/controllers/ArqueoController.java
index 8a828c5..c1a7396 100644
--- a/src/danielcortes/xyz/controllers/ArqueoController.java
+++ b/src/danielcortes/xyz/controllers/ArqueoController.java
@@ -109,6 +109,7 @@ public class ArqueoController {
this.documentos = this.documentosDAO.findByCaja(caja);
this.view.getTarjetasField().setValue(documentos.getTarjetas());
this.view.getChequesField().setValue(documentos.getCheques());
+ this.view.getRetiroField().setValue(documentos.getRetiros());
}
/**
@@ -197,9 +198,12 @@ public class ArqueoController {
this.view.getChequesField().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"),"nextField");
- this.view.getTarjetasField().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"),"save");
+ this.view.getTarjetasField().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"),"nextField");
+ this.view.getRetiroField().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"),"save");
+
this.view.getChequesField().getActionMap().put("nextField", new NextAction(this.view.getTarjetasField()));
- this.view.getTarjetasField().getActionMap().put("save", new GuardarDocumentosAction(this));
+ this.view.getTarjetasField().getActionMap().put("nextField", new NextAction(this.view.getRetiroField()));
+ this.view.getRetiroField().getActionMap().put("save", new GuardarDocumentosAction(this));
this.view.getGuardarEfectivoButton().addActionListener(e ->{
this.guardarEfectivoActionListener();
@@ -266,9 +270,11 @@ public class ArqueoController {
private void guardarDocumentos() {
int tarjetas = this.view.getTarjetasField().getValue();
int cheques = this.view.getChequesField().getValue();
+ int retiros = this.view.getRetiroField().getValue();
this.documentos.setTarjetas(tarjetas);
this.documentos.setCheques(cheques);
+ this.documentos.setRetiros(retiros);
this.documentosDAO.updateDocumentos(documentos);
this.updateResumenDocumentos();
diff --git a/src/danielcortes/xyz/models/documentos/Documentos.java b/src/danielcortes/xyz/models/documentos/Documentos.java
index b030bb7..12268dc 100644
--- a/src/danielcortes/xyz/models/documentos/Documentos.java
+++ b/src/danielcortes/xyz/models/documentos/Documentos.java
@@ -30,6 +30,7 @@ public class Documentos {
private int id;
private int cheques;
private int tarjetas;
+ private int retiros;
private Caja caja;
public int getId() {
@@ -56,6 +57,14 @@ public class Documentos {
this.tarjetas = tarjetas;
}
+ public int getRetiros() {
+ return retiros;
+ }
+
+ public void setRetiros(int retiros) {
+ this.retiros = retiros;
+ }
+
public Caja getCaja() {
return caja;
}
diff --git a/src/danielcortes/xyz/models/documentos/DocumentosDAO.java b/src/danielcortes/xyz/models/documentos/DocumentosDAO.java
index e6e59bc..ebcc0b4 100644
--- a/src/danielcortes/xyz/models/documentos/DocumentosDAO.java
+++ b/src/danielcortes/xyz/models/documentos/DocumentosDAO.java
@@ -60,6 +60,7 @@ public abstract class DocumentosDAO {
documentos.setId(rs.getInt("id"));
documentos.setCheques(rs.getInt("cheques"));
documentos.setTarjetas(rs.getInt("tarjetas"));
+ documentos.setRetiros(rs.getInt("retiros"));
documentosList.add(documentos);
}
diff --git a/src/danielcortes/xyz/models/documentos/SQLiteDocumentosDAO.java b/src/danielcortes/xyz/models/documentos/SQLiteDocumentosDAO.java
index bdcb64c..e3e3894 100644
--- a/src/danielcortes/xyz/models/documentos/SQLiteDocumentosDAO.java
+++ b/src/danielcortes/xyz/models/documentos/SQLiteDocumentosDAO.java
@@ -114,10 +114,11 @@ public class SQLiteDocumentosDAO extends DocumentosDAO {
int updates;
try {
Connection conn = connectionHolder.getConnection();
- PreparedStatement ps = conn.prepareStatement("insert into documentos (cheques, tarjetas, caja_id) values (?,?,?)");
+ PreparedStatement ps = conn.prepareStatement("insert into documentos (cheques, tarjetas, retiros, caja_id) values (?,?,?,?)");
ps.setInt(1, documentos.getCheques());
ps.setInt(2, documentos.getTarjetas());
- ps.setInt(3, documentos.getCaja().getId());
+ ps.setInt(3, documentos.getRetiros());
+ ps.setInt(4, documentos.getCaja().getId());
updates = ps.executeUpdate();
ps.close();
@@ -142,7 +143,7 @@ public class SQLiteDocumentosDAO extends DocumentosDAO {
int updates;
try {
Connection conn = connectionHolder.getConnection();
- PreparedStatement ps = conn.prepareStatement("insert into documentos (cheques, tarjetas, caja_id) values (0,0,?)");
+ PreparedStatement ps = conn.prepareStatement("insert into documentos (cheques, tarjetas, retiros, caja_id) values (0,0,0,?)");
ps.setInt(1, documentos.getCaja().getId());
updates = ps.executeUpdate();
@@ -168,11 +169,12 @@ public class SQLiteDocumentosDAO extends DocumentosDAO {
int updates;
try {
Connection conn = connectionHolder.getConnection();
- PreparedStatement ps = conn.prepareStatement("update documentos set tarjetas = ?, cheques = ?, caja_id = ? where id = ?");
+ PreparedStatement ps = conn.prepareStatement("update documentos set tarjetas = ?, cheques = ?, retiros = ?, caja_id = ? where id = ?");
ps.setInt(1, documentos.getTarjetas());
ps.setInt(2, documentos.getCheques());
- ps.setInt(3, documentos.getCaja().getId());
- ps.setInt(4, documentos.getId());
+ ps.setInt(3, documentos.getRetiros());
+ ps.setInt(4, documentos.getCaja().getId());
+ ps.setInt(5, documentos.getId());
updates = ps.executeUpdate();
ps.close();
@@ -208,7 +210,7 @@ public class SQLiteDocumentosDAO extends DocumentosDAO {
int total = 0;
try {
Connection conn = connectionHolder.getConnection();
- PreparedStatement ps = conn.prepareStatement("select cheques + tarjetas from documentos where caja_id = ?");
+ PreparedStatement ps = conn.prepareStatement("select cheques + tarjetas + retiros from documentos where caja_id = ?");
ps.setInt(1, caja.getId());
ResultSet rs = ps.executeQuery();
diff --git a/src/danielcortes/xyz/views/ArqueoView.form b/src/danielcortes/xyz/views/ArqueoView.form
index 78cca37..e2a904f 100644
--- a/src/danielcortes/xyz/views/ArqueoView.form
+++ b/src/danielcortes/xyz/views/ArqueoView.form
@@ -335,7 +335,7 @@
-
+
@@ -357,7 +357,7 @@
-
+
@@ -375,7 +375,7 @@
-
+
@@ -389,6 +389,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/danielcortes/xyz/views/ArqueoView.java b/src/danielcortes/xyz/views/ArqueoView.java
index fe0b69c..a8b67c5 100644
--- a/src/danielcortes/xyz/views/ArqueoView.java
+++ b/src/danielcortes/xyz/views/ArqueoView.java
@@ -55,6 +55,7 @@ public class ArqueoView {
private JButton guardarDocumentosButton;
private NumberFormatedTextField diferenciaField;
private NumberFormatedTextField debeRendirField;
+ private NumberFormatedTextField retiroField;
public JPanel getContentPanel() {
return contentPanel;
@@ -136,6 +137,10 @@ public class ArqueoView {
return debeRendirField;
}
+ public NumberFormatedTextField getRetiroField() {
+ return retiroField;
+ }
+
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
@@ -272,7 +277,7 @@ public class ArqueoView {
guardarEfectivoButton.setText("Guardar");
panel3.add(guardarEfectivoButton, new GridConstraints(9, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(200, -1), null, 0, false));
final JPanel panel4 = new JPanel();
- panel4.setLayout(new GridLayoutManager(3, 2, new Insets(10, 10, 10, 10), -1, -1));
+ panel4.setLayout(new GridLayoutManager(4, 2, new Insets(10, 10, 10, 10), -1, -1));
panel2.add(panel4, 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));
panel4.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Detalle Documentos", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, -1, -1, panel4.getFont())));
chequesField = new NumberFormatedTextField();
@@ -280,16 +285,22 @@ public class ArqueoView {
panel4.add(chequesField, 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));
final JLabel label16 = new JLabel();
label16.setText("Tarjetas de Credito");
- panel4.add(label16, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
+ panel4.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));
tarjetasField = new NumberFormatedTextField();
tarjetasField.setText("");
panel4.add(tarjetasField, 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));
guardarDocumentosButton = new JButton();
guardarDocumentosButton.setText("Guardar");
- panel4.add(guardarDocumentosButton, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
+ panel4.add(guardarDocumentosButton, new GridConstraints(3, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label17 = new JLabel();
label17.setText("Cheques al Dia");
panel4.add(label17, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
+ retiroField = new NumberFormatedTextField();
+ retiroField.setText("");
+ panel4.add(retiroField, 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 label18 = new JLabel();
+ label18.setText("Retiro");
+ panel4.add(label18, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, 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));
}