Ejemplo n.º 1
0
        public Factura(
            int id,
            int idCdad,
            int?idProv,
            string nFactura,
            DateTime?fecha,
            bool autoCalc,
            decimal subtotal,
            double puIi,
            double puIrpf,
            decimal ii,
            decimal irpf,
            decimal pendiente,
            string concepto,
            TipoPagoFacturas tipoPago      = TipoPagoFacturas.Cheque,
            GastosPagosList <Gasto> gastos = null,
            GastosPagosList <Pago> pagos   = null)
        {
            decimal II   = subtotal.MultiplyDouble(puIi);
            decimal Irpf = subtotal.MultiplyDouble(puIrpf);

            if (ii != II || irpf != Irpf)
            {
                throw new CustomException_ObjModels("Error al intentar crear objeto Factura en constructor. Factura no cuadrada");
            }

            decimal total = subtotal + ii - irpf;

            if ((gastos != null && gastos.Total != subtotal) ||
                (pagos != null && (total - pagos.Total) != pendiente))
            {
                throw new CustomException_ObjModels("Error al intentar crear objeto Factura en constructor. Factura no cuadrada");
            }

            this._Id = id;
            this._IdOwnerComunidad = idCdad;
            this._IdOwnerProveedor = idProv;
            this._NFactura         = nFactura;
            this.Fecha             = (DateTime)(fecha ?? DateTime.Today);
            this.AutoCalc          = autoCalc;
            this._Subtotal         = subtotal;
            this._PerUnitIGICIVA   = puIi;
            this._IGICIVA          = ii;
            this._PerUnitIRPF      = puIrpf;
            this._IRPF             = irpf;
            this._Pendiente        = pendiente;
            this.Concepto          = concepto;
            this.TipoPago          = tipoPago;
            this._GastosFra        = gastos;
            this._PagosFra         = pagos;
        }
Ejemplo n.º 2
0
 public Proveedor(
     CuentaMayor CuentaContProveedor,
     CuentaMayor CuentaContGasto,
     CuentaMayor CuentaContPago,
     int id,
     string Razon,
     double IGICIVA,
     double IRPF,
     TipoPagoFacturas DefTPagoFacturas,
     int idPersona, string nif, string nombre, bool forceInvalidNIF = false) : base(idPersona, nif, nombre, forceInvalidNIF)
 {
     this._CuentaContableProveedor = CuentaContableProveedor;
     this._CuentaContableGasto     = CuentaContGasto;
     this._CuentaContablePago      = CuentaContPago;
     this._IdProveedor             = id;
     this.RazonSocial             = Razon;
     this.IGICIVAPercent          = IGICIVA;
     this.IRPFPercent             = IRPF;
     this.DefaultTipoPagoFacturas = DefTPagoFacturas;
 }
Ejemplo n.º 3
0
 public FacturaDLO(
     int id,
     int?idProv,
     int idCdad,
     string nFactura,
     DateTime fecha,
     string concepto,
     decimal total,
     decimal pendiente,
     TipoPagoFacturas tipoPago)
 {
     this.Id = id;
     this.IdOwnerProveedor = idProv;
     this.IdOwnerComunidad = idCdad;
     this.NFactura         = nFactura;
     this.Fecha            = fecha;
     this.Concepto         = concepto;
     this.Total            = total;
     this.Pendiente        = pendiente;
     this.TipoPago         = tipoPago;
 }