Example #1
0
        public Revenue(LimitedDecimal netValue, TaxType taxType, LimitedDecimal vatValue, IEnumerable <ItemIncomeClassification> incomeClassifications, PositiveInt lineNumber = null, VatExemptionType?vatExemption = null, CityTax cityTax = null)
        {
            NetValue = netValue ?? throw new ArgumentNullException(nameof(netValue));
            TaxType  = taxType;
            VatValue = vatValue ?? throw new ArgumentNullException(nameof(vatValue));
            IncomeClassifications = incomeClassifications ?? throw new ArgumentNullException(nameof(incomeClassifications));
            LineNumber            = lineNumber ?? new PositiveInt(1);
            VatExemption          = vatExemption;
            CityTax = cityTax;

            if (taxType == TaxType.Vat0 && !vatExemption.HasValue)
            {
                throw new ArgumentException($"{nameof(VatExemption)} must be specified when TaxType is {taxType}");
            }

            if (incomeClassifications.Count() == 0)
            {
                throw new ArgumentException($"Minimal count of {nameof(incomeClassifications)} is 1.");
            }
        }
 public NegativeRevenue(NegativeAmount netValue, TaxType taxType, NegativeAmount vatValue, ClassificationType classificationType, ClassificationCategory classificationCategory, PositiveInt lineNumber = null, VatExemptionType?vatExemption = null, CityTax cityTax = null)
     : base(netValue, taxType, vatValue, new[] { new ItemIncomeClassification(classificationType, classificationCategory, netValue) }, lineNumber, vatExemption, cityTax)
 {
 }
 public NegativeRevenue(NegativeAmount netValue, TaxType taxType, NegativeAmount vatValue, IEnumerable <ItemIncomeClassification> incomeClassifications, PositiveInt lineNumber = null, VatExemptionType?vatExemption = null, CityTax cityTax = null)
     : base(netValue, taxType, vatValue, incomeClassifications, lineNumber, vatExemption, cityTax)
 {
 }