Esempio n. 1
0
 public AbonoBanco()
 {
     InitializeComponent();
     AbonoForm         = this;
     objBancoDAO       = new BancoDAO();
     objComboBanco     = new CuentaBanco();
     objBancoDatos     = new CuentaBanco();
     objMonedaDao      = new MonedaDAO();
     objAbonoBancoDet  = new AbonoBancoDet();
     objAbonoBancoCab  = new AbonoBancoCab();
     objFacturaAbono   = new FacturaAbono();
     objAsientoDAO     = new AsientoDAO();
     objAsiento        = new Asiento();
     objAsientoDetalle = new AsientoDetalle();
     cargarCmbBanco();
     cmb_Banco.SelectedIndexChanged += Cmb_Banco_SelectedIndexChanged;
     txt_Fecha.Text     = DateTime.Now.ToString("dd/MM/yyyy");
     objComboBanco      = (CuentaBanco)cmb_Banco.SelectedItem;
     objBancoDatos      = objBancoDAO.listarBancoDatos(Ventas.UNIDADNEGOCIO, objComboBanco.Codigo, objComboBanco.Descripcion);
     txt_Cuenta.Text    = objBancoDatos.Cuenta;
     txt_Moneda.Text    = objBancoDatos.Moneda;
     txt_Tcambio.Text   = objMonedaDao.getTipoCambioVenta(DateTime.Now.ToShortDateString()).ToString().PadRight(5, '0');;
     txt_MonedaCod.Text = objBancoDatos.MonedaCod;
     //gridParams();
     grd_Detalle.CellClick += Grd_Detalle_CellClick;
 }
 public CanjeLetraNuevo()
 {
     InitializeComponent();
     this.ControlBox  = false;
     txt_tipodoc.Text = "LT";
     objLetra         = new LetraCab();
     objMonedaDao     = new MonedaDAO();
     objVoucherDao    = new VoucherDAO();
     objDocumentoDAO  = new DocumentoDAO();
     objMonedaDao.tipoCambio();
     comboMoneda();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 20);
     canjeletranuevo    = this;
     txt_Tcambio.Text   = objMonedaDao.getTipoCambioVenta(dpick_Fecha.Value.ToString("dd/MM/yyyy")).ToString().PadRight(5, '0');
     if (CanjeLetra.operacionLetra == "V")
     {
         objLetra = CanjeLetra.objVoucher;
         llenarCabecera(objLetra);
         objListaLetraDet = objVoucherDao.listarLetraDet(objLetra.NroRegistro, Ventas.UNIDADNEGOCIO);
         llenarDetalle(objListaLetraDet);
         sumatoria();
         btn_SaveData.Enabled  = false;
         btn_Modificar.Visible = true;
     }
     else if (CanjeLetra.operacionLetra == "A")
     {
         objLetra = CanjeLetra.objVoucher;
         llenarCabecera(objLetra);
         objListaLetraDet = objVoucherDao.listarLetraDet(objLetra.NroRegistro, Ventas.UNIDADNEGOCIO);
         llenarDetalle(objListaLetraDet);
         sumatoria();
         btn_Add.Enabled        = false;
         btn_Anular.Enabled     = false;
         btn_Buscar.Enabled     = false;
         btn_Modificar.Enabled  = false;
         btn_SaveData.Enabled   = false;
         grd_facturas.Enabled   = false;
         dpck_Fechavcto.Enabled = false;
         dpick_Fecha.Enabled    = false;
         dtp_compromiso.Enabled = false;
         cmb_Moneda.Enabled     = false;
         btn_Modificar.Visible  = false;
     }
     else if (CanjeLetra.operacionLetra == "N")
     {
         Modificar = "N";
         if (Ventas.UNIDADNEGOCIO == "01")
         {
             txt_SerieDcto.Text = "0001";
         }
         else
         {
             txt_SerieDcto.Text = "0001";
         }
         habilitarBotones(true, false);
     }
 }
Esempio n. 3
0
 public void tipoCambio(String date)
 {
     txt_Tcambio.Text = objMoneda.getTipoCambioVenta(date).ToString().PadRight(5, '0');
 }
        private void formatearFactura(String qr)
        {
            objListNotaReporte  = new List <NotaReporteDTO>();
            objListDocumentoDet = objDocumentoDao.detalleReporte(objDocumentoCab.DocumentoCabSerie,
                                                                 objDocumentoCab.DocumentoCabNro, Ventas.UNIDADNEGOCIO);
            if (objListDocumentoDet.Count > 0)
            {
                for (int i = 0; i < objListDocumentoDet.Count; i++)
                {
                    objNotaReporte               = new NotaReporteDTO();
                    objNotaReporte.Cantidad      = objListDocumentoDet[i].DocumentoDetCantidad.ToString("C").Substring(3);
                    objNotaReporte.Direccion     = objDocumentoCab.DocumentoCabClienteDireccion;
                    objNotaReporte.FechaEmision  = objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                    objNotaReporte.SerieRef      = objDocumentoCab.DocumentoCabSerieRef;
                    objNotaReporte.NumeroRef     = objDocumentoCab.DocumentoCabNroRef;
                    objNotaReporte.FechaRef      = objDocumentoCab.DocumentoCabFechaDocRef.ToShortDateString();
                    objNotaReporte.IGV           = objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                    objNotaReporte.Letras        = objDocumentoDao.numeroALetras(convertToDouble(objDocumentoCab.DocumentoCabTotal.ToString())) + " " + objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                    objNotaReporte.Moneda        = objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                    objNotaReporte.Numero        = objDocumentoCab.DocumentoCabNro.TrimEnd();
                    objNotaReporte.Serie         = objDocumentoCab.DocumentoCabSerie;
                    objNotaReporte.Qr            = qr;
                    objNotaReporte.Tipo          = "la Nota de Débito Electrónica";
                    objNotaReporte.Descripcion   = objDocumentoCab.DocumentoCabGlosa.TrimEnd();
                    objNotaReporte.TOTAL         = objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                    objNotaReporte.TotalSinIGV   = objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                    objNotaReporte.UM            = objListDocumentoDet[i].DocumentoProdUMcorta;
                    objNotaReporte.ValorUnitario = objListDocumentoDet[i].DocumentoDetPrecioSinIGV.ToString("C").Substring(3);
                    objNotaReporte.Importe       = objListDocumentoDet[i].DocumentoDetSubTotal.ToString("C").Substring(3);
                    objNotaReporte.Descr         = objListDocumentoDet[i].DocumentoDesProducto.TrimEnd() + " - " + objListDocumentoDet[i].DocumentoDetGlosa.TrimEnd();
                    objNotaReporte.RazonSocial   = objDocumentoCab.DocumentoCabCliente;
                    objNotaReporte.RUC           = objDocumentoCab.DocumentoCabClienteDocumento;
                    objNotaReporte.Motivo        = objDocumentoCab.DocumentoCabNotaDebito;
                    objNotaReporte.TipoDocumento = "NOTA DE DÉBITO";
                    objNotaReporte.TipoCambio    = objMoneda.getTipoCambioVenta(objNotaReporte.FechaEmision).ToString().PadRight(5, '0');

                    if (objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                    {
                        objNotaReporte.Simbolo = "$";
                    }
                    else
                    {
                        objNotaReporte.Simbolo = "S/";
                    }
                    objListNotaReporte.Add(objNotaReporte);
                }
            }
            else
            {
                objNotaReporte = new NotaReporteDTO();

                objNotaReporte.Direccion    = objDocumentoCab.DocumentoCabClienteDireccion;
                objNotaReporte.FechaEmision = objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                objNotaReporte.SerieRef     = objDocumentoCab.DocumentoCabSerieRef;
                objNotaReporte.NumeroRef    = objDocumentoCab.DocumentoCabNroRef;
                objNotaReporte.FechaRef     = objDocumentoCab.DocumentoCabFechaDocRef.ToShortDateString();
                objNotaReporte.IGV          = objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                objNotaReporte.Letras       = objDocumentoDao.numeroALetras(convertToDouble(objDocumentoCab.DocumentoCabTotal.ToString())) + " " + objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                objNotaReporte.Moneda       = objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                objNotaReporte.Numero       = objDocumentoCab.DocumentoCabNro.TrimEnd();
                objNotaReporte.Serie        = objDocumentoCab.DocumentoCabSerie;
                objNotaReporte.Descripcion  = objDocumentoCab.DocumentoCabGlosa.TrimEnd();
                objNotaReporte.TOTAL        = objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                objNotaReporte.TotalSinIGV  = objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                objNotaReporte.Motivo       = objDocumentoCab.DocumentoCabNotaDebito;
                objNotaReporte.Tipo         = "la Nota de Débito Electrónica";
                objNotaReporte.RazonSocial  = objDocumentoCab.DocumentoCabCliente;
                objNotaReporte.RUC          = objDocumentoCab.DocumentoCabClienteDocumento;

                objNotaReporte.TipoDocumento = "NOTA DE CRÉDITO";
                if (objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    objNotaReporte.Simbolo = "$";
                }
                else
                {
                    objNotaReporte.Simbolo = "S/";
                }
                objListNotaReporte.Add(objNotaReporte);
            }
        }
        private void formatearFactura(String qr)
        {
            objListNotaReporte = new List <NotaReporteDTO>();
            if (objListDocumentoDet.Count > 0)
            {
                for (int i = 0; i < objListDocumentoDet.Count; i++)
                {
                    objNotaReporte               = new NotaReporteDTO();
                    objNotaReporte.Cantidad      = objListDocumentoDet[i].DocumentoDetCantidad.ToString("C").Substring(3);
                    objNotaReporte.Direccion     = txt_Direccion.Text;
                    objNotaReporte.FechaEmision  = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                    objNotaReporte.SerieRef      = txt_SerieBuscar.Text;
                    objNotaReporte.NumeroRef     = txt_NumeroBuscar.Text;
                    objNotaReporte.FechaRef      = dpck_Fechadcto.Value.ToShortDateString();
                    objNotaReporte.IGV           = txt_IGV.Text;
                    objNotaReporte.Letras        = lblTotal.Text.TrimEnd();
                    objNotaReporte.Moneda        = txt_Moneda.Text.TrimEnd();
                    objNotaReporte.Numero        = txt_Numero.Text.TrimEnd();
                    objNotaReporte.Serie         = txt_Serie.Text;
                    objNotaReporte.Motivo        = txt_Motivo.Text;
                    objNotaReporte.TOTAL         = txt_TotalsinPercep.Text;
                    objNotaReporte.TotalSinIGV   = txt_ValorVenta.Text;
                    objNotaReporte.UM            = objListDocumentoDet[i].DocumentoProdUMcorta;
                    objNotaReporte.ValorUnitario = objListDocumentoDet[i].DocumentoDetPrecioSinIGV.ToString("C").Substring(3);
                    objNotaReporte.Importe       = objListDocumentoDet[i].DocumentoDetSubTotal.ToString("C").Substring(3);
                    objNotaReporte.Descr         = objListDocumentoDet[i].DocumentoDetGlosa.TrimEnd();
                    objNotaReporte.RazonSocial   = txt_Cliente.Text;
                    objNotaReporte.RUC           = txt_Ruc.Text;
                    objNotaReporte.Tipo          = "la Nota de Débito Electrónica";
                    objNotaReporte.Qr            = qr;
                    objNotaReporte.Descripcion   = txt_GlosaCab.Text;
                    objNotaReporte.TipoDocumento = tipoDocumento;
                    objNotaReporte.TipoCambio    = objMoneda.getTipoCambioVenta(objNotaReporte.FechaEmision).ToString().PadRight(5, '0');

                    if (ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                    {
                        objNotaReporte.Simbolo = "$";
                    }
                    else
                    {
                        objNotaReporte.Simbolo = "S/";
                    }
                    objListNotaReporte.Add(objNotaReporte);
                }
            }
            else
            {
                objNotaReporte = new NotaReporteDTO();

                objNotaReporte.Direccion     = txt_Direccion.Text;
                objNotaReporte.FechaEmision  = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                objNotaReporte.IGV           = txt_IGV.Text;
                objNotaReporte.Letras        = lblTotal.Text.TrimEnd();
                objNotaReporte.Moneda        = txt_Moneda.Text.TrimEnd();
                objNotaReporte.Numero        = txt_Numero.Text.TrimEnd();
                objNotaReporte.Serie         = txt_Serie.Text;
                objNotaReporte.TOTAL         = txt_TotalsinPercep.Text;
                objNotaReporte.TotalSinIGV   = txt_ValorVenta.Text;
                objNotaReporte.RazonSocial   = txt_Cliente.Text;
                objNotaReporte.RUC           = txt_Ruc.Text;
                objNotaReporte.Descripcion   = txt_GlosaCab.Text;
                objNotaReporte.SerieRef      = txt_SerieBuscar.Text;
                objNotaReporte.NumeroRef     = txt_NumeroBuscar.Text;
                objNotaReporte.FechaRef      = dpck_Fechadcto.Value.ToShortDateString();
                objNotaReporte.Motivo        = txt_Motivo.Text;
                objNotaReporte.Tipo          = "la Nota de Débito Electrónica";
                objNotaReporte.Qr            = qr;
                objNotaReporte.TipoDocumento = tipoDocumento;
                if (ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    objNotaReporte.Simbolo = "$";
                }
                else
                {
                    objNotaReporte.Simbolo = "S/";
                }
                objListNotaReporte.Add(objNotaReporte);
            }
        }
Esempio n. 6
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;
        }
Esempio n. 7
0
        private void formatearFactura(String qr)
        {
            objListDocumentoDet   = new List <DocumentoDet>();
            objListFacturaReporte = new List <FacturaReporteDTO>();
            objListDocumentoDet   = objDocumentoDao.detalleReporte(objDocumentoCab.DocumentoCabSerie, objDocumentoCab.DocumentoCabNro, Ventas.UNIDADNEGOCIO);

            if (objListDocumentoDet.Count > 0)
            {
                for (int i = 0; i < objListDocumentoDet.Count; i++)
                {
                    objFacturaReporte                      = new FacturaReporteDTO();
                    objFacturaReporte.Cantidad             = objListDocumentoDet[i].DocumentoDetCantidad.ToString("C").Substring(3);
                    objFacturaReporte.Descuento            = "0";
                    objFacturaReporte.Direccion            = objDocumentoCab.DocumentoCabClienteDireccion;
                    objFacturaReporte.FechaEmision         = objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                    objFacturaReporte.FechaVcto            = objDocumentoCab.DocumentoCabFechaVcto.ToShortDateString();
                    objFacturaReporte.GuiaRemision         = "";
                    objFacturaReporte.IGV                  = objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                    objFacturaReporte.Letras               = objDocumentoDao.numeroALetras(convertToDouble(objDocumentoCab.DocumentoCabTotal.ToString())) + " " + objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                    objFacturaReporte.Moneda               = objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                    objFacturaReporte.Numero               = objDocumentoCab.DocumentoCabNro.TrimEnd();
                    objFacturaReporte.Serie                = objDocumentoCab.DocumentoCabSerie;
                    objFacturaReporte.TipoPago             = objDocumentoCab.DocumentoCabPago.TrimEnd();
                    objFacturaReporte.TOTAL                = objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                    objFacturaReporte.TotalSinIGV          = objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                    objFacturaReporte.UM                   = objListDocumentoDet[i].DocumentoProdUMcorta;
                    objFacturaReporte.ValorUnitario        = objListDocumentoDet[i].DocumentoDetPrecioSinIGV.ToString("C").Substring(3);
                    objFacturaReporte.ValorVenta           = objListDocumentoDet[i].DocumentoDetSubTotal.ToString("C").Substring(3);
                    objFacturaReporte.PrecioUnitario       = ((objListDocumentoDet[i].DocumentoDetPrecioSinIGV * 0.18) + objListDocumentoDet[i].DocumentoDetPrecioSinIGV).ToString("C").Substring(3);
                    objFacturaReporte.ProdCod              = objListDocumentoDet[i].ProductoCod.TrimEnd();
                    objFacturaReporte.ProdDescrip          = objListDocumentoDet[i].DocumentoDesProducto.TrimEnd() + " - " + objListDocumentoDet[i].DocumentoDetGlosa;
                    objFacturaReporte.RazonSocial          = objDocumentoCab.DocumentoCabCliente;
                    objFacturaReporte.RUC                  = objDocumentoCab.DocumentoCabClienteDocumento;
                    objFacturaReporte.OrdenCompra          = "";
                    objFacturaReporte.Tipo                 = "la Factura Electrónica";
                    objFacturaReporte.QR                   = qr;
                    objFacturaReporte.Glosa                = objDocumentoCab.DocumentoCabGlosa;
                    objFacturaReporte.TipoDocumento        = "FACTURA ELECTRÓNICA";
                    objFacturaReporte.DetraccionPorcentaje = objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                    objFacturaReporte.DetraccionMonto      = objDocumentoCab.DocumentoCabDetraccion.ToString();
                    objFacturaReporte.GuiaRemision         = objDocumentoCab.DocumentoCabGuia;
                    objFacturaReporte.OrdenCompra          = objDocumentoCab.DocumentoCabOrdenCompra;
                    objFacturaReporte.TipoCambio           = objMonedaDao.getTipoCambioVenta(objFacturaReporte.FechaEmision).ToString().PadRight(5, '0');

                    if (Ventas.UNIDADNEGOCIO == "02")
                    {
                        objFacturaReporte.DatoDetraccion = "CÓDIGO PARA DETRACCIÓN: BIEN O SERVICIO:(025) Fabr de bienes x encargo/operación/ (01) Venta de bienes o prest de serv";
                    }
                    if (objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                    {
                        objFacturaReporte.Simbolo = "$";
                    }
                    else
                    {
                        objFacturaReporte.Simbolo = "S/";
                    }
                    objListFacturaReporte.Add(objFacturaReporte);
                }
            }
            else
            {
                objFacturaReporte              = new FacturaReporteDTO();
                objFacturaReporte.Descuento    = "0";
                objFacturaReporte.Direccion    = objDocumentoCab.DocumentoCabClienteDireccion;
                objFacturaReporte.FechaEmision = objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                objFacturaReporte.FechaVcto    = objDocumentoCab.DocumentoCabFechaVcto.ToShortDateString();
                objFacturaReporte.GuiaRemision = "";
                objFacturaReporte.IGV          = objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                objFacturaReporte.Letras       = objDocumentoDao.numeroALetras(convertToDouble(objDocumentoCab.DocumentoCabTotal.ToString())) + " " + objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                objFacturaReporte.Moneda       = objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                objFacturaReporte.Numero       = objDocumentoCab.DocumentoCabNro.TrimEnd();
                objFacturaReporte.Serie        = objDocumentoCab.DocumentoCabSerie;
                objFacturaReporte.TipoPago     = objDocumentoCab.DocumentoCabPago.TrimEnd();
                objFacturaReporte.TOTAL        = objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                objFacturaReporte.TotalSinIGV  = objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                objFacturaReporte.RazonSocial  = objDocumentoCab.DocumentoCabCliente;
                objFacturaReporte.RUC          = objDocumentoCab.DocumentoCabClienteDocumento;

                objFacturaReporte.Tipo                 = "la Factura Electrónica";
                objFacturaReporte.QR                   = qr;
                objFacturaReporte.OrdenCompra          = "";
                objFacturaReporte.TipoDocumento        = "FACTURA ELECTRÓNICA";
                objFacturaReporte.DetraccionPorcentaje = objDocumentoCab.DocumentoCabDetraccionPorcentaje.ToString();
                objFacturaReporte.DetraccionMonto      = objDocumentoCab.DocumentoCabDetraccion.ToString();
                objFacturaReporte.GuiaRemision         = objDocumentoCab.DocumentoCabGuia;
                objFacturaReporte.OrdenCompra          = objDocumentoCab.DocumentoCabOrdenCompra;
                if (Ventas.UNIDADNEGOCIO == "02")
                {
                    objFacturaReporte.DatoDetraccion = "CÓDIGO PARA DETRACCIÓN: BIEN O SERVICIO:(025) Fabr de bienes x encargo/operación/ (01) Venta de bienes o prest de serv";
                }
                if (ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    objFacturaReporte.Simbolo = "$";
                }
                else
                {
                    objFacturaReporte.Simbolo = "S/";
                }
                objListFacturaReporte.Add(objFacturaReporte);
            }
        }
        void formatearVoucher()
        {
            objListaVoucherDet     = new List <VoucherDet>();
            objListaVoucherReporte = new List <VoucherReporte>();
            objListaVoucherDet     = objVoucherDao.listarVoucherDet(objVoucher.NumeroVoucher, Ventas.UNIDADNEGOCIO);

            if (objListaVoucherDet.Count >= 1)
            {
                for (int i = 0; i < objListaVoucherDet.Count; i++)
                {
                    VoucherReporte objVoucherReporte;
                    objVoucherReporte       = new VoucherReporte();
                    objVoucherReporte.Banco = objVoucher.Banco;
                    objVoucherReporte.Fecha = objVoucher.FechaPago.ToString("dd/MM/yyyy");
                    objVoucherReporte.Monto = objVoucher.Monto.ToString("G");

                    if (objVoucher.MonedaCod.ToString() == "PEN")
                    {
                        objVoucher.Moneda         = "SOLES";
                        objVoucherReporte.simbolo = "S./";
                    }
                    else if (objVoucher.MonedaCod.ToString() == "USD")
                    {
                        objVoucher.Moneda         = "DOLARES AMERICANOS";
                        objVoucherReporte.simbolo = "$";
                    }
                    else if (objVoucher.MonedaCod.ToString() == "EUR")
                    {
                        objVoucher.Moneda = "EUROS";
                    }

                    objVoucherReporte.MontoLetras = objDocumentoDAO.numeroALetras(objVoucher.Monto) + " " + objVoucher.Moneda;
                    objVoucherReporte.NroVoucher  = objVoucher.NumeroVoucher;
                    objVoucherReporte.Observacion = objVoucher.Observacion;
                    objVoucherReporte.Persona     = objVoucher.Solicitante.Trim();
                    objVoucherReporte.RazonSocial = objListaVoucherDet[i].RazonSocial.ToString().Trim();
                    objVoucherReporte.TipoCambio  = objMonedaDao.getTipoCambioVenta(objVoucher.FechaPago.ToShortDateString()).ToString().PadRight(5, '0');
                    objVoucherReporte.Usuario     = Ventas.UsuarioSession;
                    if (objVoucher.TpersonaCod == "04")
                    {
                        objVoucherReporte.PersonaDocumento = "";
                    }
                    else
                    {
                        objVoucherReporte.PersonaDocumento = objVoucher.SolicitaCod;
                    }
                    if (objVoucher.Estado == "A")
                    {
                        objVoucherReporte.Anulado = "A N U L A D O";
                    }
                    objVoucherReporte.Descripcion    = objListaVoucherDet[i].TAOB.ToString();
                    objVoucherReporte.FechaEmision   = objListaVoucherDet[i].FechaEmiRef.ToString();
                    objVoucherReporte.ImporteDetalle = objListaVoucherDet[i].Importe.ToString("0.00");
                    objVoucherReporte.NroDocumento   = objListaVoucherDet[i].NroDocumento;
                    objVoucherReporte.Ruc            = objListaVoucherDet[i].NroOt + " " + "-" + " " + objListaVoucherDet[i].DirOt;
                    objListaVoucherReporte.Add(objVoucherReporte);
                }
            }
            else
            {
                VoucherReporte objVoucherReporte;
                // for (int i = 0; i < objListaVoucherDet.Count; i++)
                // {
                objVoucherReporte       = new VoucherReporte();
                objVoucherReporte.Banco = objVoucher.Banco;
                //objVoucherReporte.Descripcion = objListaVoucherDet[i].Descripcion;
                objVoucherReporte.Fecha = objVoucher.FechaPago.ToString("dd/MM/yyyy");
                //objVoucherReporte.ImporteDetalle = objListaVoucherDet[i].Importe.ToString("C").Substring(3);
                objVoucherReporte.Monto       = objVoucher.Monto.ToString("G") /*.Substring(3)*/;
                objVoucherReporte.MontoLetras = objDocumentoDAO.numeroALetras(objVoucher.Monto) + " " + objVoucher.Moneda.TrimEnd();
                objVoucherReporte.NroCheque   = objVoucher.NumeroCheque;
                //objVoucherReporte.NroDocumento = objListaVoucherDet[i].NroDocumento;

                if (objVoucher.MonedaCod.ToString() == "PEN")
                {
                    objVoucherReporte.simbolo = "S./";
                }
                else if (objVoucher.MonedaCod.ToString() == "USD")
                {
                    objVoucherReporte.simbolo = "$";
                }
                objVoucherReporte.NroVoucher  = objVoucher.NumeroVoucher;
                objVoucherReporte.Observacion = objVoucher.Observacion;
                objVoucherReporte.Persona     = objVoucher.Solicitante;
                if (objVoucher.TpersonaCod == "04")
                {
                    objVoucherReporte.PersonaDocumento = "";
                }
                else
                {
                    objVoucherReporte.PersonaDocumento = objVoucher.SolicitaCod;
                }
                if (objVoucher.Estado == "A")
                {
                    objVoucherReporte.Anulado = "A N U L A D O";
                }

                //objVoucherReporte.RazonSocial = objListaVoucherDet[i].
                //objVoucherReporte.Ruc = objListaVoucherDet[i].
                objVoucherReporte.TipoCambio = objMonedaDao.getTipoCambioVenta(objVoucher.FechaPago.ToShortDateString()).ToString().PadRight(5, '0');
                objVoucherReporte.Usuario    = Ventas.UsuarioSession;
                objListaVoucherReporte.Add(objVoucherReporte);
                // }
            }
        }
Esempio n. 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;
        }