Example #1
0
        public void ApplyTaxRates(IEnumerable <TaxRate> taxRates)
        {
            var shipmentTaxRate = taxRates.FirstOrDefault(x => x.Line.Quantity == Quantity);

            if (shipmentTaxRate != null && ActualPrice.Amount > 0 && shipmentTaxRate.Rate.Amount > 0)
            {
                TaxPercentRate = TaxRate.TaxPercentRound(shipmentTaxRate.Rate.Amount / ActualPrice.Amount);
            }
        }
Example #2
0
        public void ApplyTaxRates(IEnumerable <TaxRate> taxRates)
        {
            var paymentTaxRate = taxRates.FirstOrDefault(x => x.Line.Id != null && x.Line.Id.EqualsInvariant(Code ?? ""));

            if (paymentTaxRate != null && Total.Amount > 0 && paymentTaxRate.Rate.Amount > 0)
            {
                TaxPercentRate = TaxRate.TaxPercentRound(paymentTaxRate.Rate.Amount / Total.Amount);
            }
        }
Example #3
0
        public void ApplyTaxRates(IEnumerable <TaxRate> taxRates)
        {
            var taxLineId = BuildTaxLineId();
            var taxRate   = taxRates.FirstOrDefault(x => x.Line.Id == taxLineId);

            if (taxRate != null && Total.Amount > 0 && taxRate.Rate.Amount > 0)
            {
                TaxPercentRate = TaxRate.TaxPercentRound(taxRate.Rate.Amount / Total.Amount);
            }
        }
Example #4
0
        public void ApplyTaxRates(IEnumerable <TaxRate> taxRates)
        {
            var shipmentTaxRate = taxRates.FirstOrDefault(x => x.Line.Quantity == Quantity);

            if (shipmentTaxRate != null)
            {
                if (shipmentTaxRate.PercentRate > 0)
                {
                    TaxPercentRate = shipmentTaxRate.PercentRate;
                }
                else
                {
                    if (ActualPrice.Amount > 0)
                    {
                        TaxPercentRate = TaxRate.TaxPercentRound(shipmentTaxRate.Rate.Amount / ActualPrice.Amount);
                    }
                }

                TaxDetails = shipmentTaxRate.Line.TaxDetails;
            }
        }
Example #5
0
        public void ApplyTaxRates(IEnumerable <TaxRate> taxRates)
        {
            TaxPercentRate = 0m;
            var paymentTaxRate = taxRates.FirstOrDefault(x => x.Line.Id != null && x.Line.Id.EqualsInvariant(Code ?? ""));

            if (paymentTaxRate != null)
            {
                if (paymentTaxRate.PercentRate > 0)
                {
                    TaxPercentRate = paymentTaxRate.PercentRate;
                }
                else
                {
                    var amount = Total.Amount > 0 ? Total.Amount : Price.Amount;
                    if (amount > 0)
                    {
                        TaxPercentRate = TaxRate.TaxPercentRound(paymentTaxRate.Rate.Amount / amount);
                    }
                }

                TaxDetails = paymentTaxRate.Line.TaxDetails;
            }
        }
        public void ApplyTaxRates(IEnumerable <TaxRate> taxRates)
        {
            TaxPercentRate = 0m;
            var taxLineId = BuildTaxLineId();
            var taxRate   = taxRates.FirstOrDefault(x => x.Line.Id == taxLineId);

            if (taxRate != null && taxRate.Rate.Amount > 0)
            {
                if (taxRate.PercentRate > 0)
                {
                    TaxPercentRate = taxRate.PercentRate;
                }
                else
                {
                    var amount = Total.Amount > 0 ? Total.Amount : Price.Amount;
                    if (amount > 0)
                    {
                        TaxPercentRate = TaxRate.TaxPercentRound(taxRate.Rate.Amount / amount);
                    }
                }

                TaxDetails = taxRate.Line.TaxDetails;
            }
        }