async private void submitAdjustment(object o)
        {
            if (Adjustment.AdjustmentID == 0)
            {
                if ((ErrorMessage = await new ServiceLayer().AddAdjustment(Adjustment.toDTO())) != null)
                {
                    return;
                }

                Adjustment = new Adjustment(ServiceLayer.Adjustment);

                if (Adjustments != null)
                {
                    Adjustments.Add(Adjustment);
                }
            }
            else
            {
                if ((ErrorMessage = await new ServiceLayer().UpdateAdjustment(Adjustment.toDTO())) != null)
                {
                    return;
                }
                Adjustment = new Adjustment(ServiceLayer.Adjustment);
            }

            Adjuster   = null;
            Adjustment = null;

            OnRequestClose(this, new EventArgs());
        }
Exemple #2
0
        internal void AdjustPrice(AdjustPrice adjustPrice)
        {
            var adjustment = new PriceAdjustment(adjustPrice, Price);

            Adjustments.Add(adjustment);
            Price = adjustment.NewPrice;
        }
Exemple #3
0
        public void AdjustPrice(AdjustPrice adjustPrice)
        {
            var adjustment = new PriceAdjustment(adjustPrice, this.Price);

            Adjustments.Add(adjustment);
            Price = adjustPrice.NewPrice;
        }
        /// <summary>
        /// "writes off" anyoutstanding balance as a variance
        /// </summary>
        public MLFSDebtorAdjustment ClearToVariance(MLFSReportingPeriod period)
        {
            MLFSDebtorAdjustment variance = new MLFSDebtorAdjustment()
            {
                ReportingPeriodId = period.Id,
                ReportingPeriod   = period,
                Debtor            = this,
                DebtorId          = (int)Id,
                Amount            = Outstanding * -1,
                IsVariance        = true,
                NotTakenUp        = false
            };

            Adjustments.Add(variance);
            return(variance);
        }
        /// <summary>
        /// Creates an NTU adjustment to reverse out a debtor when the transaction never happens
        /// </summary>
        /// <param name="period">the period in which the plan is marked as NTU</param>
        /// <returns></returns>
        public MLFSDebtorAdjustment CreateNTU(MLFSReportingPeriod period)
        {
            MLFSDebtorAdjustment adj = new MLFSDebtorAdjustment
            {
                DebtorId          = (int)Id,
                Amount            = GrossAmount * -1,
                Debtor            = this,
                IsVariance        = false,
                NotTakenUp        = true,
                ReportingPeriod   = period,
                ReportingPeriodId = period.Id
            };

            Adjustments.Add(adj);
            return(adj);
        }