public void ImprimeDevolucion(Factura documento)
 {
     if (Basicas.TipoFiscal == "BIXOLON")
     {
         FiscalBixolon f = new FiscalBixolon();
         f.ImprimeDevolucion(documento);
     }
 }
Beispiel #2
0
        private void EliminarRegistro()
        {
            if (this.bs.Current == null)
            {
                return;
            }
            Factura documento       = (Factura)this.bs.Current;
            string  FacturaAfectada = documento.Numero;

            if (documento.Anulado.GetValueOrDefault(false) == true)
            {
                if (MessageBox.Show("Esta operacion ya fue devuelta,Desea realizar la devolucion de nuevo", "Atencion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != System.Windows.Forms.DialogResult.Yes)
                {
                    return;
                }
            }
            try
            {
                FiscalBixolon f = new FiscalBixolon();
                f.ImprimeDevolucion(documento);
                Factura Devolucion = new Factura();
                Devolucion.Cajero         = documento.Cajero;
                Devolucion.CedulaRif      = documento.CedulaRif;
                Devolucion.CestaTicket    = documento.CestaTicket * -1;
                Devolucion.Cheque         = documento.Cheque * -1;
                Devolucion.ConsumoInterno = documento.ConsumoInterno * -1;
                Devolucion.Direccion      = documento.Direccion;
                Devolucion.Efectivo       = documento.Efectivo * -1;
                Devolucion.Email          = documento.Email;
                Devolucion.Fecha          = null;
                Devolucion.LibroVentas    = true;
                Devolucion.Hora           = null;
                Devolucion.IdCajero       = documento.IdCajero;
                Devolucion.MaquinaFiscal  = documento.MaquinaFiscal;
                Devolucion.MontoExento    = documento.MontoExento;
                Devolucion.MontoGravable  = documento.MontoGravable;
                Devolucion.MontoIva       = documento.MontoIva;
                Devolucion.MontoTotal     = documento.MontoTotal;
                //  Devolucion.Numero =
                //  Devolucion.NumeroZ
                Devolucion.RazonSocial = documento.RazonSocial;
                Devolucion.Tarjeta     = documento.Tarjeta * -1;
                Devolucion.TasaIva     = documento.TasaIva;
                Devolucion.Numero      = f.UltimaDevolucion;
                Devolucion.Tipo        = "DEVOLUCION";
                FactoryLibroVentas.EscribirItemDevolucion(Devolucion, documento.Numero);
                FactoryFacturas.DevolverInventario(documento);
                f = null;
            }
            catch (Exception x)
            {
                Basicas.ManejarError(x);
            }
        }
        private void EliminarRegistro()
        {
            if (this.bs.Current == null)
            {
                return;
            }
            Factura documento = (Factura)this.bs.Current;

            if (documento.Anulado.GetValueOrDefault(false) == true)
            {
                if (MessageBox.Show("Esta operacion ya fue devuelta,Desea realizar la devolucion de nuevo", "Atencion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                {
                    try
                    {
                        FiscalBixolon f = new FiscalBixolon();
                        f.ImprimeDevolucion(documento, documento.Numero);
                        f = null;
                    }
                    catch (Exception x)
                    {
                        MessageBox.Show(x.Message);
                    }
                }
            }
            else
            {
                try
                {
                    FiscalBixolon f = new FiscalBixolon();
                    f.ImprimeDevolucion(documento, documento.Numero);
                    documento.Anulado = true;
                    db.SaveChanges();
                    f = null;
                }
                catch (Exception x)
                {
                    MessageBox.Show(x.Message);
                }
            }
        }