Agregado en documentos el campo de retiros
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -335,7 +335,7 @@
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="1ca11" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="1ca11" layout-manager="GridLayoutManager" row-count="4" 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"/>
|
||||
@@ -357,7 +357,7 @@
|
||||
</component>
|
||||
<component id="d49a7" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" 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="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="Tarjetas de Credito"/>
|
||||
@@ -375,7 +375,7 @@
|
||||
</component>
|
||||
<component id="1681b" class="javax.swing.JButton" binding="guardarDocumentosButton">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Guardar"/>
|
||||
@@ -389,6 +389,24 @@
|
||||
<text value="Cheques al Dia"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="cc416" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="retiroField">
|
||||
<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>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="563f5" 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="Retiro"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user