Пример #1
0
        private void CargarCampos()
        {
            SocioImplement oSocioImplement = new SocioImplement();

            this.lbCampos.DisplayMember = "column_name";
            this.lbCampos.ValueMember = "data_type";
            this.lbCampos.DataSource = oSocioImplement.GetAllCampos();
        }
Пример #2
0
 private void Buscar()
 {
     if (this.cmbInstruccion.SelectedValue != null)
     {
         SocioImplement oSocioImplement = new SocioImplement();
         int idCampo = ((com.cooperativa.services.Item)(this.lbCampos.SelectedValue)).Value;
         this.dgvSocios.DataSource = oSocioImplement.SocioGetAllByOrder(int.Parse(this.cmbInstruccion.SelectedValue.ToString()), idCampo, this.txtBusqueda.Text);
     }
 }
Пример #3
0
 private void Inicializar()
 {
     socios oSocio = new socios();
     SocioImplement oSocioImplement = new SocioImplement();
     oSocio = oSocioImplement.Get(_idSocio);
     this.mtxtNumero.Text = oSocio.codigo_socio + "-" + oSocio.subcodigo_socio;
     this.txtNombre.Text = oSocio.nombre;
     CargarGrilla();
 }
Пример #4
0
 private void Inicializar()
 {
     socios oSocio = new socios();
     SocioImplement oSocioImplement = new SocioImplement();
     SocioConexionImplement oSocioConexionImplement = new SocioConexionImplement();
     oSocio = oSocioImplement.Get(_idSocio);
     this.txtCodigoSocio.Text = oSocio.codigo_socio;
     this.txtSubcodigoSocio.Text= oSocio.subcodigo_socio;
     this.txtNombreSocio.Text = oSocio.nombre;
     this.txtMedidor.Text = oSocioConexionImplement.Get(_idSocio).medidor;
     CargarGrilla();
 }
Пример #5
0
        public decimal CalcularIVA(int idFactura)
        {
            using (cooperativaEntities bd = new cooperativaEntities())
            {
                Commons oCommons = new Commons();
                var detallesByFact = (from d in bd.facturas_detalles
                                      join c in bd.cod_conceptos on d.id_concepto equals c.id_concepto
                                      where d.id_factura == idFactura
                                      select new
                                      {
                                          d.id_factura,
                                          d.id_detalle,
                                          d.id_concepto,
                                          d.idOrden,
                                          d.idTipo,
                                          d.importe,
                                          c.id_formula,
                                          c.orden_concepto,
                                          c.tipo_signo,
                                          c.variable,
                                          c.activo,
                                          c.aplicar_descuento,
                                          c.aplicar_iva,
                                          c.aplicar_recargo,
                                          c.concepto
                                      }).ToList();
                DataTable detallesCalc = oCommons.convertToTable(detallesByFact);
                decimal IVA = 0;
                foreach (DataRow rowDet in detallesCalc.Rows)
                {
                    if(bool.Parse(rowDet["aplicar_iva"].ToString()))
                        IVA = IVA + decimal.Parse(rowDet["importe"].ToString());
                }
                int idSocio = 0;
                FacturasImplement oFacturasImplement = new FacturasImplement();
                idSocio = (int)oFacturasImplement.Get(idFactura).id_socio;
                socios oSocio = new socios();
                SocioImplement oSocioImplement = new SocioImplement();
                oSocio = oSocioImplement.Get(idSocio);
                IVA = IVA * (decimal.Parse(oSocio.iva.ToString())/100);

                return IVA;
            }
        }
Пример #6
0
        private void CargarDatos()
        {
            if (txtNroFactura.Text.Length > 0) {

                facturas oFacturas = new facturas();
                socios oSocio = new socios();
                SocioImplement oSocioImplement = new SocioImplement();
                FacturasImplement oFacturasImplement = new FacturasImplement();
                PeriodosImplement oPeriodosImplement = new PeriodosImplement();
                FacturasDetallesImplement oFacturasDetallesImplement = new FacturasDetallesImplement();
                _idFactura = int.Parse(txtNroFactura.Text);
                if (oFacturasImplement.ExisteFactura(_idFactura))
                {
                    oFacturas = oFacturasImplement.Get(int.Parse(txtNroFactura.Text));
                    oSocio = oSocioImplement.Get((int)oFacturas.id_socio);
                    _idSocio = oSocio.id_socio;
                    txtCodigoSubCodSocio.Text = oSocio.codigo_socio + "/" + oSocio.subcodigo_socio;
                    txtNombreSocio.Text = oSocio.nombre;
                    txtVencimiento.Text = ((DateTime)oPeriodosImplement.Get(oFacturas.id_periodo).fecha_primer_venc).ToShortDateString();
                    //facturado = neto + iva
                    DataTable detallesFacturaDT = oFacturasImplement.GetByIdFacturaDT(oFacturas.id_factura);
                    decimal _totalFacturado = 0;
                    decimal _importeTotal = 0;
                    decimal _convenio = 0;
                    decimal _acciones = 0;
                    foreach (DataRow dr in detallesFacturaDT.Rows)
                    {
                        //IVA = decimal.Parse(dr["IVA"].ToString());
                        _totalFacturado = _totalFacturado + decimal.Parse(dr["Neto"].ToString()) + decimal.Parse(dr["IVA"].ToString());
                        _importeTotal = _importeTotal + decimal.Parse(dr["Total"].ToString());
                        _convenio = _convenio + decimal.Parse(dr["Convenio"].ToString());
                        _acciones = _acciones + decimal.Parse(dr["Acciones"].ToString());
                    }

                    txtFacturado.Text = _totalFacturado.ToString();
                    txtCobrado.Text = oFacturas.cobrado.ToString();
                    txtResto.Text = (_totalFacturado - (decimal.Parse(oFacturas.cobrado.ToString()))).ToString();
                    txtDescuento.Text = "0";
                    CalculosFactura oCalculosFacturas = new CalculosFactura();
                    txtRecargo.Text = (oCalculosFacturas.CalcularRecargo(oFacturas.id_factura) + oCalculosFacturas.CalcularIVARecargo(oFacturas.id_factura)).ToString();
                    txtTotal.Text = (_importeTotal - (decimal)oFacturas.cobrado - decimal.Parse(txtDescuento.Text)).ToString();
                    txtConvenio.Text = _convenio.ToString();
                    txtAcciones.Text = _acciones.ToString();

                    CobranzasImplement oCobranzasImplement = new CobranzasImplement();

                    txtFactIngresadas.Text = oCobranzasImplement.GetFacturas(dtpFechaCaja.Value).ToString();

                    txtTotalCobrado.Text = _importeTotal.ToString();
                    txtTotalFactura.Text = _importeTotal.ToString(); ;
                    txtDiferencia.Text = (decimal.Parse(txtTotalFactura.Text) - decimal.Parse(txtTotalCobrado.Text)).ToString();
                }
                else {
                    //si esta con cobranza entonces seria para cambiar la caja
                    if (oFacturasImplement.ExisteCobranza(_idFactura))
                    {
                        _existeCobranza = true;
                    }
                    else
                    {
                        _existeCobranza = false;
                    }
                }
            }
        }
Пример #7
0
 private void GuardarObservaciones()
 {
     SocioImplement oSocioImplement = new SocioImplement();
     socios oSocio = new socios();
     oSocio = oSocioImplement.Get(_idSocio);
     oSocio.observaciones = this.txtObservaciones.Text;
     oSocioImplement.Update(oSocio);
 }
Пример #8
0
 private void CargarObservaciones()
 {
     SocioImplement oSocioImplement = new SocioImplement();
     socios oSocios = new socios();
     oSocios = oSocioImplement.Get(_idSocio);
     txtObservaciones.Text = oSocios.observaciones;
 }
Пример #9
0
 private void Inicializar()
 {
     socios oSocio = new socios();
     SocioImplement oSocioImplement = new SocioImplement();
     SocioConexionImplement oSocioConexionImplement = new SocioConexionImplement();
     oSocio = oSocioImplement.Get(_idSocio);
     this.txtCodigo.Text = oSocio.codigo_socio;
     this.txtSubCodigo.Text = oSocio.subcodigo_socio;
     this.txtNombre.Text = oSocio.nombre;
     _mostrarImpagas = 0;
     _mostrarValoresActualizados = 0;
     CargarGrilla();
     CargarTotales();
     Thread t = new Thread(new ThreadStart(InicializarTablaExt));
     t.Start();
     //InicializarTablaExt();
 }
Пример #10
0
        private void Inicializar()
        {
            socios oSocios = new socios();
            SocioImplement oSociosImplement = new SocioImplement();

            socios_lote oSocioLote = new socios_lote();
            SocioLoteImplement oSocioLoteImplement = new SocioLoteImplement();
            oSocioLote = oSocioLoteImplement.Get(_idSocio);

            socios_conexion oSocioConexion = new socios_conexion();
            SocioConexionImplement oSocioConexionImplement = new SocioConexionImplement();
            oSocioConexion = oSocioConexionImplement.Get(_idSocio);

            socios_varios oSocioVarios = new socios_varios();
            SocioVariosImplement oSocioVariosImplement = new SocioVariosImplement();
            oSocioVarios = oSocioVariosImplement.Get(_idSocio);

            oSocios = oSociosImplement.Get(_idSocio);
            txtCodigo.Text = oSocios.codigo_socio;
            txtFechaConvenio.Text = _FechaConvenio.ToShortDateString();
            txtNombre.Text = oSocios.nombre;
            cod_documentos oCodDocumentos = new cod_documentos();
            DocumentoImplement oDocumentosImplement = new DocumentoImplement();
            if(oSocios.tipo_documento!=null)
                txtTipoDocumento.Text = oDocumentosImplement.Get((int)oSocios.tipo_documento).documento;
            txtDocumento.Text = oSocios.documento.ToString();

            CalleImplement oCalleImplement = new CalleImplement();

            BarrioImplement oBarrioImplement = new BarrioImplement();
            LocalidadImplement oLocalidadImplement = new LocalidadImplement();

            if (oSocioConexion.calle!=null & (int)oSocioConexion.calle!=0)
                txtDomicilioReal.Text = oCalleImplement.Get((int)oSocioConexion.calle).calle + " " + oSocioConexion.calle_altura;
            if (oSocioLote.localidad!=null &(int)oSocioLote.localidad != 0)
                txtCiudadReal.Text = oLocalidadImplement.Get((int)oSocioLote.localidad).localidad;
            if (oSocioLote.calle!=null & (int)oSocioLote.calle != 0)
                txtDomicilioLegal.Text = oCalleImplement.Get((int)oSocioLote.calle).calle + " " + oSocioLote.calle_altura;
            if (oSocioLote.localidad!=null & (int)oSocioLote.localidad != 0)
                txtCiudadLegal.Text = oLocalidadImplement.Get((int)oSocioLote.localidad).localidad;
            txtLote.Text = oSocioLote.lote;
            txtManzana.Text = oSocioLote.manzana;
            if (oSocioLote.barrio!=null & (int)oSocioLote.barrio != 0)
                txtBarrio.Text = oBarrioImplement.Get((int)oSocioLote.barrio).barrio;

            txtImporteDeuda.Text = _ImporteDeuda.ToString();
            txtValorCuotas.Text = _ImporteCuota.ToString();
            txtCantidadCuotas.Text = _CantidadCuotas.ToString();
            txtImporteCanonMunicipal.Text = _CanonMunicipal.ToString();

            FacturasImplement oFacturasImplement = new FacturasImplement();
            string sPeriodo = oFacturasImplement.GetUltimoPeriodoFacturadoBySocio(_idSocio);
            int anio = int.Parse(sPeriodo.Substring(0,3));
            int mes = int.Parse(sPeriodo.Substring(4,5));
            DateTime fechaPeriodo = new DateTime(anio, mes, 1);
            DateTime fechaDesde = fechaPeriodo.AddMonths(1);
            DateTime fechaHasta = fechaPeriodo.AddMonths(_CantidadCuotas);
            Meses mesDesde = (Meses)fechaDesde.Month;
            Meses mesHasta = (Meses)fechaHasta.Month;
            txtDesdeMes.Text = mesDesde.ToString();
            txtMesHasta.Text = mesHasta.ToString();
            txtDesdeAnio.Text = fechaDesde.Year.ToString();
            txtAnioHasta.Text = fechaHasta.Year.ToString();
        }
Пример #11
0
 private void CargarFacturas()
 {
     this.pDetalles.Visible = true;
     this.gbRefacturar.Visible = true;
     facturas oFactura = new facturas();
     FacturasImplement oFacturaImplement = new FacturasImplement();
     socios oSocio=new socios();
     SocioImplement oSocioImplement = new SocioImplement();
     oSocio = oSocioImplement.Get(_idSocio);
     tarifas oTarifa=new tarifas();
     TarifaImplement oTarifaImplement=new TarifaImplement();
     cod_impuestos oCodImpuesto = new cod_impuestos();
     ImpuestoImplement oImpuestoImplement = new ImpuestoImplement();
     oCodImpuesto = oImpuestoImplement.Get(oSocio.iva.Value);
     oFactura = oFacturaImplement.Get(_idFactura);
     oTarifa=oTarifaImplement.Get(oSocio.tarifa.Value);
     this.txtNroFacturaAct.Text = oFactura.id_factura.ToString();
     _periodo = oFactura.id_factura.ToString();
     this.txtFechaAct.Text = oFactura.id_periodo.ToString();
     CargarFactura(_idFactura);
     this.txtTotalAct.Text = sumarFilas(ref this.dgDetalleAct,"colAImporte").ToString();
     CargarFacturaFutura(_periodo,_idSocio);
     this.txtTotalFut.Text = sumarFilas(ref this.dgDetalleFut,"colFImporte").ToString();
 }
Пример #12
0
        public decimal CalcularRecargo(int idFactura)
        {
            using (cooperativaEntities bd = new cooperativaEntities())
            {
                Commons oCommons = new Commons();

                MySqlCommand _comando = new MySqlCommand(String.Format(
                "call GetTotalRecargoByFactura('{0}')", idFactura), dbConectorMySql.ObtenerConexion());

                MySqlDataReader _reader = _comando.ExecuteReader();
                DataTable detallesCalc = new DataTable();
                detallesCalc.Load(_reader);
                decimal Recargo = 0;
                Recargo = decimal.Parse(detallesCalc.Rows[0][0].ToString());

                /*var detallesByFact = (from d in bd.facturas_detalles
                                      join c in bd.cod_conceptos on d.id_concepto equals c.id_concepto
                                      where d.id_factura == idFactura
                                      select new
                                      {
                                          d.id_factura,
                                          d.id_detalle,
                                          d.id_concepto,
                                          d.idOrden,
                                          d.idTipo,
                                          d.importe,
                                          c.id_formula,
                                          c.orden_concepto,
                                          c.tipo_signo,
                                          c.variable,
                                          c.activo,
                                          c.aplicar_descuento,
                                          c.aplicar_iva,
                                          c.aplicar_recargo,
                                          c.concepto
                                      }).ToList();
                DataTable detallesCalc = oCommons.convertToTable(detallesByFact);

                foreach (DataRow rowDet in detallesCalc.Rows)
                {
                    if (bool.Parse(rowDet["aplicar_recargo"].ToString()))
                        Recargo = Recargo + decimal.Parse(rowDet["importe"].ToString());
                }*/
               /* periodos oPeriodo = new periodos();
                PeriodosImplement oPeriososImplement = new PeriodosImplement();

                FacturasImplement oFacturasImplement = new FacturasImplement();
                oPeriodo = oPeriososImplement.Get(oFacturasImplement.Get(idFactura).id_periodo.ToString());*/
                TimeSpan diferencia;
                DateTime fecha_primer_venc=new DateTime();
                fecha_primer_venc = DateTime.Parse(detallesCalc.Rows[0][1].ToString());
                if (fecha_primer_venc < DateTime.Today)
                {
                    diferencia = DateTime.Today - DateTime.Parse(fecha_primer_venc.ToString());
                }
                else {
                    diferencia = DateTime.Today - DateTime.Today;
                }
                cod_conceptos oCod_conceptos = new cod_conceptos();
                ConceptoImplement oConceptoImplement = new ConceptoImplement();
                oCod_conceptos = oConceptoImplement.Get(18);

                decimal? days = diferencia.Days*oCod_conceptos.variable;
                decimal resultado = 0;
                if (days >= 0) {
                    resultado = (decimal)days;
                }

                int idSocio = 0;
                idSocio = int.Parse(detallesCalc.Rows[0][2].ToString());
                socios oSocio = new socios();
                SocioImplement oSocioImplement = new SocioImplement();
                oSocio = oSocioImplement.Get(idSocio);

                tarifas oTarifa = new tarifas();
                TarifaImplement oTarifaImplement = new TarifaImplement();
                oTarifa = oTarifaImplement.Get(oSocio.id_socio);

                Recargo = Recargo * resultado;
                DateTime fecha_segundo_venc = new DateTime();
                fecha_segundo_venc = DateTime.Parse(detallesCalc.Rows[0][3].ToString());
                if (fecha_segundo_venc > DateTime.Today)
                {
                    if (oTarifa.cargo_fijo > Recargo) //esto lo hago segun la marca en recargo en tabla tarifas?
                    {
                        Recargo = (decimal)oTarifa.cargo_fijo;
                    }
                }
                return Recargo;
            }
        }
Пример #13
0
        private void CargarSocio()
        {
            SocioImplement oSocioImplement = new SocioImplement();
            socios oSocio = new socios();
            oSocio = oSocioImplement.Get(_idSocio);

            socios_lote oSocioLote = new socios_lote();
            SocioLoteImplement oSocioLoteImplement = new SocioLoteImplement();
            oSocioLote = oSocioLoteImplement.Get(_idSocio);

            socios_conexion oSocioConexion = new socios_conexion();
            SocioConexionImplement oSocioConexionImplement = new SocioConexionImplement();
            oSocioConexion = oSocioConexionImplement.Get(_idSocio);

            socios_varios oSocioVarios = new socios_varios();
            SocioVariosImplement oSocioVariosImplement = new SocioVariosImplement();
            oSocioVarios = oSocioVariosImplement.Get(_idSocio);
            this.mtxtNumero.Text = oSocio.codigo_socio +  oSocio.subcodigo_socio;
            this.txtNombre.Text = oSocio.nombre;
            this.cmbTipoDni.SelectedValue = oSocio.tipo_documento;
            if (this.cmbTipoDni.SelectedValue == null) this.cmbTipoDni.SelectedValue = 0;//Esto es cuando asigno algo que el combo no contiene
            if (oSocio.documento!=null)
                this.mtxtDocumento.Text = oSocio.documento.ToString();
            if (oSocio.fecha_alta != null)
                if (oSocio.fecha_alta != DateTime.Parse("01/01/1900"))
                    this.dtpFecha.Text = oSocio.fecha_alta.ToString();
            this.cmbEstadoConexion.SelectedValue = (oSocio.estado == null) ? 0 : oSocio.estado;
            if (this.cmbEstadoConexion.SelectedValue == null) this.cmbEstadoConexion.SelectedValue = 0;
            this.txtFinalizaEstado.Text = oSocio.fin_estado;
            this.cmbTarifa.SelectedValue = (oSocio.tarifa == null) ? 0 : oSocio.tarifa;
            if (this.cmbTarifa.SelectedValue == null) this.cmbTarifa.SelectedValue = 0;
            this.txtFinalizaTarifa.Text = oSocio.fin_tarifa;
            this.cmbIVA.SelectedValue = oSocio.iva;
            if (this.cmbIVA.SelectedValue == null) this.cmbIVA.SelectedValue = 0;
            this.mtxtCuit.Text = oSocio.cuit;
            this.cmbCategoria.SelectedValue = oSocio.categoria;
            if (this.cmbCategoria.SelectedValue == null) this.cmbCategoria.SelectedValue = 0;

            ///**************************** DOMICILIO CONEXION*****************************/

            this.cmbDcBarrio.SelectedValue =oSocioConexion.barrio;
            if (this.cmbDcBarrio.SelectedValue == null) this.cmbDcBarrio.SelectedValue = 0;
            this.cmbDcCalle.SelectedValue = oSocioConexion.calle;
            if (this.cmbDcCalle.SelectedValue == null) this.cmbDcCalle.SelectedValue = 0;
            this.txtDcAltura.Text = oSocioConexion.calle_altura;
            this.txtDcPiso.Text = oSocioConexion.piso;
            this.txtDcDpto.Text = oSocioConexion.dpto;
            this.txtDcDistrito.Text = (oSocioConexion.distrito_electoral == null) ? "" : oSocioConexion.distrito_electoral.ToString();
            this.cmbZona.SelectedValue = (oSocioConexion.zona == null) ? 0 : oSocioConexion.zona;
            if (this.cmbZona.SelectedValue == null) this.cmbZona.SelectedValue = 0;
            this.txtAdicDomicilioConexion.Text = oSocioConexion.adic_domicilio;

            ///**************************** DOMICILIO LEGAL *******************************/
            this.cmbDlProvincia.SelectedValue = oSocioLote.provincia;
            if (this.cmbDlProvincia.SelectedValue == null) this.cmbDlProvincia.SelectedValue = 0;
            this.cmbDlBarrio.SelectedValue = oSocioLote.barrio;
            if (this.cmbDlBarrio.SelectedValue == null) this.cmbDlBarrio.SelectedValue = 0;
            this.cmbDlCalle.SelectedValue = oSocioLote.calle;
            if (this.cmbDlCalle.SelectedValue == null) this.cmbDlCalle.SelectedValue = 0;
            this.cmbDLLocalidad.SelectedValue = oSocioLote.localidad;
            if (this.cmbDLLocalidad.SelectedValue == null) this.cmbDLLocalidad.SelectedValue = 0;
            this.txtDLCP.Text = oSocioLote.cp.ToString();
            this.txtDlAltura.Text = oSocioLote.calle_altura;
            this.txtDlPiso.Text = oSocioLote.piso;
            this.txtDLDpto.Text = oSocioLote.dpto;
            this.txtAdicDomicilioLegal.Text = oSocioLote.adic_domicilio;

            /*************************** VARIOS *****************************/
            this.txtVProfesion.Text = oSocioVarios.profesion;
            this.txtVNombreConyuge.Text = oSocioVarios.conyuge_nombre;
            this.cmbVTipoDoc.SelectedValue = oSocioVarios.conyuge_tipo_documento;
            if (this.cmbVTipoDoc.SelectedValue == null) this.cmbVTipoDoc.SelectedValue = 0;
            this.mtxtVDocumento.Text = oSocioVarios.conyuge_documento.ToString();
            this.txtVNumSocioLuz.Text = oSocioVarios.id_coop_luz;
            this.dtpVFechaAlta.Text = oSocioVarios.fecha_convenio_coop_luz;
            this.cmbSituacionEsp.SelectedValue = oSocioVarios.situacion_especial;
            if (this.cmbSituacionEsp.SelectedValue == null) this.cmbSituacionEsp.SelectedValue = 0;
            /************************** LOTE ***************************/

            this.mtbLNomenclarura.Text = oSocioLote.nomenclatura;
            this.txtLManzana.Text = oSocioLote.manzana;
            this.txtLLote.Text = oSocioLote.lote;
            this.txtLRuta.Text = oSocioLote.ruta_reparto.ToString();
            this.txtLOrden.Text = oSocioLote.orden_reparto.ToString();

            /*********************** DATOS TECNICOS **********************/
            socios_mediciones oSocioMedicion = new socios_mediciones();
            SocioMedicionImplement oSocioMedicionImplement = new SocioMedicionImplement();
            oSocioMedicion = oSocioMedicionImplement.ultimaMedicion(_idSocio);
            this.txtDTNumero.Text = oSocioConexion.medidor;
            this.txtDTMarca.Text = oSocioConexion.marca_medidor;
            ///VER
            this.txtDTEstados.Text = oSocioMedicion == null ? "" : oSocioMedicion.consumo.ToString();
            this.txtDTUltimaLectura.Text = oSocioMedicion == null ? "" : oSocioMedicion.lectura.ToString();

            this.txtDTDistanciaMedianera.Text = oSocioConexion.ubicacion_servicio.ToString();
            this.cmbDTMedianera.SelectedValue = oSocioConexion.medianera;
            if (this.cmbDTMedianera.SelectedValue == null) this.cmbDTMedianera.SelectedValue = 0;
            this.cmbDTTipoConexion.SelectedValue = oSocioConexion.tipo_conexion;
            if (this.cmbDTTipoConexion.SelectedValue == null) this.cmbDTTipoConexion.SelectedValue = 0;
            this.txtDTDistanciaLinea.Text = oSocioConexion.distancia_a_red.ToString();
            this.txtDTProfondidad.Text = oSocioConexion.profundidad_red.ToString();
            this.cmbDTTipoMaterial.SelectedValue = oSocioConexion.tipo_material;
            if (this.cmbDTTipoMaterial.SelectedValue == null) this.cmbDTTipoMaterial.SelectedValue = 0;
            this.txtDTDiametro.Text = oSocioConexion.diametro_red.ToString();

            //VER
            CargarBanderas(oSocioVarios);
        }
Пример #14
0
 private void CargarBusqueda()
 {
     var source = new AutoCompleteStringCollection();
     SocioImplement oSocioImplement=new SocioImplement();
     List<string> lista = new List<string>();
     if (_origenBuscar)
         foreach (DataRow dr in _DataSocios.Rows)
         {
             lista.Add(dr["nombre"].ToString());
         }
     else
         lista = oSocioImplement.GetAllCustomer();
     tsTxtBuscar.AutoCompleteMode=AutoCompleteMode.SuggestAppend;
     AutoCompleteStringCollection data = new AutoCompleteStringCollection();
     data.AddRange(lista.ToArray());
     tsTxtBuscar.AutoCompleteCustomSource = data;
     tsTxtBuscar.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
Пример #15
0
        private void BuscarSocio(string filtroBuscar)
        {
            SocioImplement oSocioImplement = new SocioImplement();
            int idSocio = oSocioImplement.ObtenerIdSocioByFilter(filtroBuscar);
            _idSocio = idSocio;
            _indice = 0;
            if (_idSocio > 0)
            {
                for (int index = 0; index < _DataSocios.Rows.Count; index++)
                {
                    if (int.Parse(_DataSocios.Rows[index]["id_socio"].ToString()) == _idSocio)
                    {
                        _indice = index;
                        break;
                    }
                }

                CargarSocio();
            }
        }
Пример #16
0
        public decimal CalcularRecargo(int idFactura)
        {
            using (cooperativaEntities bd = new cooperativaEntities())
            {
                Commons oCommons = new Commons();


                MySqlCommand _comando = new MySqlCommand(String.Format(
                                                             "call GetTotalRecargoByFactura('{0}')", idFactura), dbConectorMySql.ObtenerConexion());

                MySqlDataReader _reader      = _comando.ExecuteReader();
                DataTable       detallesCalc = new DataTable();
                detallesCalc.Load(_reader);
                decimal Recargo = 0;
                Recargo = decimal.Parse(detallesCalc.Rows[0][0].ToString());

                /*var detallesByFact = (from d in bd.facturas_detalles
                 *                    join c in bd.cod_conceptos on d.id_concepto equals c.id_concepto
                 *                    where d.id_factura == idFactura
                 *                    select new
                 *                    {
                 *                        d.id_factura,
                 *                        d.id_detalle,
                 *                        d.id_concepto,
                 *                        d.idOrden,
                 *                        d.idTipo,
                 *                        d.importe,
                 *                        c.id_formula,
                 *                        c.orden_concepto,
                 *                        c.tipo_signo,
                 *                        c.variable,
                 *                        c.activo,
                 *                        c.aplicar_descuento,
                 *                        c.aplicar_iva,
                 *                        c.aplicar_recargo,
                 *                        c.concepto
                 *                    }).ToList();
                 * DataTable detallesCalc = oCommons.convertToTable(detallesByFact);
                 *
                 * foreach (DataRow rowDet in detallesCalc.Rows)
                 * {
                 *  if (bool.Parse(rowDet["aplicar_recargo"].ToString()))
                 *      Recargo = Recargo + decimal.Parse(rowDet["importe"].ToString());
                 * }*/
                /* periodos oPeriodo = new periodos();
                 * PeriodosImplement oPeriososImplement = new PeriodosImplement();
                 *
                 *
                 * FacturasImplement oFacturasImplement = new FacturasImplement();
                 * oPeriodo = oPeriososImplement.Get(oFacturasImplement.Get(idFactura).id_periodo.ToString());*/
                TimeSpan diferencia;
                DateTime fecha_primer_venc = new DateTime();
                fecha_primer_venc = DateTime.Parse(detallesCalc.Rows[0][1].ToString());
                if (fecha_primer_venc < DateTime.Today)
                {
                    diferencia = DateTime.Today - DateTime.Parse(fecha_primer_venc.ToString());
                }
                else
                {
                    diferencia = DateTime.Today - DateTime.Today;
                }
                cod_conceptos     oCod_conceptos     = new cod_conceptos();
                ConceptoImplement oConceptoImplement = new ConceptoImplement();
                oCod_conceptos = oConceptoImplement.Get(18);

                decimal?days      = diferencia.Days * oCod_conceptos.variable;
                decimal resultado = 0;
                if (days >= 0)
                {
                    resultado = (decimal)days;
                }

                int idSocio = 0;
                idSocio = int.Parse(detallesCalc.Rows[0][2].ToString());
                socios         oSocio          = new socios();
                SocioImplement oSocioImplement = new SocioImplement();
                oSocio = oSocioImplement.Get(idSocio);

                tarifas         oTarifa          = new tarifas();
                TarifaImplement oTarifaImplement = new TarifaImplement();
                oTarifa = oTarifaImplement.Get(oSocio.id_socio);

                Recargo = Recargo * resultado;
                DateTime fecha_segundo_venc = new DateTime();
                fecha_segundo_venc = DateTime.Parse(detallesCalc.Rows[0][3].ToString());
                if (fecha_segundo_venc > DateTime.Today)
                {
                    if (oTarifa.cargo_fijo > Recargo) //esto lo hago segun la marca en recargo en tabla tarifas?
                    {
                        Recargo = (decimal)oTarifa.cargo_fijo;
                    }
                }
                return(Recargo);
            }
        }
Пример #17
0
        public decimal CalcularIVARecargo(int idFactura)
        {
            #region

            /*
             * using (cooperativaEntities bd = new cooperativaEntities())
             * {
             *  Commons oCommons = new Commons();
             *  var detallesByFact = (from d in bd.facturas_detalles
             *                        join c in bd.cod_conceptos on d.id_concepto equals c.id_concepto
             *                        where d.id_factura == idFactura
             *                        select new
             *                        {
             *                            d.id_factura,
             *                            d.id_detalle,
             *                            d.id_concepto,
             *                            d.idOrden,
             *                            d.idTipo,
             *                            d.importe,
             *                            c.id_formula,
             *                            c.orden_concepto,
             *                            c.tipo_signo,
             *                            c.variable,
             *                            c.activo,
             *                            c.aplicar_descuento,
             *                            c.aplicar_iva,
             *                            c.aplicar_recargo,
             *                            c.concepto
             *                        }).ToList();
             *  DataTable detallesCalc = oCommons.convertToTable(detallesByFact);
             *  decimal IVARecargo = 0;
             *  foreach (DataRow rowDet in detallesCalc.Rows)
             *  {
             *      if (bool.Parse(rowDet["aplicar_iva"].ToString()) && bool.Parse(rowDet["aplicar_recargo"].ToString()))
             *          IVARecargo = IVARecargo + decimal.Parse(rowDet["importe"].ToString());
             *  }
             *  int idSocio = 0;
             *  FacturasImplement oFacturasImplement = new FacturasImplement();
             *  idSocio = (int)oFacturasImplement.Get(idFactura).id_socio;
             *  socios oSocio = new socios();
             *  SocioImplement oSocioImplement = new SocioImplement();
             *  oSocio = oSocioImplement.Get(idSocio);
             *
             *  IVARecargo = IVARecargo * (decimal.Parse(oSocio.iva.ToString()) / 100);
             *
             *  return IVARecargo;
             * }
             */
            #endregion
            decimal _IvaRecargo = 0;
            decimal _recargo    = 0;
            _recargo = CalcularRecargo(idFactura);
            int idSocio = 0;
            FacturasImplement oFacturasImplement = new FacturasImplement();
            idSocio = (int)oFacturasImplement.Get(idFactura).id_socio;
            socios         oSocio          = new socios();
            SocioImplement oSocioImplement = new SocioImplement();
            oSocio      = oSocioImplement.Get(idSocio);
            _IvaRecargo = _recargo * (decimal.Parse(oSocio.iva.ToString()) / 100);
            return(_IvaRecargo);
        }
Пример #18
0
 private void CargarSocio()
 {
     socios oSocio = new socios();
     SocioImplement oSocioImplement = new SocioImplement();
     oSocio = oSocioImplement.Get(_idSocio);
     this.mtxtNumero.Text = oSocio.codigo_socio + oSocio.subcodigo_socio;
     this.txtNombre.Text = oSocio.nombre;
 }
Пример #19
0
 public decimal CalcularIVARecargoNuevo(decimal _recargo, int idSocio)
 {
     decimal _IvaRecargo = 0;
     socios oSocio = new socios();
     SocioImplement oSocioImplement = new SocioImplement();
     oSocio = oSocioImplement.Get(idSocio);
     _IvaRecargo = _recargo * (decimal.Parse(oSocio.iva.ToString()) / 100);
     return _IvaRecargo;
 }
Пример #20
0
 private void CargarSocios()
 {
     SocioImplement oSocioImplement = new SocioImplement();
     if(!_origenBuscar)
         _DataSocios = oSocioImplement.CargarSocios();
     if (_DataSocios.Rows.Count == 0)
     {
         _idSocio = 0;
         _idInf = 0;
         _idSup = 0;
     }
     else
     {
         _idInf = int.Parse(_DataSocios.Rows[0]["id_socio"].ToString());
         _idSup = int.Parse(_DataSocios.Rows[_DataSocios.Rows.Count - 1]["id_socio"].ToString());
         _idSocio = _idInf;
     }
 }
Пример #21
0
        private void Guardar()
        {
            bool Actualizar=false;
            if (_idSocio!=0)
                Actualizar=true;

                socios oSocio = new socios();
                SocioImplement oSocioImplement = new SocioImplement();

                oSocio.codigo_socio = this.mtxtNumero.Text.Substring(0, 6);
                oSocio.subcodigo_socio = this.mtxtNumero.Text.Substring(7, 2);
                oSocio.nombre = this.txtNombre.Text;
                if (!(int.Parse(this.cmbTipoDni.SelectedValue.ToString()) == 0)) oSocio.tipo_documento = int.Parse(this.cmbTipoDni.SelectedValue.ToString());
                oSocio.documento = int.Parse(this.mtxtDocumento.Text);
                oSocio.fecha_alta = this.dtpFecha.Value;
                if (!(int.Parse(this.cmbEstadoConexion.SelectedValue.ToString()) == 0)) oSocio.estado = int.Parse(this.cmbEstadoConexion.SelectedValue.ToString());
                oSocio.fin_estado = this.txtFinalizaEstado.Text;
                if (!(int.Parse(this.cmbTarifa.SelectedValue.ToString()) == 0)) oSocio.tarifa = int.Parse(this.cmbTarifa.SelectedValue.ToString());
                oSocio.fin_tarifa = this.txtFinalizaTarifa.Text;
                if (!(int.Parse(this.cmbIVA.SelectedValue.ToString()) == 0)) oSocio.iva = int.Parse(this.cmbIVA.SelectedValue.ToString());
                oSocio.cuit = this.mtxtCuit.Text;
                if (!(int.Parse(this.cmbCategoria.SelectedValue.ToString()) == 0)) oSocio.categoria = int.Parse(this.cmbCategoria.SelectedValue.ToString());

                oSocio.observaciones = "";

                if (!Actualizar)
                    _idSocio = oSocioImplement.Save(oSocio);
                else
                {
                    oSocio.id_socio = _idSocio;
                    oSocioImplement.Update(oSocio);
                }

                /****************************SOCIO CONEXION*****************************/
                socios_conexion oSocioConexion = new socios_conexion();
                SocioConexionImplement oSocioConexionImplement = new SocioConexionImplement();
                oSocioConexion.id_Socio = _idSocio;
                oSocioConexion.ubicacion_servicio = this.txtDTDistanciaMedianera.Text == "" ? 0 : float.Parse(this.txtDTDistanciaMedianera.Text.Replace(".", ","));
                oSocioConexion.medianera = int.Parse(this.cmbDTMedianera.SelectedValue.ToString());
                oSocioConexion.tipo_conexion = int.Parse(this.cmbDTTipoConexion.SelectedValue.ToString());
                oSocioConexion.distancia_a_red = this.txtDTDistanciaLinea.Text == "" ? 0 : float.Parse(this.txtDTDistanciaLinea.Text.Replace(".", ","));
                oSocioConexion.profundidad_red = this.txtDTProfondidad.Text == "" ? 0 : float.Parse(this.txtDTProfondidad.Text.Replace(".", ","));
                oSocioConexion.tipo_material = int.Parse(this.cmbDTTipoMaterial.SelectedValue.ToString());
                oSocioConexion.diametro_red = this.txtDTDiametro.Text == "" ? 0 : float.Parse(this.txtDTDiametro.Text.Replace(".", ","));
                oSocioConexion.medidor = this.txtDTNumero.Text;
                oSocioConexion.marca_medidor = this.txtDTMarca.Text;
                oSocioConexion.barrio = int.Parse(this.cmbDcBarrio.SelectedValue.ToString());
                oSocioConexion.calle = int.Parse(this.cmbDcCalle.SelectedValue.ToString());
                oSocioConexion.calle_altura = this.txtDcAltura.Text;
                oSocioConexion.piso = this.txtDcPiso.Text;
                oSocioConexion.dpto = this.txtDcDpto.Text;
                oSocioConexion.distrito_electoral = this.txtDcDistrito.Text == "" ? 0 : int.Parse(this.txtDcDistrito.Text);
                oSocioConexion.zona = int.Parse(this.cmbZona.SelectedValue.ToString());
                oSocioConexion.adic_domicilio = this.txtAdicDomicilioConexion.Text;

                if (!Actualizar)
                    oSocioConexionImplement.Save(oSocioConexion);
                else
                    oSocioConexionImplement.Update(oSocioConexion);

                /************************** SOCIO LOTE ***************************/
                socios_lote oSocioLote = new socios_lote();
                SocioLoteImplement oSocioLoteImplement = new SocioLoteImplement();
                oSocioLote.id_Socio = _idSocio;
                oSocioLote.barrio = int.Parse(this.cmbDlBarrio.SelectedValue.ToString());
                oSocioLote.manzana = this.txtLManzana.Text;
                oSocioLote.lote = this.txtLLote.Text;
                oSocioLote.calle = int.Parse(this.cmbDlCalle.SelectedValue.ToString());
                oSocioLote.calle_altura = this.txtDlAltura.Text;
                oSocioLote.piso = this.txtDlPiso.Text;
                oSocioLote.dpto = this.txtDLDpto.Text;
                oSocioLote.nomenclatura = this.mtbLNomenclarura.Text;
                oSocioLote.ruta_reparto = this.txtLRuta.Text == "" ? -1 : int.Parse(this.txtLRuta.Text);
                oSocioLote.orden_reparto = this.txtLOrden.Text == "" ? -1 : int.Parse(this.txtLOrden.Text);
                oSocioLote.cp = this.txtDLCP.Text;
                oSocioLote.localidad = int.Parse(this.cmbDLLocalidad.SelectedValue.ToString());
                oSocioLote.provincia = int.Parse(this.cmbDlProvincia.SelectedValue.ToString());
                oSocioLote.adic_domicilio = this.txtAdicDomicilioLegal.Text;

                if (!Actualizar)
                    oSocioLoteImplement.Save(oSocioLote);
                else
                    oSocioLoteImplement.Update(oSocioLote);

                /*************************** SOCIO VARIOS *****************************/
                socios_varios oSocioVarios = new socios_varios();
                SocioVariosImplement oSocioVariosmplement = new SocioVariosImplement();
                oSocioVarios.id_socio = _idSocio;
                oSocioVarios.profesion = this.txtVProfesion.Text;
                oSocioVarios.conyuge_nombre = this.txtVNombreConyuge.Text;
                oSocioVarios.conyuge_tipo_documento =  int.Parse(this.cmbVTipoDoc.SelectedValue.ToString());
                oSocioVarios.conyuge_documento = this.mtxtVDocumento.Text == "" ? -1 : int.Parse(this.mtxtVDocumento.Text);
                oSocioVarios.id_coop_luz = this.txtVNumSocioLuz.Text;//ver
                oSocioVarios.fecha_convenio_coop_luz = this.dtpVFechaAlta.Text;
                oSocioVarios.situacion_especial =  int.Parse(this.cmbSituacionEsp.SelectedValue.ToString());
                if (!Actualizar)
                    oSocioVariosmplement.Save(oSocioVarios);
                else
                    oSocioVariosmplement.Update(oSocioVarios);
        }
Пример #22
0
        private void GuardarCobranza()
        {
            facturas oFacturas = new facturas();
            socios oSocio = new socios();
            SocioImplement oSocioImplement = new SocioImplement();
            FacturasImplement oFacturasImplement = new FacturasImplement();
            PeriodosImplement oPeriodosImplement = new PeriodosImplement();
            FacturasDetallesImplement oFacturasDetallesImplement = new FacturasDetallesImplement();

            oFacturas = oFacturasImplement.Get(int.Parse(txtNroFactura.Text));
            oFacturas.id_estadoPago = 3;
            oFacturasImplement.Update(oFacturas);

            cobranzas oCobranza = new cobranzas();
            oCobranza.id_caja = int.Parse(cmbCaja.SelectedValue.ToString());
            oCobranza.id_factura = _idFactura;
            oCobranza.id_recibo = 0;
            oCobranza.id_socio = _idSocio;
            oCobranza.importe = decimal.Parse(txtTotalCobrado.Text);
            oCobranza.descuento_convenio = 0;
            oCobranza.iva_descuento_convenio = 0;
            oCobranza.fecha_cobro = dtpFechaCaja.Value;
            oCobranza.id_terminal = 0;//VER
            oCobranza.fecha_registro = DateTime.Now;
            CobranzasImplement oCobranzasImplement = new CobranzasImplement();
            oCobranzasImplement.Save(oCobranza);
        }
Пример #23
0
 private void ObtenerFacturasSocio()
 {
     socios oSocio = new socios();
     SocioImplement oSocioImplement = new SocioImplement();
     oSocio = oSocioImplement.Get(_idSocio);
     this.mtxtNumero.Text = oSocio.codigo_socio + oSocio.subcodigo_socio;
     this.txtNombre.Text = oSocio.nombre;
     FacturasImplement oFacturaImplement = new FacturasImplement();
     this.dgFacturar.DataSource = oFacturaImplement.GetByIdSocio(_idSocio);
 }
Пример #24
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            #region <<Datos Socio>>

            if (panelIVA.Visible)
            {
                _IVAs = "";
                panelIVA.Visible = false;
                for (int i = 0; i < chkListIVA.Items.Count; i++)
                {
                    if (chkListIVA.GetItemChecked(i))
                    {
                        _IVAs = _IVAs + "'" + chkListIVA.Items[i].ToString() + "',";
                    }
                }

                txtIVAs.Text = _IVAs;
            }

            if (panelCategorias.Visible)
            {
                _Categorias = "";
                panelCategorias.Visible = false;
                for (int i = 0; i < chkListCategorias.Items.Count; i++)
                {
                    if (chkListCategorias.GetItemChecked(i))
                    {
                        _Categorias = _Categorias + "'" + chkListCategorias.Items[i].ToString().Trim() + "',";
                    }
                }

                txtCategorias.Text = _Categorias;
            }

            if (panelEstadoConexion.Visible)
            {
                _EstadosConexion = "";
                panelEstadoConexion.Visible = false;
                for (int i = 0; i < chkListEstadoConexion.Items.Count; i++)
                {
                    if (chkListEstadoConexion.GetItemChecked(i))
                    {
                        _EstadosConexion = _EstadosConexion + "'" + chkListEstadoConexion.Items[i].ToString() + "',";
                    }
                }

                txtEstadoConexion.Text = _EstadosConexion;
            }

            if (panelSituacionEsp.Visible)
            {
                _SituacionEspecial = "";
                panelSituacionEsp.Visible = false;
                for (int i = 0; i < chkListSituacionEsp.Items.Count; i++)
                {
                    if (chkListSituacionEsp.GetItemChecked(i))
                    {
                        _SituacionEspecial = _SituacionEspecial + "'" + chkListSituacionEsp.Items[i].ToString() + "',";
                    }
                }

                txtSituacionEsp.Text = _SituacionEspecial;
            }

            if (panelTarifa.Visible)
            {
                _Tarifas = "";
                panelTarifa.Visible = false;
                for (int i = 0; i < chkListTarifa.Items.Count; i++)
                {
                    if (chkListTarifa.GetItemChecked(i))
                    {
                        _Tarifas = _Tarifas + "'" + chkListTarifa.Items[i].ToString().Replace("'", "''").Trim() + "',";
                    }
                }

                txtTarifa.Text = _Tarifas;
            }

            if (panelZonaFacturacion.Visible)
            {
                _ZonaFacturacion = "";
                panelZonaFacturacion.Visible = false;
                for (int i = 0; i < chkListZonaFacturacion.Items.Count; i++)
                {
                    if (chkListZonaFacturacion.GetItemChecked(i))
                    {
                        _ZonaFacturacion = _ZonaFacturacion + "'" + chkListZonaFacturacion.Items[i].ToString() + "',";
                    }
                }

                txtZonaFacturacion.Text = _ZonaFacturacion;
            }
            #endregion

            #region <<Datos Varios>>

            if (panelBarrio.Visible)
            {
                _Barrios = "";
                txtBarrio.Text = "";
                panelBarrio.Visible = false;
                for (int i = 0; i < chkListBarrio.Items.Count; i++)
                {
                    if (chkListBarrio.GetItemChecked(i))
                    {
                        _Barrios = _Barrios + "'" + ((cod_barrios)(chkListBarrio.Items[i])).id_barrio.ToString() + "',";
                        txtBarrio.Text = txtBarrio.Text + ((cod_barrios)(chkListBarrio.Items[i])).barrio + ",";
                    }
                }

            }

            if (panelCalle.Visible)
            {
                _Calles = "";
                txtCalle.Text = "";
                panelCalle.Visible = false;
                for (int i = 0; i < chkListCalle.Items.Count; i++)
                {
                    if (chkListCalle.GetItemChecked(i))
                    {
                        _Calles = _Calles + "'" + ((cod_calles)(chkListCalle.Items[i])).id_calle.ToString() + "',";
                        txtCalle.Text = txtCalle.Text + ((cod_calles)(chkListCalle.Items[i])).calle + ",";
                    }
                }

            }

            if (panelProvincia.Visible)
            {
                _Provincias = "";
                txtProvincia.Text = "";
                panelProvincia.Visible = false;
                for (int i = 0; i < chkListProvincia.Items.Count; i++)
                {
                    if (chkListProvincia.GetItemChecked(i))
                    {
                        _Provincias = _Provincias + "'" + ((cod_provincias)(chkListProvincia.Items[i])).id_provincia.ToString() + "',";
                        txtProvincia.Text = txtProvincia.Text + ((cod_provincias)(chkListProvincia.Items[i])).provincia + ",";
                    }
                }

            }

            if (panelBarrioLegal.Visible)
            {
                _BarriosLegal = "";
                txtBarrioLegal.Text = "";
                panelBarrioLegal.Visible = false;
                for (int i = 0; i < chkListBarrioLegal.Items.Count; i++)
                {
                    if (chkListBarrioLegal.GetItemChecked(i))
                    {
                        _BarriosLegal = _BarriosLegal + "'" + ((cod_barrios)(chkListBarrioLegal.Items[i])).id_barrio.ToString() + "',";
                        txtBarrioLegal.Text = txtBarrioLegal.Text + ((cod_barrios)(chkListBarrioLegal.Items[i])).barrio + ",";
                    }
                }

            }

            if (panelCalleLegal.Visible)
            {
                _CallesLegal = "";
                txtCalleLegal.Text = "";
                panelCalleLegal.Visible = false;
                for (int i = 0; i < chkListCalleLegal.Items.Count; i++)
                {
                    if (chkListCalle.GetItemChecked(i))
                    {
                        _CallesLegal = _CallesLegal + "'" + ((cod_calles)(chkListCalleLegal.Items[i])).id_calle.ToString() + "',";
                        txtCalleLegal.Text = txtCalleLegal.Text + ((cod_calles)(chkListCalleLegal.Items[i])).calle + ",";
                    }
                }
            }

            if (panelLocalidad.Visible)
            {
                _Localidad = "";
                txtLocalidad.Text = "";
                panelLocalidad.Visible = false;
                for (int i = 0; i < chkListLocalidad.Items.Count; i++)
                {
                    if (chkListLocalidad.GetItemChecked(i))
                    {
                        _Localidad = _Localidad + "'" + ((cod_localidades)(chkListLocalidad.Items[i])).id_localidad.ToString() + "',";
                        txtLocalidad.Text = txtLocalidad.Text + ((cod_localidades)(chkListLocalidad.Items[i])).localidad + ",";
                    }
                }
            }
            #endregion

            #region <<Datos Catastral>>

            if (panelEntidad.Visible)
            {
                _Entidades = "";
                txtEntidad.Text = "";
                panelEntidad.Visible = false;
                for (int i = 0; i < chkListEntidad.Items.Count; i++)
                {
                    if (chkListEntidad.GetItemChecked(i))
                    {
                        _Entidades = _Entidades + "'" + ((cod_prestador)(chkListEntidad.Items[i])).id_prestador.ToString() + "',";
                        txtEntidad.Text = txtEntidad.Text + ((cod_prestador)(chkListEntidad.Items[i])).prestador + ",";
                    }
                }
            }
            #endregion

            SocioImplement oSocioImplement = new SocioImplement();
            string _CodigoSocio = "";
            if(mtxtNumero.Text.Length>=6)
                _CodigoSocio = this.mtxtNumero.Text.Substring(0, 6);
             string _SubcodigoSocio = "";
             if (mtxtNumero.Text.Length >= 9)
                _SubcodigoSocio = this.mtxtNumero.Text.Substring(7, 2);

            _DataSocios = oSocioImplement.SociosGetByFilters(_IVAs, _Categorias, _EstadosConexion, _SituacionEspecial, _Tarifas,
                    _ZonaFacturacion, _CodigoSocio, _SubcodigoSocio, this.txtNombre.Text, this.mtxtDocumento.Text, this.mtxtCuit.Text,
                    this.dtpFecha.Text, _Barrios, _Calles, _Provincias, _BarriosLegal, _CallesLegal, _Localidad, _Entidades,
                    txtDcDistrito.Text, txtDcAltura.Text, txtDLCP.Text, txtDlAltura.Text, mtbLNomenclarura.Text, txtLManzana.Text,
                    txtLLote.Text, txtMedidor.Text);
            this.dgSocios.DataSource = _DataSocios;
        }
Пример #25
0
        private void Inicializar()
        {
            socios oSocio = new socios();
            SocioImplement oSocioImplement = new SocioImplement();
            SocioConexionImplement oSocioConexionImplement = new SocioConexionImplement();
            oSocio = oSocioImplement.Get(_idSocio);
            this.txtCodigo.Text = oSocio.codigo_socio;
            this.txtSubCodigo.Text = oSocio.subcodigo_socio;
            this.txtNombre.Text = oSocio.nombre;

             //   _bandera = true;
             //   _bandera2 = true;

            _cargando = true;
            CargarGrilla();

            //    _bandera = false;
            //    _bandera2 = false;
            //CargarTotales();
        }
Пример #26
0
        private void Imprimir()
        {
            SysConfigImplement oSysConfigImplement = new SysConfigImplement();
            Reportes.frmReportes frmRpt = new Reportes.frmReportes();
            Reportes.rptFacturas rpt = new Reportes.rptFacturas();
            FacturasImplement oFacturasImplement = new FacturasImplement();
            //DataTable dtFacturas=new DataTable();
            //if(_mostrarImpagas ==0)
            //{
            //    if(_mostrarValoresActualizados==0)
            //    {
            //        dtFacturas=_facturasNoAct;
            //    }
            //    else
            //    {
            //        dtFacturas=_facturasAct;
            //    }
            //}
            //else
            //{
            //    if(_mostrarValoresActualizados==0)
            //    {
            //        dtFacturas=_facturasNoActImp;
            //    }
            //    else
            //    {
            //        dtFacturas=_facturasActImp;
            //    }
            //}

            DataTable dtFacturas = oFacturasImplement.GetByIdSocioDT(_idSocio, _mostrarImpagas, _mostrarValoresActualizados);
            decimal totalfacturado = 0;
            decimal totalrecargo = 0;
            decimal totalcobrado = 0;
            decimal totaldeuda = 0;
            foreach(DataRow dr in dtFacturas.Rows)
            {
                dr["Total"] = (decimal.Parse(dr["Recargo"].ToString()) + decimal.Parse(dr["IVARecargo"].ToString())) + (decimal.Parse(dr["Neto"].ToString()) + decimal.Parse(dr["IVA"].ToString())) - decimal.Parse(dr["Cobrado"].ToString());
                dr["Neto"] = (decimal.Parse(dr["Neto"].ToString()) + decimal.Parse(dr["IVA"].ToString()));
                dr["Recargo"] = (decimal.Parse(dr["Recargo"].ToString()) + decimal.Parse(dr["IVARecargo"].ToString()));

                totalfacturado = totalfacturado + (decimal.Parse(dr["Neto"].ToString()) + decimal.Parse(dr["IVA"].ToString()));
                totalrecargo = totalrecargo + (decimal.Parse(dr["Recargo"].ToString()) + decimal.Parse(dr["IVARecargo"].ToString()));
                totalcobrado = totalcobrado + decimal.Parse(dr["Cobrado"].ToString());
                totaldeuda = totaldeuda + decimal.Parse(dr["Total"].ToString());

            }

            socios oSocio = new socios();
            SocioImplement oSocioImplement = new SocioImplement();
            socios_lote oSocio_lote = new socios_lote();
            SocioLoteImplement oSocio_loteImplement = new SocioLoteImplement();
            tarifas oTarifas = new tarifas();
            TarifaImplement oTarifaImplement = new TarifaImplement();
            cod_barrios oCod_Barrios = new cod_barrios();
            BarrioImplement oBarrioImplement = new BarrioImplement();
            cod_calles oCod_Calles = new  cod_calles();
            CalleImplement oCalleImplement = new CalleImplement();
            oSocio = oSocioImplement.Get(_idSocio);
            oSocio_lote = oSocio_loteImplement.Get(_idSocio);
            string calleAltura = "";
            string manzana = "";
            string lote = "";
            string tarifa = "";
            string barrio = "";
            if(oSocio.tarifa>0)
                tarifa = oTarifaImplement.Get((int)oSocio.tarifa).tarifa;
            if (oSocio_lote != null)
            {
                if (oSocio_lote.barrio > 0)
                    barrio = oBarrioImplement.Get((int)oSocio_lote.barrio).barrio;
                if (oSocio_lote.calle_altura.Length > 0)
                    calleAltura = oSocio_lote.calle_altura;
                if (oSocio_lote.manzana.Length > 0)
                    manzana = oSocio_lote.manzana;
                if (oSocio_lote.lote.Length > 0)
                    lote = oSocio_lote.lote;
            }
            string calle = "";
            if (oSocio_lote.calle != null && oSocio_lote.calle>0)
                calle=oCalleImplement.Get((int)oSocio_lote.calle).calle;

            //Cargo el Data Set

            DataSet ds = new DataSet("Generico");
            ds.Tables.Add(oSysConfigImplement.GetEncabezadoDT("Encabezado"));
            ds.Tables[0].TableName = "dtEncabezado";
            ds.Tables.Add(dtFacturas);
            ds.Tables[1].TableName = "dtFacturas";
            rpt.SetDataSource(ds);
            rpt.SetParameterValue("socio", oSocio.codigo_socio + "/" + oSocio.subcodigo_socio + "  " + oSocio.nombre);
            rpt.SetParameterValue("tarifa", tarifa);
            rpt.SetParameterValue("barrio", barrio);
            rpt.SetParameterValue("calle", calle);
            rpt.SetParameterValue("numero", calleAltura);
            rpt.SetParameterValue("manzana", manzana);
            rpt.SetParameterValue("lote",lote);
            rpt.SetParameterValue("totalfacturado", Math.Round(totalfacturado, 2).ToString());
            rpt.SetParameterValue("totalrecargo", Math.Round(totalrecargo, 2).ToString());
            rpt.SetParameterValue("totalcobrado", Math.Round(totalcobrado, 2).ToString());
            rpt.SetParameterValue("totaldeuda", Math.Round(totaldeuda, 2).ToString());
            frmRpt.crvGenerico.ReportSource = rpt;
            frmRpt.Show();
        }