Correccion de cosas .w. No estoy seguro que e hecho
This commit is contained in:
@@ -126,17 +126,7 @@ public class ArqueoController {
|
||||
*/
|
||||
private void updateResumenEfectivo() {
|
||||
NumberFormatedTextField efectivoField = this.view.getEfectivoField();
|
||||
int total = 0;
|
||||
total += this.efectivo.getDiez();
|
||||
total += this.efectivo.getCincuenta();
|
||||
total += this.efectivo.getCien();
|
||||
total += this.efectivo.getQuinientos();
|
||||
total += this.efectivo.getMil();
|
||||
total += this.efectivo.getDosMil();
|
||||
total += this.efectivo.getCincoMil();
|
||||
total += this.efectivo.getDiezMil();
|
||||
total += this.efectivo.getVeinteMil();
|
||||
|
||||
int total = efectivoDAO.getTotalEfectivo(this.caja);
|
||||
efectivoField.setValue(total);
|
||||
}
|
||||
|
||||
@@ -145,10 +135,7 @@ public class ArqueoController {
|
||||
*/
|
||||
private void updateResumenDocumentos() {
|
||||
NumberFormatedTextField documentosField = this.view.getDocumentosField();
|
||||
int total = 0;
|
||||
total += this.documentos.getCheques();
|
||||
total += this.documentos.getTarjetas();
|
||||
|
||||
int total = documentosDAO.getTotalDocumentos(this.caja);
|
||||
documentosField.setValue(total);
|
||||
}
|
||||
|
||||
@@ -164,10 +151,9 @@ public class ArqueoController {
|
||||
* Calcula los datos de arqueo, rendido y ajuste y los muestra en sus campos correspondientes
|
||||
*/
|
||||
private void updateResumenArqueo() {
|
||||
int totalEfectivo = this.view.getEfectivoField().getValue();
|
||||
int totalDocumentos = this.view.getDocumentosField().getValue();
|
||||
int totalEgresos = this.view.getEgresosField().getValue();
|
||||
|
||||
int totalEfectivo = efectivoDAO.getTotalEfectivo(this.caja);
|
||||
int totalDocumentos = documentosDAO.getTotalDocumentos(this.caja);
|
||||
int totalEgresos = egresoDAO.getTotalEgreso(this.caja);
|
||||
int totalIngresos = ingresoDAO.getTotalIngreso(this.caja);
|
||||
|
||||
int rendido = totalDocumentos + totalEfectivo + totalEgresos;
|
||||
@@ -253,19 +239,19 @@ public class ArqueoController {
|
||||
int diezMil = this.view.getDiezMilField().getValue();
|
||||
int veinteMil = this.view.getVeinteMilField().getValue();
|
||||
|
||||
this.efectivo.setDiez(diez);
|
||||
this.efectivo.setCincuenta(cincuenta);
|
||||
this.efectivo.setCien(cien);
|
||||
this.efectivo.setQuinientos(quinientos);
|
||||
this.efectivo.setMil(mil);
|
||||
this.efectivo.setDosMil(dosMil);
|
||||
this.efectivo.setCincoMil(cincoMil);
|
||||
this.efectivo.setDiezMil(diezMil);
|
||||
this.efectivo.setVeinteMil(veinteMil);
|
||||
this.efectivoDAO.updateEfectivo(efectivo);
|
||||
this.efectivo.setDiez(diez);
|
||||
this.efectivo.setCincuenta(cincuenta);
|
||||
this.efectivo.setCien(cien);
|
||||
this.efectivo.setQuinientos(quinientos);
|
||||
this.efectivo.setMil(mil);
|
||||
this.efectivo.setDosMil(dosMil);
|
||||
this.efectivo.setCincoMil(cincoMil);
|
||||
this.efectivo.setDiezMil(diezMil);
|
||||
this.efectivo.setVeinteMil(veinteMil);
|
||||
this.efectivoDAO.updateEfectivo(efectivo);
|
||||
|
||||
this.updateResumenEfectivo();
|
||||
this.updateResumenArqueo();
|
||||
this.updateResumenEfectivo();
|
||||
this.updateResumenArqueo();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -290,14 +290,12 @@ public class IngresosController {
|
||||
private boolean validateInput(String nroZInicial, String nroZFinal, String nroInicial, String nroFinal, TipoIngreso tipoIngreso, Caja caja) {
|
||||
this.hideErrorMessages();
|
||||
|
||||
boolean nroZInicialValidation = this.validateNroZInicial(nroZInicial);
|
||||
boolean nroZFinalValidation = this.validateNroZFinal(nroZFinal);
|
||||
boolean nroInicialValidation = this.validateNroInicial(nroInicial);
|
||||
boolean nroFinalValidation = this.validateNroFinal(nroFinal);
|
||||
boolean tipoIngresoValidation = this.validateTipoIngreso(tipoIngreso);
|
||||
boolean cajaValidation = this.validateCaja(caja);
|
||||
|
||||
return nroZInicialValidation && nroZFinalValidation && nroInicialValidation && nroFinalValidation && tipoIngresoValidation && cajaValidation;
|
||||
return nroInicialValidation && nroFinalValidation && tipoIngresoValidation && cajaValidation;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,50 +307,6 @@ public class IngresosController {
|
||||
return caja != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valida la variable nroInicial contra los casos
|
||||
* - Es null
|
||||
* - Esta vacio
|
||||
* Cuando el primer caso sea true, colocara un mensaje de error correspondiente en el jlabel correspondiente
|
||||
* @return Si cualquiera de estos casos son true se retornara false, si no, se retorna true
|
||||
*/
|
||||
private boolean validateNroZInicial(String nroZInicial){
|
||||
if (nroZInicial == null) {
|
||||
this.view.getErrorNroInicial().setText("Hubo un problema con los datos");
|
||||
this.view.getErrorNroInicial().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nroZInicial.isEmpty()) {
|
||||
this.view.getErrorNroInicial().setText("El campo esta vacio");
|
||||
this.view.getErrorNroInicial().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valida la variable nroFinal contra los casos
|
||||
* - Es null
|
||||
* - Esta vacio
|
||||
* Cuando el primer caso sea true, colocara un mensaje de error correspondiente en el jlabel correspondiente
|
||||
* @return Si cualquiera de estos casos son true se retornara false, si no, se retorna true
|
||||
*/
|
||||
private boolean validateNroZFinal(String nroZFinal){
|
||||
if (nroZFinal == null) {
|
||||
this.view.getErrorNroFinal().setText("Hubo un problema con los datos");
|
||||
this.view.getErrorNroFinal().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nroZFinal.isEmpty()) {
|
||||
this.view.getErrorNroFinal().setText("El campo esta vacio");
|
||||
this.view.getErrorNroFinal().setVisible(true);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valida la variable nroInicial contra los casos
|
||||
* - Es null
|
||||
@@ -417,8 +371,6 @@ public class IngresosController {
|
||||
*/
|
||||
private void hideErrorMessages() {
|
||||
this.view.getErrorTipoIngreso().setVisible(false);
|
||||
this.view.getErrorNroZInicial().setVisible(false);
|
||||
this.view.getErrorNroZFinal().setVisible(false);
|
||||
this.view.getErrorNroInicial().setVisible(false);
|
||||
this.view.getErrorNroFinal().setVisible(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user