예제 #1
0
 public Struct_Factura(int p_userId)
 {
     UserId            = p_userId;
     MiDetalle         = new List <Struct_DetalleFactura>();
     FacturaTipo       = TipoDeFactura.FacturaA;
     Condicion_IVA     = CondicionIVA.RespInscripto;
     Pago              = CondicionPago.Contado;
     IvaPredeterminado = false;
 }
예제 #2
0
        public static List <Struct_Factura> GetFacturasBetweenDates(DateTime START, DateTime END, int p_UserID, bool p_printed, TipoDeFactura TF)
        {
            string T;

            switch (TF)
            {
            case TipoDeFactura.FacturaA: T = "A"; break;

            case TipoDeFactura.FacturaB: T = "B"; break;

            case TipoDeFactura.FacturaC: T = "C"; break;

            case TipoDeFactura.FacturaX: T = "X"; break;

            case TipoDeFactura.Presupuesto: T = "P"; break;

            default: T = "0"; break;
            }
            Data2.Connection.D_Factura Conn = new Connection.D_Factura();
            List <Struct_Factura>      FL   = new List <Struct_Factura>();
            List <DataTable>           DT_L = Conn.GetFacturasBetweenDates(p_UserID, START, END, T, p_printed);

            if (DT_L[0] != null)
            {
                foreach (DataRow R in DT_L[0].Rows)
                {
                    FL.Add(new Struct_Factura(R));
                }
            }

            if (DT_L[1] != null)
            {
                foreach (DataRow R in DT_L[1].Rows)
                {
                    Struct_Remito  _Remito = new Struct_Remito(R);
                    Struct_Factura _F      = new Struct_Factura(_Remito);
                    FL.Add(_F);
                }
            }


            if (FL.Count > 0)
            {
                return(FL);
            }
            else
            {
                return(null);
            }
        }
예제 #3
0
        public Struct_Factura(DataRow dr)
        {
            Id           = int.Parse(dr["Id"].ToString());
            UserId       = int.Parse(dr["IdUser"].ToString());
            serialAFIP   = dr["SerialAFIP"].ToString();
            serialTICKET = dr["SerialTICKET"].ToString();
            printed      = Data2.Statics.Conversion.convertSQLToBoolean(dr["Printed"]);
            PrintAgain   = Data2.Statics.Conversion.convertSQLToBoolean(dr["PrintAgain"]);
            Transmitida  = Data2.Statics.Conversion.convertSQLToBoolean(dr["Transmitida"]);
            Fecha        = DateTime.Parse(dr["Fecha"].ToString());
            switch (dr["Tipo"].ToString())
            {
            case "A": FacturaTipo = TipoDeFactura.FacturaA; break;

            case "B": FacturaTipo = TipoDeFactura.FacturaB; break;

            case "C": FacturaTipo = TipoDeFactura.FacturaC; break;

            case "X": FacturaTipo = TipoDeFactura.FacturaX; break;

            case "P": FacturaTipo = TipoDeFactura.Presupuesto; break;
            }
            senores   = dr["Nombre"].ToString();
            domicilio = dr["Domicilio"].ToString();
            telefono  = dr["Telefono"].ToString();
            localidad = dr["Localidad"].ToString();
            cuit      = dr["Cuit"].ToString();
            if (Conversion.convertSQLToBoolean(dr["RepInsc"]))
            {
                Condicion_IVA = CondicionIVA.RespInscripto;
            }
            if (Conversion.convertSQLToBoolean(dr["RespNoInsc"]))
            {
                Condicion_IVA = CondicionIVA.RespNoInscripto;
            }
            if (Conversion.convertSQLToBoolean(dr["Exento"]))
            {
                Condicion_IVA = CondicionIVA.Exento;
            }
            if (Conversion.convertSQLToBoolean(dr["ConsumidorFinal"]))
            {
                Condicion_IVA = CondicionIVA.ConsumidorFinal;
            }
            if (Conversion.convertSQLToBoolean(dr["RespMonotributo"]))
            {
                Condicion_IVA = CondicionIVA.RespMonotributo;
            }
            if (Conversion.convertSQLToBoolean(dr["Contado"]))
            {
                Pago = CondicionPago.Contado;
            }
            if (Conversion.convertSQLToBoolean(dr["CtaCte"]))
            {
                Pago = CondicionPago.CtaCte;
            }
            IdCuentaCorriente = int.Parse(dr["IdCtaCte"].ToString());
            if (Conversion.convertSQLToBoolean(dr["Cheque"]))
            {
                cheque = true;
            }
            DNI           = dr["Dni"].ToString();
            IdTarjeta     = int.Parse(dr["Idtargeta"].ToString());
            NumeroTarjeta = dr["NumeroTarjeta"].ToString();
            Observaciones = dr["Observaciones"].ToString();
            subtotal      = Conversion.GetDecimal(dr["SubTotal"].ToString());
            ivas          = Conversion.convertSQLToBoolean(dr["Ivas"]);
            total         = Conversion.GetDecimal(dr["Total"].ToString());

            CargarDetalleDesdeDB();
        }
예제 #4
0
 public void setFacturaTipo(TipoDeFactura p_tf)
 {
     FacturaTipo = p_tf;
 }