Esempio n. 1
0
        static void Main(string[] args)
        {
            List <Factura> folderDeFacturas = new List <Factura>();
            int            opcion;

            do
            {
                Console.Clear();
                Console.WriteLine("SISTEMA DE FACTURACION NubeFACT");
                Console.WriteLine("Verificado por la SUNAT");
                Console.WriteLine("1 AGREGAR COMPROBANTE");
                Console.WriteLine("2 REPORTES");
                Console.WriteLine("3 Salir");
                Console.WriteLine("\nElija una opción");
                opcion = int.Parse(Console.ReadLine());
                int opcionComprobante;
                if (opcion == 1)
                {
                    do
                    {
                        Console.Clear();
                        Console.WriteLine("MENU DE COMPROBANTES");
                        Console.WriteLine("1 AGREGAR FACTURA");
                        Console.WriteLine("2 AGREGAR NOTA DE CRÉDITO");
                        Console.WriteLine("3 AGREGAR BOLETA DE VENTA");
                        Console.WriteLine("4 Ver facturas");
                        opcionComprobante = int.Parse(Console.ReadLine());
                        if (opcionComprobante == 1) // AGREGAR FACTURA
                        {
                            // DATOS PARA LA FACTURA
                            Console.Clear();
                            Console.WriteLine("Ingresar datos de factura");
                            Console.Write("Razon Social: ");
                            string razonSocial = Console.ReadLine();
                            Console.Write("RUC: ");
                            string ruc = Console.ReadLine();
                            Console.Write("Fecha: ");
                            string fecha = Console.ReadLine();
                            Console.Write("Direccion: ");
                            string direccion = Console.ReadLine();

                            Factura miFactura = new Factura(fecha,
                                                            direccion, razonSocial, ruc);
                            char respuesta;
                            do
                            {
                                Console.WriteLine("Detalle de Factura (Productos)");
                                Console.Write("Descripcion: ");
                                string descripcion = Console.ReadLine();
                                Console.Write("Cantidad: ");
                                int cantidad = int.Parse(Console.ReadLine());
                                Console.Write("Precio Unitario: ");
                                double precioUnitario = double.Parse(Console.ReadLine());

                                Producto miProducto = new Producto(precioUnitario,
                                                                   cantidad, descripcion);

                                miFactura.GetListaDeProductos().Add(miProducto);
                                Console.WriteLine("Se agregó el producto." +
                                                  "¿Desea agregar otro? s/n");
                                respuesta = char.Parse(Console.ReadLine());
                            } while (respuesta == 's');

                            folderDeFacturas.Add(miFactura);
                        }
                        if (opcionComprobante == 4) // MOSTRAR FACTURAS
                        {
                            foreach (var item in folderDeFacturas)
                            {
                                item.MostrarFactura();
                            }
                            Console.ReadKey();
                        }
                    } while (opcionComprobante < 5 && opcionComprobante > 0);
                }
            } while (opcion < 3 && opcion > 0);
            // MENÚ
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // TENEMOS UNA SOLA LISTA CONTENEDORA DE CUALQUIER TIPO DE COMPROBANTE
            List <Comprobante> misComprobantes = new List <Comprobante>();

            // NO SE PUEDE INSTANCIAR UN OBJETO DE LA CLASE ABSTRACTA COMPROBANTE
            //Comprobante comprobante = new Comprobante();

            int opcion = 0;

            do
            {
                Console.WriteLine("Facturacion electronica");
                Console.WriteLine("1 Registrar Factura");
                Console.WriteLine("2 Registrar Boleta");
                Console.WriteLine("3 Registrar Nota de credito");
                Console.WriteLine("4 Reporte de ventas");
                opcion = int.Parse(Console.ReadLine());

                switch (opcion)
                {
                case 1:
                    //Console.Clear();
                    Console.WriteLine("1 Ingresar datos factura");
                    Console.WriteLine("2 Ingresar productos de factura");
                    Console.WriteLine("3 Finalizar");

                    Console.WriteLine("Ingresar Razon social");
                    string  razonSocial = Console.ReadLine();
                    string  fecha       = Console.ReadLine();
                    string  RUC         = Console.ReadLine();
                    string  direccion   = Console.ReadLine();
                    Factura f           = new Factura(razonSocial, direccion,
                                                      fecha, RUC);

                    //Producto p = new Producto(10, "Tornillos", .80);
                    //f.ListaProductos.Add(p);

                    misComprobantes.Add(f);
                    break;

                default:
                    break;
                }
            } while (false);


            Factura factura = new Factura("Mi empresa", "Calle Puno",
                                          "19/04/2019", "20712324932");

            misComprobantes.Add(factura);

            Factura factura2 = new Factura("Otra empresa", "Calle Puno",
                                           "19/04/2020", "20732737373");

            misComprobantes.Add(factura2);
            Console.WriteLine(Factura.contador);

            /*
             * foreach (var item in misFacturas)
             * {
             * Console.WriteLine(item);
             * }
             */
            foreach (var item in misComprobantes)
            {
                item.ImprimirComprobante();
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            List <Factura>     misFacturas       = new List <Factura>();
            List <Boleta>      misBoletas        = new List <Boleta>();
            List <NotaCredito> misNotasDeCredito = new List <NotaCredito>();
            int opcion = 0;

            do
            {
                Console.WriteLine("Facturacion electronica");
                Console.WriteLine("1 Registrar Factura");
                Console.WriteLine("2 Registrar Boleta");
                Console.WriteLine("3 Registrar Nota de credito");
                Console.WriteLine("4 Reporte de ventas");
                opcion = int.Parse(Console.ReadLine());

                switch (opcion)
                {
                case 1:
                    //Console.Clear();
                    Console.WriteLine("1 Ingresar datos factura");
                    Console.WriteLine("2 Ingresar productos de factura");
                    Console.WriteLine("3 Finalizar");

                    Console.WriteLine("Ingresar Razon social");
                    string  razonSocial = Console.ReadLine();
                    string  fecha       = Console.ReadLine();
                    string  RUC         = Console.ReadLine();
                    string  direccion   = Console.ReadLine();
                    Factura f           = new Factura(razonSocial, direccion,
                                                      fecha, RUC);

                    //Producto p = new Producto(10, "Tornillos", .80);
                    //f.ListaProductos.Add(p);

                    misFacturas.Add(f);
                    break;

                default:
                    break;
                }
            } while (false);


            Factura factura = new Factura("Mi empresa", "Calle Puno",
                                          "19/04/2019", "20712324932");

            factura.Codigo    = "001";
            factura.Fecha     = "10/07/2019";
            factura.Direccion = "Mi casa";

            misFacturas.Add(factura);

            Factura factura2 = new Factura();

            misFacturas.Add(factura2);
            Console.WriteLine(Factura.contador);

            foreach (var item in misFacturas)
            {
                Console.WriteLine(item);
            }
        }