Se creo una fila en la tabla de cajas en la que se almacena el fondo de esta, la cual sera mostrada en la vista de calcular fondo, donde sera actualizada segun diga el usuario

This commit is contained in:
Daniel Cortes
2019-02-20 14:06:58 -03:00
parent 08da94aba4
commit e7eb6513dd
14 changed files with 101 additions and 78 deletions

8
.gitignore vendored
View File

@@ -1,9 +1,7 @@
out out
lib lib
.idea .idea
dist/local-release/data dist/data
dist/local-release/logs dist/logs
dist/local-release/informes dist/informes
dist/mackena-release
dist/rodriguez-release

View File

@@ -167,3 +167,7 @@ create table estado_resultado
ppm real null, ppm real null,
ivaFavor int null ivaFavor int null
); );
-- Sexta migracion, se necesita guardar el fondo diario de una caja asi que se le agrega a la tabla de caja
alter table caja
add column fondo integer default 0;

View File

@@ -34,7 +34,6 @@ import danielcortes.xyz.views.components.NumberFormatedTextField;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
/** /**
* Controlador destinado a la vista ArqueoView * Controlador destinado a la vista ArqueoView
@@ -203,7 +202,9 @@ public class ArqueoController extends BaseController{
* Lanza la ventana en la que se puede calcular el fondo de la caja. * Lanza la ventana en la que se puede calcular el fondo de la caja.
*/ */
private void calcularFondoActionListener() { private void calcularFondoActionListener() {
new CalcularFondoController(this.view.getContentPanel(), new CalcularFondoView(), this.caja); CalcularFondoView view = new CalcularFondoView();
CalcularFondoController controller = new CalcularFondoController(view, this.caja);
launchFrame(view.getContentPanel(), "Calcular Fondo");
} }
/** /**
@@ -254,18 +255,4 @@ public class ArqueoController extends BaseController{
this.updateResumenArqueo(); this.updateResumenArqueo();
} }
private class GuardarEfectivoAction extends AbstractAction {
@Override
public void actionPerformed(ActionEvent e) {
ArqueoController.this.guardarEfectivoActionListener();
}
}
private class GuardarDocumentosAction extends AbstractAction {
@Override
public void actionPerformed(ActionEvent e) {
ArqueoController.this.guardarDocumentosActionListener();
}
}
} }

View File

@@ -20,7 +20,17 @@ class BaseController {
target.getActionMap().put(name, action); target.getActionMap().put(name, action);
} }
private void launchFrame(JComponent view, String title, Dimension d){ static void launchFrame(JComponent view, String title) {
JFrame frame = new JFrame(title + ": " + Configuration.get("nombre_caja"));
frame.setContentPane(view);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
static void launchFrame(JComponent view, String title, Dimension d){
JFrame frame = new JFrame(title + ": " + Configuration.get("nombre_caja")); JFrame frame = new JFrame(title + ": " + Configuration.get("nombre_caja"));
frame.setContentPane(view); frame.setContentPane(view);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

View File

@@ -1,6 +1,5 @@
package danielcortes.xyz.controllers; package danielcortes.xyz.controllers;
import danielcortes.xyz.data.Configuration;
import danielcortes.xyz.data.DAOManager; import danielcortes.xyz.data.DAOManager;
import danielcortes.xyz.models.caja.Caja; import danielcortes.xyz.models.caja.Caja;
import danielcortes.xyz.models.calculo_fondo.CalculoFondo; import danielcortes.xyz.models.calculo_fondo.CalculoFondo;
@@ -8,12 +7,10 @@ import danielcortes.xyz.views.CalcularFondoView;
import danielcortes.xyz.views.components.table_model.FondoTableModel; import danielcortes.xyz.views.components.table_model.FondoTableModel;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
public class CalcularFondoController extends BaseController{ public class CalcularFondoController extends BaseController{
private JComponent parent;
private CalcularFondoView view; private CalcularFondoView view;
private Caja caja; private Caja caja;
@@ -21,25 +18,15 @@ public class CalcularFondoController extends BaseController{
private boolean editing; private boolean editing;
private CalculoFondo editingCalculoFondo; private CalculoFondo editingCalculoFondo;
public CalcularFondoController(JComponent parent, CalcularFondoView view, Caja caja) { public CalcularFondoController(CalcularFondoView view, Caja caja) {
this.view = view; this.view = view;
this.parent = parent;
this.caja = caja; this.caja = caja;
this.fillTable(); this.fillTable();
this.fillResumen();
this.updateResumen(); this.updateResumen();
this.setupViewEvents(); this.setupViewEvents();
this.updateButtonsEnabled(); this.updateButtonsEnabled();
this.showView();
}
private void showView() {
JFrame frame = new JFrame("Calculo de Fondo: " + Configuration.get("nombre_caja"));
frame.setContentPane(view.getContentPanel());
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(this.parent);
frame.setVisible(true);
} }
private void fillTable() { private void fillTable() {
@@ -50,6 +37,20 @@ public class CalcularFondoController extends BaseController{
} }
} }
private void fillResumen() {
this.view.getFondoField().setValue(this.caja.getFondo());
}
private void updateResumen() {
this.caja.setFondo(this.view.getFondoField().getValue());
int suma = DAOManager.getCalculoFondoDAO().getTotalCalculoFondo(this.caja);
this.view.getSumaField().setValue(suma);
this.view.getDepositoField().setValue(suma - this.caja.getFondo());
DAOManager.getCajaDAO().updateCaja(this.caja);
}
private void setupViewEvents() { private void setupViewEvents() {
moveTo(this.view.getValorField(), this.view.getDescripcionField()); moveTo(this.view.getValorField(), this.view.getDescripcionField());
doAction(this.view.getDescripcionField(), "save", KeyStroke.getKeyStroke("ENTER"), e -> this.guardarActionListener()); doAction(this.view.getDescripcionField(), "save", KeyStroke.getKeyStroke("ENTER"), e -> this.guardarActionListener());
@@ -142,12 +143,6 @@ public class CalcularFondoController extends BaseController{
} }
} }
private void updateResumen() {
int fondo = this.view.getFondoField().getValue();
int suma = DAOManager.getCalculoFondoDAO().getTotalCalculoFondo(this.caja);
this.view.getSumaField().setValue(suma);
this.view.getDepositoField().setValue(suma - fondo);
}
private void cleanInput() { private void cleanInput() {
this.view.getValorField().setValue(0); this.view.getValorField().setValue(0);
@@ -166,11 +161,4 @@ public class CalcularFondoController extends BaseController{
private void resetFocus() { private void resetFocus() {
this.view.getValorField().requestFocus(); this.view.getValorField().requestFocus();
} }
private class UpdateResumenAction extends AbstractAction {
@Override
public void actionPerformed(ActionEvent e) {
CalcularFondoController.this.updateResumen();
}
}
} }

View File

@@ -148,7 +148,7 @@ public class EstadoResultadoController extends BaseController{
private void fillGastosOperacionales() { private void fillGastosOperacionales() {
TipoEgreso tipoPagoPartime = DAOManager.getTipoEgresoDAO().findByNombre("Pago Partime").get(0); TipoEgreso tipoPagoPartime = DAOManager.getTipoEgresoDAO().findByNombre("Pago Partime").get(0);
int costosVenta = this.estadoResultado.getCostoVenta(); int costoVenta = this.estadoResultado.getCostoVenta();
int remuneraciones = this.estadoResultado.getRemuneraciones(); int remuneraciones = this.estadoResultado.getRemuneraciones();
int finiquitos = this.estadoResultado.getFiniquitos(); int finiquitos = this.estadoResultado.getFiniquitos();
int aguinaldo = this.estadoResultado.getAguinaldo(); int aguinaldo = this.estadoResultado.getAguinaldo();
@@ -156,11 +156,14 @@ public class EstadoResultadoController extends BaseController{
int honorariosContador = this.estadoResultado.getHonorariosContador(); int honorariosContador = this.estadoResultado.getHonorariosContador();
int arriendo = this.estadoResultado.getArriendo(); int arriendo = this.estadoResultado.getArriendo();
int partime = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, tipoPagoPartime); int partime = DAOManager.getEgresoDAO().getTotalEgresoMesPorTipo(this.mes, tipoPagoPartime);
int ventaBruta = DAOManager.getIngresoDAO().getTotalIngresoMes(this.mes);
int total = costosVenta + remuneraciones + finiquitos + aguinaldo + bonosPersonal int total = costoVenta + remuneraciones + finiquitos + aguinaldo + bonosPersonal
+ honorariosContador + arriendo + partime; + honorariosContador + arriendo + partime;
double porcentajeCostoVenta = (double) costoVenta / (double)ventaBruta * 100d;
this.view.getGastosOperacionalesCostoVenta().setValue(costosVenta); this.view.getGastosOperacionalesCostoVenta().setValue(costoVenta);
this.view.getGastosOperacionesPorcentajeCostoVenta().setValue(porcentajeCostoVenta);
this.view.getGastosOperacionalesRemuneraciones().setValue(remuneraciones); this.view.getGastosOperacionalesRemuneraciones().setValue(remuneraciones);
this.view.getGastosOperacionalesFiniquitos().setValue(finiquitos); this.view.getGastosOperacionalesFiniquitos().setValue(finiquitos);
this.view.getGastosOperacionalesAguinaldo().setValue(aguinaldo); this.view.getGastosOperacionalesAguinaldo().setValue(aguinaldo);
@@ -269,6 +272,8 @@ public class EstadoResultadoController extends BaseController{
int honorarios = this.view.getGastosOperacionalesHonorariosContador().getValue(); int honorarios = this.view.getGastosOperacionalesHonorariosContador().getValue();
int arriendo = this.view.getGastosOperacionalesArriendo().getValue(); int arriendo = this.view.getGastosOperacionalesArriendo().getValue();
int ventaBruta = DAOManager.getIngresoDAO().getTotalIngresoMes(this.mes);
this.estadoResultado.setCostoVenta(costoVenta); this.estadoResultado.setCostoVenta(costoVenta);
this.estadoResultado.setRemuneraciones(remuneraciones); this.estadoResultado.setRemuneraciones(remuneraciones);
this.estadoResultado.setFiniquitos(finiquitos); this.estadoResultado.setFiniquitos(finiquitos);
@@ -280,8 +285,10 @@ public class EstadoResultadoController extends BaseController{
int total = oldTotal int total = oldTotal
- (oldCostoVenta + oldRemuneraciones + oldFiniquitos + oldAguinaldo + oldBonos + oldHonorarios + oldArriendo) - (oldCostoVenta + oldRemuneraciones + oldFiniquitos + oldAguinaldo + oldBonos + oldHonorarios + oldArriendo)
+ (costoVenta + remuneraciones + finiquitos + aguinaldo + bonos + honorarios + arriendo); + (costoVenta + remuneraciones + finiquitos + aguinaldo + bonos + honorarios + arriendo);
double porcentajeCostoVenta = (double) costoVenta / (double)ventaBruta * 100d;
this.view.getGastosOperacionalesTotal().setValue(total); this.view.getGastosOperacionalesTotal().setValue(total);
this.view.getGastosOperacionesPorcentajeCostoVenta().setValue(porcentajeCostoVenta);
this.updateResumen(); this.updateResumen();
} }

View File

@@ -29,6 +29,7 @@ import java.time.LocalDate;
public class Caja { public class Caja {
private int id; private int id;
private LocalDate fecha; private LocalDate fecha;
private int fondo;
public int getId() { public int getId() {
return id; return id;
@@ -46,6 +47,14 @@ public class Caja {
this.fecha = fecha; this.fecha = fecha;
} }
public int getFondo() {
return fondo;
}
public void setFondo(int fondo) {
this.fondo = fondo;
}
@Override @Override
public String toString() { public String toString() {
return "Caja{" + return "Caja{" +

View File

@@ -57,6 +57,7 @@ public abstract class CajaDAO {
Caja caja = new Caja(); Caja caja = new Caja();
caja.setId(rs.getInt("id")); caja.setId(rs.getInt("id"));
caja.setFecha(LocalDate.parse(rs.getString("fecha"))); caja.setFecha(LocalDate.parse(rs.getString("fecha")));
caja.setFondo(rs.getInt("fondo"));
cajaList.add(caja); cajaList.add(caja);
LOGGER.log(Level.FINER, "Se a creo: {0}", caja); LOGGER.log(Level.FINER, "Se a creo: {0}", caja);

View File

@@ -121,16 +121,16 @@ public class SQLiteCajaDAO extends CajaDAO {
public boolean insertCaja(Caja caja) { public boolean insertCaja(Caja caja) {
int updates; int updates;
try (Connection conn = connectionHolder.getConnection()) { try (Connection conn = connectionHolder.getConnection()) {
String query = "insert into caja (fecha) values (?)"; String query = "insert into caja (fecha, fondo) values (?, ?)";
PreparedStatement ps = conn.prepareStatement(query); PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, caja.getFecha().toString()); ps.setString(1, caja.getFecha().toString());
ps.setInt(2, caja.getFondo());
updates = ps.executeUpdate(); updates = ps.executeUpdate();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1} | updates: {2}", new Object[]{query, caja.getFecha(), updates}); LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}, {2} | updates: {3}", new Object[]{query, caja.getFecha(), caja.getFondo(), updates});
ps.close(); ps.close();
query = "select last_insert_rowid()"; query = "select last_insert_rowid()";
ps = conn.prepareStatement("select last_insert_rowid()"); ps = conn.prepareStatement("select last_insert_rowid()");
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
@@ -153,13 +153,14 @@ public class SQLiteCajaDAO extends CajaDAO {
public boolean updateCaja(Caja caja) { public boolean updateCaja(Caja caja) {
int updates; int updates;
try (Connection conn = connectionHolder.getConnection()) { try (Connection conn = connectionHolder.getConnection()) {
String query = "update caja set fecha = ? where id = ?"; String query = "update caja set fecha = ?, fondo = ? where id = ?";
PreparedStatement ps = conn.prepareStatement(query); PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, caja.getFecha().toString()); ps.setString(1, caja.getFecha().toString());
ps.setInt(2, caja.getId()); ps.setInt(2, caja.getFondo());
ps.setInt(3, caja.getId());
updates = ps.executeUpdate(); updates = ps.executeUpdate();
LOGGER.log(Level.FINE, "QUERY: {0} | values: [{1},{2} | updates: {3}]", new Object[]{query, caja.getFecha(), caja.getId(), updates}); LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}, {2}, {3} | updates: {4}", new Object[]{query, caja.getFecha(), caja.getFondo(), caja.getId(), updates});
ps.close(); ps.close();

View File

@@ -3,7 +3,7 @@
<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"> <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"/> <margin top="10" left="10" bottom="10" right="10"/>
<constraints> <constraints>
<xy x="20" y="20" width="1065" height="949"/> <xy x="20" y="20" width="1199" height="949"/>
</constraints> </constraints>
<properties/> <properties/>
<border type="none"/> <border type="none"/>
@@ -329,7 +329,7 @@
</component> </component>
</children> </children>
</grid> </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"> <grid id="8ea34" layout-manager="GridLayoutManager" row-count="10" column-count="3" 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="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"/> <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"/>
@@ -411,7 +411,7 @@
</component> </component>
<component id="b218a" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesRemuneraciones"> <component id="b218a" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesRemuneraciones">
<constraints> <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"> <grid row="1" column="1" row-span="1" col-span="2" 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>
@@ -419,7 +419,7 @@
</component> </component>
<component id="8618e" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesFiniquitos"> <component id="8618e" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesFiniquitos">
<constraints> <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"> <grid row="2" column="1" row-span="1" col-span="2" 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>
@@ -427,7 +427,7 @@
</component> </component>
<component id="a05d5" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesAguinaldo"> <component id="a05d5" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesAguinaldo">
<constraints> <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"> <grid row="3" column="1" row-span="1" col-span="2" 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>
@@ -435,7 +435,7 @@
</component> </component>
<component id="ca573" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesPartime"> <component id="ca573" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesPartime">
<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="4" column="1" row-span="1" col-span="2" 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>
@@ -445,7 +445,7 @@
</component> </component>
<component id="62ef2" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesBonos"> <component id="62ef2" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesBonos">
<constraints> <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"> <grid row="5" column="1" row-span="1" col-span="2" 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>
@@ -453,7 +453,7 @@
</component> </component>
<component id="40436" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesHonorariosContador"> <component id="40436" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesHonorariosContador">
<constraints> <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"> <grid row="6" column="1" row-span="1" col-span="2" 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>
@@ -461,7 +461,7 @@
</component> </component>
<component id="6878a" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesArriendo"> <component id="6878a" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesArriendo">
<constraints> <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"> <grid row="7" column="1" row-span="1" col-span="2" 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>
@@ -477,7 +477,7 @@
</component> </component>
<component id="f6000" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesTotal"> <component id="f6000" class="danielcortes.xyz.views.components.NumberFormatedTextField" binding="gastosOperacionalesTotal">
<constraints> <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"> <grid row="9" column="1" row-span="1" col-span="2" 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>
@@ -490,6 +490,15 @@
<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"/> <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> </constraints>
</vspacer> </vspacer>
<component id="c34ff" class="danielcortes.xyz.views.components.DoubleFormatedTextField" binding="gastosOperacionesPorcentajeCostoVenta">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<columns value="6"/>
<editable value="false"/>
</properties>
</component>
</children> </children>
</grid> </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"> <grid id="9aa5a" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">

View File

@@ -54,6 +54,7 @@ public class EstadoResultadoView {
private DoubleFormatedTextField resumenPPM; private DoubleFormatedTextField resumenPPM;
private JButton guardarButton; private JButton guardarButton;
private JButton exportarButton; private JButton exportarButton;
private DoubleFormatedTextField gastosOperacionesPorcentajeCostoVenta;
private ArrayList<String> months; private ArrayList<String> months;
@@ -137,6 +138,10 @@ public class EstadoResultadoView {
return gastosOperacionalesTotal; return gastosOperacionalesTotal;
} }
public DoubleFormatedTextField getGastosOperacionesPorcentajeCostoVenta() {
return gastosOperacionesPorcentajeCostoVenta;
}
public NumberFormatedTextField getServiciosAgua() { public NumberFormatedTextField getServiciosAgua() {
return serviciosAgua; return serviciosAgua;
} }
@@ -346,7 +351,7 @@ public class EstadoResultadoView {
exportarButton.setText("Exportar"); exportarButton.setText("Exportar");
panel3.add(exportarButton, new GridConstraints(0, 5, 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)); panel3.add(exportarButton, new GridConstraints(0, 5, 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 JPanel panel4 = new JPanel(); final JPanel panel4 = new JPanel();
panel4.setLayout(new GridLayoutManager(10, 2, new Insets(10, 10, 10, 10), -1, -1)); panel4.setLayout(new GridLayoutManager(10, 3, 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)); 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 Operacionales")); panel4.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Gastos Operacionales"));
final JLabel label15 = new JLabel(); final JLabel label15 = new JLabel();
@@ -376,28 +381,32 @@ public class EstadoResultadoView {
gastosOperacionalesCostoVenta = new NumberFormatedTextField(); gastosOperacionalesCostoVenta = new NumberFormatedTextField();
panel4.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)); panel4.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(); gastosOperacionalesRemuneraciones = new NumberFormatedTextField();
panel4.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)); panel4.add(gastosOperacionalesRemuneraciones, new GridConstraints(1, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesFiniquitos = new NumberFormatedTextField(); gastosOperacionalesFiniquitos = new NumberFormatedTextField();
panel4.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)); panel4.add(gastosOperacionalesFiniquitos, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesAguinaldo = new NumberFormatedTextField(); gastosOperacionalesAguinaldo = new NumberFormatedTextField();
panel4.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)); panel4.add(gastosOperacionalesAguinaldo, new GridConstraints(3, 1, 1, 2, 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 = new NumberFormatedTextField();
gastosOperacionalesPartime.setEditable(false); gastosOperacionalesPartime.setEditable(false);
panel4.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)); panel4.add(gastosOperacionalesPartime, new GridConstraints(4, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesBonos = new NumberFormatedTextField(); gastosOperacionalesBonos = new NumberFormatedTextField();
panel4.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)); panel4.add(gastosOperacionalesBonos, new GridConstraints(5, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesHonorariosContador = new NumberFormatedTextField(); gastosOperacionalesHonorariosContador = new NumberFormatedTextField();
panel4.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)); panel4.add(gastosOperacionalesHonorariosContador, new GridConstraints(6, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
gastosOperacionalesArriendo = new NumberFormatedTextField(); gastosOperacionalesArriendo = new NumberFormatedTextField();
panel4.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)); panel4.add(gastosOperacionalesArriendo, new GridConstraints(7, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label23 = new JLabel(); final JLabel label23 = new JLabel();
label23.setText("Total:"); label23.setText("Total:");
panel4.add(label23, new GridConstraints(9, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel4.add(label23, 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 = new NumberFormatedTextField();
gastosOperacionalesTotal.setEditable(false); gastosOperacionalesTotal.setEditable(false);
panel4.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)); panel4.add(gastosOperacionalesTotal, new GridConstraints(9, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final Spacer spacer4 = new Spacer(); final Spacer spacer4 = new Spacer();
panel4.add(spacer4, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); panel4.add(spacer4, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
gastosOperacionesPorcentajeCostoVenta = new DoubleFormatedTextField();
gastosOperacionesPorcentajeCostoVenta.setColumns(6);
gastosOperacionesPorcentajeCostoVenta.setEditable(false);
panel4.add(gastosOperacionesPorcentajeCostoVenta, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel5 = new JPanel(); final JPanel panel5 = new JPanel();
panel5.setLayout(new GridLayoutManager(7, 2, new Insets(10, 10, 10, 10), -1, -1)); panel5.setLayout(new GridLayoutManager(7, 2, new Insets(10, 10, 10, 10), -1, -1));
contentPanel.add(panel5, 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(panel5, 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));