示例#1
0
        public void ReCalculateTax()
        {
            this.CommercialTaxes
            .ToList()
            .ForEach(commercialTax =>
            {
                commercialTax.UpdateTaxBalance(this.TaxOffset);
            });

            this.Tax = (CommercialTaxes?.ToList().Sum(i => i.TaxBalance) ?? 0);
        }
示例#2
0
        public bool RemoveCommercialTaxs()
        {
            if (PostStatus == LedgerPostStatus.Posted)
            {
                throw new Exception("Transaction is posted");
            }

            var CommercialTaxs = CommercialTaxes.ToList();

            CommercialTaxs.ForEach(ct =>
            {
                if (ct.TaxPeriodId != null)
                {
                    throw new Exception("Transaction is areardy assign to tax period");
                }
                else
                {
                    CommercialTaxes.Remove(ct);
                }
            });
            ReCalculate();

            return(true);
        }