示例#1
0
        public RetornaMensaje RegistrarTipoPago(string Descripcion)
        {
            try
            {
                retornaMensaje = new RetornaMensaje();
                tipoPagoDAO    = new TipoPagoDAO();
                TipoPago tipoPago = new TipoPago();

                tipoPago.B_Estado      = true;
                tipoPago.C_Descripcion = Descripcion;

                retornaMensaje.CodigoRetorno = tipoPagoDAO.Registrar(tipoPago);
                retornaMensaje.Mensage       = string.Format(resMensajes.msjGuardadoOK, "Tipo de Pago");
                retornaMensaje.Exito         = true;
            }
            catch (Exception exception)
            {
                throw new FaultException <RetornaMensaje>
                          (new RetornaMensaje
                {
                    Mensage     = string.Format(resMensajes.msjNoRegistrado, "Tipo de Pago"),
                    CodigoError = exception.GetHashCode().ToString(),
                    Exito       = false
                }
                          , new FaultReason(exception.Message));
            }
            return(retornaMensaje);
        }
示例#2
0
        public IList <TipoPago> ListarTipoPago()
        {
            tipoPagoDAO = new TipoPagoDAO();
            IList <TipoPago> lstTipoPago;

            lstTipoPago = tipoPagoDAO.Listar();
            return(lstTipoPago);
        }
示例#3
0
        private void FormaPago_Load(object sender, EventArgs e)
        {
            comboBoxTipoTarj.DataSource  = TipoTarjetaDAO.GetAll();
            comboBoxMedioPago.DataSource = TipoPagoDAO.GetAll();

            if (Sesion.Rol.NombreRol == "Guest")
            {
                comboBoxMedioPago.SelectedItem = TipoPagoDAO.GetAll().ElementAt(0);
                comboBoxMedioPago.Enabled      = false;
            }
        }
示例#4
0
        private void CargaCredito_Load(object sender, EventArgs e)
        {
            cmbTipoPago.DataSource    = TipoPagoDAO.listarDatosTarjetas();
            cmbTipoPago.DisplayMember = "descripcion"; //muestra solo los datos de esa columna
            cmbTipoPago.ValueMember   = "id";
            cmbTipoPago.SelectedIndex = -1;            // para que no seleccione nada

            txtNombreCliente.Text = cliente.nombre + " " + cliente.apellido;
            txtFecha.Text         = FechaAplicacion.get().ToString("dd/MM/yyyy");

            txtNumeroTarjeta1.MaxLength  = 4;
            txtNumeroTarjeta2.MaxLength  = 4;
            txtNumeroTarjeta3.MaxLength  = 4;
            txtNumeroTarjeta4.MaxLength  = 4;
            txtMes.MaxLength             = 2;
            txtAño.MaxLength             = 2;
            txtCodigoSeguridad.MaxLength = 3;
        }
示例#5
0
        public Boleta()
        {
            InitializeComponent();
            this.ControlBox = false;
            this.Text       = "BOLETAS";
            boletaForm      = this;
            objMonedaDao    = new MonedaDAO();
            objTipoPagoDao  = new TipoPagoDAO();
            objDocumento    = new DocumentoDAO();
            objProceso      = new Proceso();
            comboMoneda();
            comboPago();
            gridParams();
            if (ListaBoleta.operacionFactura == "V")
            {
                if (ListaFactura.objDocumentoCab.EstadoSunat == 0)
                {
                    lbl_Anulado.Visible = true;
                }
                habilitarBotones(false, false);
                habilitarCampos(false);
                txt_Guia.Enabled       = false;
                txt_OT.Enabled         = false;
                txt_Pedido.Enabled     = false;
                txt_GlosaCab.Enabled   = false;
                btn_BuscarOT.Enabled   = false;
                btn_Limpiar.Enabled    = false;
                btn_SaveData.Enabled   = false;
                btn_Buscar.Enabled     = false;
                dpck_Fechavcto.Enabled = false;
                dpick_Fecha.Enabled    = false;
                cmb_Moneda.Enabled     = false;
                cmb_Pago.Enabled       = false;

                txt_Cliente.Text         = ListaBoleta.objDocumentoCab.DocumentoCabCliente;
                txt_Ruc.Text             = ListaBoleta.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_Serie.Text           = ListaBoleta.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text          = ListaBoleta.objDocumentoCab.DocumentoCabNro;
                txt_GlosaCab.Text        = ListaBoleta.objDocumentoCab.DocumentoCabGlosa;
                cmb_Moneda.SelectedValue = ListaBoleta.objDocumentoCab.DocumentoCabTipoMoneda;
                cmb_Pago.SelectedValue   = ListaBoleta.objDocumentoCab.DocumentoCabTipoPago;
                txt_Direccion.Text       = ListaBoleta.objDocumentoCab.DocumentoCabClienteDireccion;
                txt_Guia.Text            = ListaBoleta.objDocumentoCab.DocumentoCabGuia;
                txt_Pedido.Text          = ListaBoleta.objDocumentoCab.DocumentoCabOrdenCompra;
                objListDocumentoDet      = objDocumento.listarDetalle(ListaBoleta.numeroDocumento, ListaBoleta.numeroSerie, Ventas.UNIDADNEGOCIO);
                grd_Detalle.DataSource   = objListDocumentoDet;
                grd_Detalle.Refresh();
                dpick_Fecha.Value = ListaBoleta.objDocumentoCab.DocumentoCabFecha;
                tipoCambio(dpick_Fecha.Value.ToShortDateString());
                llenarSumatorias();
            }
            else
            {
                if (Ventas.UNIDADNEGOCIO == "01")
                {
                    txt_Serie.Text = "B001";
                }
                else
                {
                    txt_Serie.Text = "B005";
                }
                txt_Numero.Text = objDocumento.correlativoFactura("03", Ventas.UNIDADNEGOCIO, txt_Serie.Text);
                habilitarCampos(false);
                tipoCambio(DateTime.Now.ToShortDateString());
            }

            rb_OT.Select();



            dpick_Fecha.TextChanged += Dpick_Fecha_TextChanged;

            txt_PrecioUnitario.TextChanged += Txt_PrecioUnitario_TextChanged;
            txt_Cantidad.TextChanged       += Txt_Cantidad_TextChanged;
            txt_Percepcion.Text             = "0";
            grd_Detalle.CellClick          += Grd_Detalle_CellClick;

            cmb_Moneda.SelectedValueChanged += Cmb_Moneda_SelectedValueChanged;
        }
        public NotaDeCredito()
        {
            InitializeComponent();

            this.ControlBox = false;
            this.Text       = "NOTA DE CRÉDITO";
            creditoForm     = this;

            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 20);
            objMonedaDao       = new MonedaDAO();
            objMonedaDao.tipoCambio();
            objTipoPagoDao = new TipoPagoDAO();
            objDocumento   = new DocumentoDAO();
            objProceso     = new Proceso();

            objContabilidadDocuDAO = new DocumentoContabilidadDAO();
            comboMoneda();
            comboMotivo();
            comboDocumento();
            cmb_TipoDocumento.SelectedValueChanged += Cmb_TipoDocumento_SelectedValueChanged;
            grd_Detalle.CellValueChanged           += Grd_Detalle_CellValueChanged;
            gridParams();
            if (ListaNotaCredito.operacionFactura == "V")
            {
                if (ListaNotaCredito.objDocumentoCab.EstadoSunat == 0)
                {
                    lbl_Anulado.Visible = true;
                }
                else if (ListaNotaCredito.objDocumentoCab.EstadoSunat == 1)
                {
                    btn_Modificar.Visible = true;
                }
                habilitarCampos(false);
                Modificar              = "M";
                txt_GlosaCab.Enabled   = false;
                btn_Add.Enabled        = false;
                btn_Limpiar.Enabled    = false;
                btn_SaveData.Enabled   = false;
                btn_Buscar.Enabled     = false;
                dpck_Fechadcto.Enabled = false;
                dpick_Fecha.Enabled    = false;
                cmb_Moneda.Enabled     = false;
                cmb_Motivo.Enabled     = false;

                txt_Cliente.Text         = ListaNotaCredito.objDocumentoCab.DocumentoCabCliente;
                txt_Ruc.Text             = ListaNotaCredito.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_Serie.Text           = ListaNotaCredito.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text          = ListaNotaCredito.objDocumentoCab.DocumentoCabNro;
                txt_GlosaCab.Text        = ListaNotaCredito.objDocumentoCab.DocumentoCabGlosa;
                cmb_Moneda.SelectedValue = ListaNotaCredito.objDocumentoCab.DocumentoCabTipoMoneda;
                cmb_Motivo.SelectedValue = ListaNotaCredito.objDocumentoCab.DocumentoCabTipoNotaCredito;
                txt_Direccion.Text       = ListaNotaCredito.objDocumentoCab.DocumentoCabClienteDireccion;
                txt_SerieBuscar.Text     = ListaNotaCredito.objDocumentoCab.DocumentoCabSerieRef;
                txt_NumeroBuscar.Text    = ListaNotaCredito.objDocumentoCab.DocumentoCabNroRef;
                dpck_Fechadcto.Value     = ListaNotaCredito.objDocumentoCab.DocumentoCabFechaDocRef;
                objListDocumentoDet      = objDocumento.listarDetalle(ListaNotaCredito.numeroDocumento, ListaNotaCredito.numeroSerie, Ventas.UNIDADNEGOCIO);

                /*objDocumentoDet = new DocumentoDet();
                 * objDocumentoDet.DocumentoCabNro = txt_Numero.Text;
                 * objDocumentoDet.DocumentoCabSerie = txt_Serie.Text;
                 * objDocumentoDet.DocumentoDesProducto = "ANULACIÓN FACTURA " + txt_Serie.Text + "-" + txt_Numero.Text;
                 * objDocumentoDet.DocumentoDetCantidad = 1;
                 * objDocumentoDet.DocumentoDetId = 1;
                 * objDocumentoDet.DocumentoDetCodEnt = Ventas.UNIDADNEGOCIO;
                 * objDocumentoDet.DocumentoDetIGV = ListaNotaCredito.objDocumentoCab.DocumentoCabIGV;
                 * objDocumentoDet.DocumentoDetPrecioTotal= ListaNotaCredito.objDocumentoCab.DocumentoCabTotalSinIGV;
                 * objDocumentoDet.DocumentoDetSubTotal = ListaNotaCredito.objDocumentoCab.DocumentoCabTotalSinIGV;
                 * objDocumentoDet.DocumentoDetPrecioSinIGV = ListaNotaCredito.objDocumentoCab.DocumentoCabTotalSinIGV;
                 * txt_ValorVenta.Text = ListaNotaCredito.objDocumentoCab.DocumentoCabTotalSinIGV.ToString();
                 * txt_TotalPagar.Text = ListaNotaCredito.objDocumentoCab.DocumentoCabTotal.ToString();
                 * txt_IGV.Text = ListaNotaCredito.objDocumentoCab.DocumentoCabIGV.ToString();
                 * if (Ventas.UNIDADNEGOCIO =="02")
                 * {
                 *  objDocumentoDet.DocumentoProdUMCod = "ZZ";
                 *  objDocumentoDet.DocumentoProdUMcorta = "040";
                 *  objDocumentoDet.ProductoCod = "000000000003";
                 * }
                 * else
                 * {
                 *  objDocumentoDet.DocumentoProdUMCod = "NIU";
                 *  objDocumentoDet.ProductoCod = "000000012343";
                 *  objDocumentoDet.DocumentoProdUMcorta = "039";
                 * }
                 */
                //objListDocumentoDet.Add(objDocumentoDet);
                grd_Detalle.DataSource = objListDocumentoDet;
                grd_Detalle.Refresh();
                llenarSumatorias();
                dpick_Fecha.Value = ListaNotaCredito.objDocumentoCab.DocumentoCabFecha;
                tipoCambio(dpick_Fecha.Value.ToShortDateString());
                //btn_Rest.Enabled = false;
            }
            else
            {
                objListDocumentoDet = new List <DocumentoDet>();
                Modificar           = "G";
                txt_Serie.Text      = "FC01";
                ContadorItem        = 0;


                txt_Numero.Text = objDocumento.correlativoFactura("07", "01", txt_Serie.Text);
                //habilitarCampos(true);
                tipoCambio(DateTime.Now.ToShortDateString());
                //btn_Rest.Enabled = true;
            }


            dpick_Fecha.TextChanged += Dpick_Fecha_TextChanged;



            txt_PrecioUnitario.TextChanged  += Txt_PrecioUnitario_TextChanged;
            txt_Cantidad.TextChanged        += Txt_Cantidad_TextChanged;
            cmb_Moneda.SelectedValueChanged += Cmb_Moneda_SelectedValueChanged;
            grd_Detalle.CellClick           += Grd_Detalle_CellClick;
        }
示例#7
0
        public LetraCambio()
        {
            InitializeComponent();
            this.ControlBox = false;
            objMonedaDao    = new MonedaDAO();
            objMonedaDao.tipoCambio();
            gridParams();
            this.StartPosition     = FormStartPosition.Manual;
            this.Location          = new Point(50, 20);
            letraCambioForm        = this;
            objContabilidadDocuDAO = new DocumentoContabilidadDAO();
            objTipoPagoDao         = new TipoPagoDAO();
            objDocumentoDao        = new DocumentoDAO();
            comboDocumento();
            comboPago();
            dpck_Fechavcto.ValueChanged   += Dpck_Fechavcto_ValueChanged;
            dpick_Fecha.ValueChanged      += Dpick_Fecha_ValueChanged;
            txt_Dividir.KeyPress          += Txt_Dividir_KeyPress;
            chk_Dividir.CheckedChanged    += Chk_Dividir_CheckedChanged;
            txt_Dividir.TextChanged       += Txt_Dividir_TextChanged;
            txt_Porcentaje.KeyPress       += Txt_Porcentaje_KeyPress;
            chk_Detraccion.CheckedChanged += Chk_Detraccion_CheckedChanged;
            txt_Porcentaje.TextChanged    += Txt_Porcentaje_TextChanged;
            txt_Porcentaje.Text            = "0";
            txt_Dividir.Text = "0";
            if (ListaLetraCambio.operacionLetra == "N")
            {
                Modificar = "N";
                if (Ventas.UNIDADNEGOCIO == "01")
                {
                    txt_Serie.Text = "M/";
                }
                else
                {
                    txt_Serie.Text = "G/";
                }
                dpck_Fechavcto.Value = DateTime.Now.AddMonths(1);
                dpick_Fecha.Enabled  = true;
                txt_Numero.Text      = objDocumentoDao.correlativoLetra(Ventas.UNIDADNEGOCIO);
            }
            else
            {
                if (ListaLetraCambio.objDocumentoCab.EstadoSunat == 0)
                {
                    lbl_Anulado.Visible = true;
                }
                else if (ListaLetraCambio.objDocumentoCab.EstadoSunat != 0)
                {
                    btn_Modificar.Visible = true;
                }
                txt_Serie.Text         = ListaLetraCambio.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text        = ListaLetraCambio.objDocumentoCab.DocumentoCabNro;
                txt_Cliente.Text       = ListaLetraCambio.objDocumentoCab.DocumentoCabCliente;
                txt_codcliente.Text    = ListaLetraCambio.objDocumentoCab.DocumentoCabClienteCod;
                txt_Direccion.Text     = ListaLetraCambio.objDocumentoCab.DocumentoCabClienteDireccion;
                txt_codcliente.Text    = ListaLetraCambio.objDocumentoCab.DocumentoCabClienteCod;
                txt_Aval.Text          = ListaLetraCambio.objDocumentoCab.DocumentoCabClienteAval;
                txt_DireccionAval.Text = ListaLetraCambio.objDocumentoCab.DocumentoCabClienteDireccionAval;
                txt_Porcentaje.Text    = ListaLetraCambio.objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                txt_Ruc.Text           = ListaLetraCambio.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_RucAval.Text       = ListaLetraCambio.objDocumentoCab.DocumentoCabClienteRucAval;
                txt_Dividir.Text       = ListaLetraCambio.objDocumentoCab.DocumentoCabDividir.ToString();
                objListaLetraDet       = objDocumentoDao.listarLetraDet(txt_Serie.Text, txt_Numero.Text);
                txt_fechaemidcto.Text  = dpick_Fecha.Value.ToShortDateString();
                txt_fechavctodcto.Text = dpck_Fechavcto.Value.ToShortDateString();
                txt_CodMoneda.Text     = ListaLetraCambio.objDocumentoCab.DocumentoCabTipoMoneda;
                dpick_Fecha.Value      = ListaLetraCambio.objDocumentoCab.DocumentoCabFecha;
                dpck_Fechavcto.Value   = ListaLetraCambio.objDocumentoCab.DocumentoCabFechaVcto;

                grdDocumento.DataSource = objListaLetraDet;
                grdDocumento.Refresh();
                llenarSumatorias();
                btn_SaveData.Enabled      = false;
                btn_Limpiar.Enabled       = false;
                btn_Add.Enabled           = false;
                txt_Porcentaje.Enabled    = false;
                btn_Buscar.Enabled        = false;
                btn_BuscarDocu.Enabled    = false;
                btn_BuscarAval.Enabled    = false;
                btn_Limpiar.Enabled       = false;
                chk_Dividir.Enabled       = false;
                chk_Detraccion.Enabled    = false;
                dpck_Fechavcto.Enabled    = false;
                cmb_Pago.SelectedValue    = ListaLetraCambio.objDocumentoCab.DocumentoCabTipoPago;
                cmb_Pago.Enabled          = false;
                cmb_TipoDocumento.Enabled = false;
            }
            grdDocumento.CellClick        += GrdDocumento_CellClick;
            txt_Tcambio.Text               = objMonedaDao.getTipoCambioVenta(dpick_Fecha.Value.ToString("dd/MM/yyyy")).ToString().PadRight(5, '0');
            cmb_Pago.SelectedIndexChanged += Cmb_Pago_SelectedIndexChanged;
        }
示例#8
0
        public Factura()
        {
            InitializeComponent();
            Modificar          = "G";
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 20);
            this.ControlBox    = false;
            this.Text          = "FACTURAS";
            formFactura        = this;
            objMonedaDao       = new MonedaDAO();
            objMonedaDao.tipoCambio();
            objEjercicio   = new Ejercicio();
            objTipoPagoDao = new TipoPagoDAO();
            objDocumento   = new DocumentoDAO();
            objProceso     = new Proceso();
            comboMoneda();
            comboPago();
            cmbejercicio();
            chk_Detraccion.CheckedChanged += Chk_Detraccion_CheckedChanged;
            cmb_Pago.SelectedIndexChanged += Cmb_Pago_SelectedIndexChanged;
            gridParams();
            txt_Porcentaje.TextChanged += Txt_Porcentaje_TextChanged;
            txt_Porcentaje.Text         = "0";
            if (ListaFactura.operacionFactura == "V")
            {
                if (ListaFactura.objDocumentoCab.EstadoSunat == 0)
                {
                    lbl_Anulado.Visible = true;
                }
                else if (ListaFactura.objDocumentoCab.EstadoSunat == 1)
                {
                    btn_Modificar.Visible = true;
                }
                habilitarBotones(false, false);
                habilitarCampos(false);
                txt_Guia.Enabled       = false;
                txt_OT.Enabled         = false;
                txt_Pedido.Enabled     = false;
                txt_GlosaCab.Enabled   = false;
                btn_BuscarOT.Enabled   = false;
                btn_Limpiar.Enabled    = false;
                btn_SaveData.Enabled   = false;
                btn_Buscar.Enabled     = false;
                dpck_Fechavcto.Enabled = false;
                dpick_Fecha.Enabled    = false;
                cmb_Moneda.Enabled     = false;
                cmb_Pago.Enabled       = false;

                if (ListaFactura.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    lbl_Moneda.Text = "$";
                }
                else
                {
                    lbl_Moneda.Text = "S/";
                }
                objDocumentoDet = new DocumentoDet();

                if (objDocumentoDet.DocumentoProdUM == "NIU")
                {
                    txt_umcod.Text = "039";
                }
                else
                {
                    txt_umcod.Text = "040";
                }

                txt_Cliente.Text         = ListaFactura.objDocumentoCab.DocumentoCabCliente;
                txt_Ruc.Text             = ListaFactura.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_Serie.Text           = ListaFactura.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text          = ListaFactura.objDocumentoCab.DocumentoCabNro;
                txt_GlosaCab.Text        = ListaFactura.objDocumentoCab.DocumentoCabGlosa;
                txt_Direccion.Text       = ListaFactura.objDocumentoCab.DocumentoCabClienteDireccion;
                cmb_Moneda.SelectedValue = ListaFactura.objDocumentoCab.DocumentoCabTipoMoneda;
                objListDocumentoDet      = objDocumento.listarDetalle(ListaFactura.numeroDocumento, ListaFactura.numeroSerie, Ventas.UNIDADNEGOCIO);
                dpick_Fecha.Value        = ListaFactura.objDocumentoCab.DocumentoCabFecha;
                tipoCambio(dpick_Fecha.Value.ToShortDateString());
                cmb_Pago.SelectedValue = ListaFactura.objDocumentoCab.DocumentoCabTipoPago;
                txt_Detraccion.Text    = ListaFactura.objDocumentoCab.DocumentoCabDetraccion.ToString();
                txt_Porcentaje.Text    = ListaFactura.objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                txt_Guia.Text          = ListaFactura.objDocumentoCab.DocumentoCabGuia;
                txt_intercorp.Text     = ListaFactura.objDocumentoCab.Intercorp;
                txt_Pedido.Text        = ListaFactura.objDocumentoCab.DocumentoCabOrdenCompra;
                txt_codcliente.Text    = ListaFactura.objDocumentoCab.DocumentoCabClienteCod;
                grd_Detalle.DataSource = objListDocumentoDet;
                grd_Detalle.Refresh();
                llenarSumatorias();
            }
            else
            {
                if (Ventas.UNIDADNEGOCIO == "01")
                {
                    txt_Serie.Text = "F001";
                }
                else
                {
                    txt_Serie.Text = "F005";
                }

                txt_Numero.Text      = objDocumento.correlativoFactura("01", Ventas.UNIDADNEGOCIO, txt_Serie.Text);
                dpck_Fechavcto.Value = DateTime.Now.AddMonths(1);
                habilitarCampos(false);
                tipoCambio(DateTime.Now.ToShortDateString());
                objDocumentoCab     = new DocumentoCab();
                objListDocumentoDet = new List <DocumentoDet>();
                ContadorItem        = 1;
            }

            rb_OT.Select();



            dpick_Fecha.TextChanged += Dpick_Fecha_TextChanged;

            txt_PrecioUnitario.TextChanged += Txt_PrecioUnitario_TextChanged;
            txt_Cantidad.TextChanged       += Txt_Cantidad_TextChanged;
            txt_Percepcion.Text             = "0";
            grd_Detalle.CellClick          += Grd_Detalle_CellClick;

            cmb_Moneda.SelectedValueChanged += Cmb_Moneda_SelectedValueChanged;
        }
示例#9
0
        public LetraReporte(String rep)
        {
            InitializeComponent();
            tipoReporte     = rep;
            this.ControlBox = false;
            objMonedaDao    = new MonedaDAO();
            objMonedaDao.tipoCambio();
            gridParams();
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 20);

            objContabilidadDocuDAO = new DocumentoContabilidadDAO();
            objTipoPagoDao         = new TipoPagoDAO();
            objDocumentoDao        = new DocumentoDAO();
            comboDocumento();
            comboPago();

            txt_Dividir.KeyPress          += Txt_Dividir_KeyPress;
            chk_Dividir.CheckedChanged    += Chk_Dividir_CheckedChanged;
            txt_Dividir.TextChanged       += Txt_Dividir_TextChanged;
            txt_Porcentaje.KeyPress       += Txt_Porcentaje_KeyPress;
            chk_Detraccion.CheckedChanged += Chk_Detraccion_CheckedChanged;
            txt_Porcentaje.TextChanged    += Txt_Porcentaje_TextChanged;
            txt_Porcentaje.Text            = "0";
            txt_Dividir.Text = "0";

            if (tipoReporte == "F")
            {
                if (ReporteDocumentosPorFecha.objDocumentoCab.EstadoSunat == 0)
                {
                    lbl_Anulado.Visible = true;
                }

                txt_Serie.Text   = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text  = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabNro;
                txt_Cliente.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabCliente;

                txt_Direccion.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabClienteDireccion;

                txt_Aval.Text          = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabClienteAval;
                txt_DireccionAval.Text = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabClienteDireccionAval;
                txt_Porcentaje.Text    = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                txt_Ruc.Text           = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_RucAval.Text       = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabClienteRucAval;
                txt_Dividir.Text       = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabDividir.ToString();
                objListaLetraDet       = objDocumentoDao.listarLetraDetReporte(txt_Serie.Text, txt_Numero.Text, ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabOrdenCompra, Ventas.UNIDADNEGOCIO);
                dpick_Fecha.Value      = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFecha;
                dpck_Fechavcto.Value   = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFechaVcto;
                cmb_Pago.SelectedValue = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTipoPago;
            }
            else
            {
                if (ReporteDocumentosPorCliente.objDocumentoCab.EstadoSunat == 0)
                {
                    lbl_Anulado.Visible = true;
                }

                txt_Serie.Text   = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabSerie;
                txt_Numero.Text  = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabNro;
                txt_Cliente.Text = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabCliente;

                txt_Direccion.Text = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabClienteDireccion;

                txt_Aval.Text          = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabClienteAval;
                txt_DireccionAval.Text = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabClienteDireccionAval;
                txt_Porcentaje.Text    = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                txt_Ruc.Text           = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabClienteDocumento;
                txt_RucAval.Text       = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabClienteRucAval;
                txt_Dividir.Text       = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabDividir.ToString();
                objListaLetraDet       = objDocumentoDao.listarLetraDetReporte(txt_Serie.Text, txt_Numero.Text, ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabOrdenCompra, Ventas.UNIDADNEGOCIO);
                dpick_Fecha.Value      = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabFecha;
                dpck_Fechavcto.Value   = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabFechaVcto;
                cmb_Pago.SelectedValue = ReporteDocumentosPorCliente.objDocumentoCab.DocumentoCabTipoPago;
            }

            grdDocumento.DataSource = objListaLetraDet;
            grdDocumento.Refresh();
            llenarSumatorias();
            btn_SaveData.Enabled = false;
            btn_Limpiar.Enabled  = false;

            txt_Porcentaje.Enabled = false;
            btn_Buscar.Enabled     = false;

            btn_Limpiar.Enabled    = false;
            chk_Dividir.Enabled    = false;
            chk_Detraccion.Enabled = false;
            dpck_Fechavcto.Enabled = false;

            cmb_Pago.Enabled          = false;
            cmb_TipoDocumento.Enabled = false;


            grdDocumento.CellClick        += GrdDocumento_CellClick;
            txt_Tcambio.Text               = objMonedaDao.getTipoCambioVenta(dpick_Fecha.Value.ToString("dd/MM/yyyy")).ToString().PadRight(5, '0');
            cmb_Pago.SelectedIndexChanged += Cmb_Pago_SelectedIndexChanged;
        }