Package org.salamanca.domain

Examples of org.salamanca.domain.CuotaBasica


            Vector v = new Vector(curso.
                                  getSetCuotaBasica());
            if ((v != null) && (v.size() > 0)) {
                Object[][] trabajo = new Object[v.size()][5];
                for (int i = 0; i < v.size(); i++) {
                    CuotaBasica cuota = (CuotaBasica) v.elementAt(i);
                    SimpleDateFormat dateFormatInicio = new SimpleDateFormat(
                            "d-M-yyyy");
                    trabajo[i][0] = dateFormatInicio.format(cuota.
                            getFechaVencimiento());
                    trabajo[i][1] = Double.valueOf(cuota.getImporte());
                    trabajo[i][2] = cuota.getConcepto();
                    trabajo[i][3] = Boolean.valueOf(cuota.isPagoExtra());
                    trabajo[i][4] = javax.jdo.JDOHelper.
                                    getObjectId(cuota).toString();
                }
                compomenteABMCListCuotas.setDatos(trabajo);
            }
View Full Code Here


    }


    public void compomenteABMCListCuotas_Insercion(InsertarEvent e) {
        CuotaBasica cuota = new CuotaBasica();
        SimpleDateFormat dateFechaVencimiento = new SimpleDateFormat("d-M-yyyy");
        String fechaVencimientoStr = (String) ((Vector) e.getVector()).
                                     elementAt(
                                             0);
        Date fechaVencimiento = null;

        try {
            fechaVencimiento = dateFechaVencimiento.parse(fechaVencimientoStr);
        } catch (ParseException ex1) {
            JOptionPane.showMessageDialog(this, "Fecha de vencimiento erronea");
            this.loadListCuotas();
            return;
        }

        double importe = ((Double) ((Vector) e.getVector()).elementAt(1)).
                         doubleValue();
        String concepto = (String) ((Vector) e.getVector()).elementAt(2);
        boolean esPagoExtra = ((Boolean) ((Vector) e.getVector()).elementAt(3)).
                              booleanValue();

        cuota.setFechaVencimiento(fechaVencimiento);
        cuota.setImporte(importe);
        cuota.setConcepto(concepto);
        cuota.setPagoExtra(esPagoExtra);

        ICommand insertarCuota = CommandFactory.createInsertarCuota(cuota, curso);
        try {
            insertarCuota.execute();
        } catch (Exception ex) {
View Full Code Here

    public void compomenteABMCListCuotas_Eliminacion(EliminarEvent e) {
        String oidStr = ((String) ((Vector) e.getVector()).elementAt(4));
        kodo.util.Id oid = new kodo.util.Id(oidStr);

        CuotaBasica cuota = (CuotaBasica) BrokerServer.instance().getPMF().
                            getPersistenceManager().getObjectById(oid,true);

        ICommand eiminarCuota = CommandFactory.createEliminarCuota(cuota);
        try {
            eiminarCuota.execute();
View Full Code Here

    public void compomenteABMCListCuotas_Modificacion(ModificarEvent e) {
        String oidStr = ((String) ((Vector) e.getVector()).elementAt(4));
        kodo.util.Id oid = new kodo.util.Id(oidStr);

        CuotaBasica cuota = (CuotaBasica) BrokerServer.instance().getPMF().
                            getPersistenceManager().getObjectById(oid,true);

        SimpleDateFormat dateFechaVencimiento = new SimpleDateFormat("d-M-yyyy");
        String fechaVencimientoStr = (String) ((Vector) e.getVector()).
                                     elementAt(
View Full Code Here

        }

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
        pm.currentTransaction().begin();
        CuotaBasica cuotaPM = (CuotaBasica) pm.getObjectById(javax.jdo.
                JDOHelper.
                getObjectId(this.cuota),true);
        cuotaPM.setConcepto(this.concepto);
        cuotaPM.setFechaVencimiento(this.fechaVencimiento);
        cuotaPM.setImporte(this.importe);
        cuotaPM.setPagoExtra(this.pagoExtra);

        pm.currentTransaction().commit();
    }
View Full Code Here

    public void execute() throws MessageException {

        PersistenceManager pm = BrokerServer.instance().getPMF().
                                getPersistenceManager();
        pm.currentTransaction().begin();
        CuotaBasica cuotaBasicaPM = (CuotaBasica) pm.getObjectById(javax.jdo.
                JDOHelper.getObjectId(cuota),true);
        if (cuotaBasicaPM.getSetPago().size() > 0) {
            throw new MessageException(
                    "Esta cuota ya tiene pagos realizados por alumnos "+
                    ", por lo tanto no se puede eliminar");
        }
        cuotaBasicaPM.getCurso().removeCuotaBasica(cuotaBasicaPM);
        pm.deletePersistent(cuotaBasicaPM);
        pm.currentTransaction().commit();
    }
View Full Code Here

            Vector v = new Vector(curso.
                                  getSetCuotaBasica());
            if ((v != null) && (v.size() > 0)) {
                Object[][] trabajo = new Object[v.size()][8];
                for (int i = 0; i < v.size(); i++) {
                    CuotaBasica cuota = (CuotaBasica) v.elementAt(i);

                    SimpleDateFormat dateFormatInicio = new SimpleDateFormat(
                            "d-M-yyyy");
                    trabajo[i][0] = dateFormatInicio.format(cuota.
                            getFechaVencimiento());
                    trabajo[i][1] = Boolean.valueOf(isCuotaPaga(cuota, alumno));
                    trabajo[i][2] = cuota.getConcepto();
                    trabajo[i][3] = Double.valueOf(cuota.getImporte());
                    trabajo[i][4] = Boolean.valueOf(cuota.isPagoExtra());
                    trabajo[i][5] = getFechaPago(cuota, alumno);
                    trabajo[i][6] = getNumeroFactura(cuota, alumno);
                    trabajo[i][7] = javax.jdo.JDOHelper.
                                    getObjectId(cuota).toString();
                }
View Full Code Here

    public CuotaBasicaComparator() {
    }

    public int compare(Object o1, Object o2) {

        CuotaBasica cuotaBasica1 = (CuotaBasica) o1;
        CuotaBasica cuotaBasica2 = (CuotaBasica) o2;

        return cuotaBasica1.getFechaVencimiento().compareTo(cuotaBasica2.
                getFechaVencimiento());
    }
View Full Code Here

        if (this.compomenteABMCListCuotasBasicas.getSelectedRow() != -1) {
            String oidStr = ((String) compomenteABMCListCuotasBasicas.
                             getSelectedRowData().
                             getValueAt(7));
            kodo.util.Id oid = new kodo.util.Id(oidStr);
            CuotaBasica cuotaBasica = (CuotaBasica) org.salamanca.broker.
                                      BrokerServer.instance().
                                      getPMF().getPersistenceManager().
                                      getObjectById(oid, true);
            return cuotaBasica;
View Full Code Here

        while (enumer.hasMoreElements()) {
            Curso itemCurso = (Curso) enumer.nextElement();
            double importeCurso = 0;
            Iterator iter = itemCurso.getSetCuotaBasica().iterator();
            while (iter.hasNext()) {
                CuotaBasica itemCuotaBasica = (CuotaBasica) iter.next();
                if ( itemCuotaBasica.getFechaVencimiento().before(dateFinCobro)) {
//esto significa que la cuota es cobrable porque ya venci�

//ahora averiguo por cada alumno si pag� o no la cuota


                    Iterator iterAlumnos = itemCurso.getSetAlumnos().iterator();
                    while (iterAlumnos.hasNext()) {
                        Alumno itemAlumno = (Alumno) iterAlumnos.next();

                        if (itemAlumno.isHabilitado()) {

                            boolean estaPagado = false;
                            Iterator iterPagos = itemAlumno.getSetPagos().
                                                 iterator();
                            while (iterPagos.hasNext()) {
                                Pago itemPago = (Pago) iterPagos.next();

                                if (!itemPago.isAnulado() &&
                                    javax.jdo.JDOHelper.getObjectId(itemPago.
                                        getCuotaPagada()).equals(
                                                javax.jdo.JDOHelper.getObjectId(
                                        itemCuotaBasica))) {
                                    //es la misma cuota pagada por lo tanto no es moroso
                                    estaPagado = true;
                                }

                            }

                            //si la cuota no est� pagada es un moroso de esa cuota
                            if (!estaPagado) {
                                AlumnoMorosoBean morosoBean = new
                                        AlumnoMorosoBean();
                                morosoBean.setNombreCurso(itemCurso.getNombre());
                                morosoBean.setApellidoAlumno(itemAlumno.
                                        getApellido());
                                morosoBean.setNombreAlumno(itemAlumno.getNombre());

                                morosoBean.setDni(itemAlumno.getDocumento());
                                morosoBean.setConceptoAdeuda(itemCuotaBasica.
                                        getConcepto());
                                SimpleDateFormat dateFormatInicio = new
                                        SimpleDateFormat(
                                                "d-M-yyyy");
                                morosoBean.setVencimiento(dateFormatInicio.
                                        format(
                                                itemCuotaBasica.
                                                getFechaVencimiento()));
                                morosoBean.setImporte(Double.valueOf(
                                        itemCuotaBasica.getImporte()).toString());
                                //agrego la mora al vector
                                vMorosos.add(morosoBean);
                            }
                        }
                    }
View Full Code Here

TOP

Related Classes of org.salamanca.domain.CuotaBasica

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.