protected void CustomValidator8_ServerValidate(object source, ServerValidateEventArgs args)
        {
            ((Label)EbuyPopup1.FindControl("lbl_error")).Text = "";
            Decimal importe = decimal.Parse(txt_importeE.Text + "." + txt_importeD.Text);

            if (PagoPendienteValor.Text != "")
            {
                Dinero pago = new Dinero();
                pago.Valor = Convert.ToDecimal(PagoPendienteValor.Text);
                if (pago.Valor <= 0)
                {
                    args.IsValid = false;
                }
                else
                {
                    if (importe > pago.Valor)
                    {
                        CustomValidator8.ErrorMessage = "El valor de factura que eligió pagar sobrepasa el saldo de sus pagos.";
                        args.IsValid = false;
                        return;
                    }
                    else
                    {
                        args.IsValid = true;
                    }
                }
            }
        }
示例#2
0
        public Dinero getPagosPendientesDeAplicar(string idproveedor)
        {
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter("@ProvId", idproveedor);
            datosSQL.ConGenerico = false;
            datosSQL.Parametros = param;
            datosSQL.Stored = "COCG_FEBUY_ValorPagosPendientesAplicacion";
            DataSet datos = ebSQL.ExecuteSP(datosSQL);

            Dinero dinero = new Dinero();
            dinero.Valor = Convert.ToDecimal(datos.Tables[0].Rows[0]["Importe"]);
            Moneda moneda = new Moneda();
            moneda.MonId = "ARS";
            dinero.Moneda = moneda;

            return dinero;
        }
示例#3
0
        public void actGrilla()
        {
            //idProveedor = "AR3052815043";

            if (ejecutado >= 1)
            {
                return;
            }
            ejecutado++;
            try
            {
                idProveedor = "";
                if (config.EsFacturador)
                {
                    //GrillaCtaCte.Columns[10].Visible = true;
                    TextBox tb;
                    tb = (TextBox)this.Parent.FindControl("txt_empresa");
                    if (tb.Text != "")
                    idProveedor = tb.Text.Substring(tb.Text.IndexOf("//") + 3);
                    //idProveedor = this.Parent.FindControl("txt_empresa") txt_empresa.Text.Substring(txt_empresa.Text.IndexOf("//") + 3);
                }
                else
                {
                    idProveedor = EbuySession.DatosDe;
                    //GrillaCtaCte.Columns[10].Visible = false;
                }
                PagosPendiente = lista.getPagosPendientesDeAplicar(idProveedor);
                saldoTotal = lista.getSaldoProveedor(idProveedor);
                if (saldoTotal > 0)
                {
                    AtencionOK1.Visible = false;
                    Atencion1.Visible = true;
                    Atencion1.Texto = "Saldo $ " + Convert.ToString(saldoTotal);
                }
                if (saldoTotal == 0)
                {
                    Atencion1.Visible = false;
                    AtencionOK1.Visible = true;
                    AtencionOK1.Texto = "Usted no tiene deuda pendiente. $ " + Convert.ToString(saldoTotal);
                }
                if (saldoTotal < 0)
                {
                    AtencionOK1.Visible = true;
                    Atencion1.Visible = false;
                    AtencionOK1.Texto = "Usted tiene saldo a favor. $ " + Convert.ToString(saldoTotal);
                }
                filtro.Proveedor = idProveedor;

                this.GrillaCtaCte.DataSource = lista.getCFacturaConRecibos(filtro, Socio);//"AR3052815043");

                this.GrillaCtaCte.DataBind();
                if (this.GrillaCtaCte.Rows.Count > 0)
                {
                    hayDatos = true;
                }
                else
                    hayDatos = false;
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public ProvPagoInformado Cast(IDataReader datareader)
        {
            ProvPagoInformado p = new ProvPagoInformado();

            //ID temporal,
            // Recibo posta
            // Valor
            // retenciones
            // valor total.
            // modo pago
            // tipo de pago
            // datos del tipo de pago.
            // facturas que paga.

            Dinero din = new Dinero();
            Moneda Mon = new Moneda();
            Mon.MonId = datareader["MonId"].ToString();
            p.Rec_Docid = Convert.ToInt32(datareader["Rec_Docid"]);
            //p.Recibo = datareader["Reciboid"].ToString();
            din.Moneda = Mon;
            din.Valor = Convert.ToDecimal(datareader["Importe"]);
            p.importe = din;
            p.observaciones = datareader["Observaciones"].ToString();
            //Efectivo
            if (Convert.ToInt16(datareader["TipoPago"]) == 1)
            {
                datosEfectivo = new FEBUY_ProvPagoInformadoEfectivo();

            }
            //Cheque
            if (Convert.ToInt16(datareader["TipoPago"]) == 2)
            {
                Banco b = new Banco();
                b.bank_id = datareader["bancoIddeDeposito"].ToString();
                b.Sucursal = datareader["sucursal"].ToString();
                datosCheque = new FEBUY_ProvPagoInformadoCheque();
                datosCheque.BancoDestino = b;
                datosCheque.nroCheque = datareader["nroCheque"].ToString();

            }
            //Transferencia
            if (Convert.ToInt16(datareader["TipoPago"]) == 3)
            {
                datosTransferencia = new FEBY_ProvPagoInformadoTransferencia();
                datosTransferencia.bancoIdDestino = datareader["bancoIddeDeposito"].ToString();
                datosTransferencia.sucursal = datareader["sucursal"].ToString();
            }
            p.TipoPago =  new tipoPagos();
            p.transaccion = datareader["transaccion"].ToString();

            return p;
        }