Esempio n. 1
0
        public MLFSFee(JObject fee)
        {
            Clients = new List <MLFSClient>();
            dynamic f = fee;

            PrimaryID    = f.id;
            SentToClient = f.sentToClientOn;
            if (f.feeChargingType != null)
            {
                FeeType = f.feeChargingType.name;
            }
            if (f.sellingAdvisor != null)
            {
                string advisorID = f.sellingAdvisor.id;
                Advisor = new Staff(advisorID);
            }
            NetAmount = f.net.amount;
            VAT       = f.vat.amount;
            if (f.recurring == null)
            {
                IsRecurring        = false;
                RecurringFrequency = "";
                RecurringStart     = null;
                RecurringEnd       = null;
            }
            else
            {
                IsRecurring        = true;
                RecurringFrequency = f.recurring.frequency;
                if (f.recurring.startsOn != null)
                {
                    RecurringStart = Tools.HandleStringToDate(f.recurring.startsOn.ToString());
                }
                if (f.recurring.endsOn != null)
                {
                    RecurringEnd = Tools.HandleStringToDate(f.recurring.endsOn.ToString());
                }
            }
            PaidBy        = f.paymentType.paidBy;
            InitialPeriod = f.initialPeriod;
            if (f.plan_href != null)
            {
                string planId = f.plan_href.ToString();
                planId = planId.Substring(planId.IndexOf('(') + 1, planId.LastIndexOf(')') - planId.IndexOf('(') - 1);
                Plan   = new MLFSPlan(planId);
            }
            if (f.discount != null)
            {
                DiscountPercentage = f.discount.percentage;
                DiscountTotal      = f.discount.total.amount;
            }
            Clients       = MLFSClient.CreateSummaryList(JArray.FromObject(f.clients));
            FeePercentage = f.feePercentage;
        }
Esempio n. 2
0
        public MLFSPlan(JObject plan)
        {
            dynamic p = plan;

            PrimaryID = p.id;
            if (p.productProvider != null)
            {
                Provider = p.productProvider.name;
            }
            Reference = p.reference;
            StartDate = p.startOn;
            if (p.sellingAdviser != null)
            {
                string advisorID = p.sellingAdviser.id;
                Advisor = new Staff(advisorID);
            }
            if (p.paraplanner != null)
            {
                string paraID = p.paraplanner.id;
                ParaPlanner = new Staff(paraID);
            }
            if (p.administrator != null)
            {
                string adminID = p.administrator.id;
                ParaPlanner = new Staff(adminID);
            }
            PlanType            = p.planType.name;
            IsPreExistingClient = p.isPreExisting;
            ProductName         = p.productName;
            Status  = MLFSPlan.ParsePlanStatus(p.currentStatus.Value);
            Clients = MLFSClient.CreateSummaryList(JArray.FromObject(p.owners));
            IsTopUp = p.isTopup;
            if (p.latestValuation != null)
            {
                CurrentValuation = p.latestValuation.value.amount;
            }
        }