public EndTermDividWepComparison(IEndTermValue endTermValue)
 {
     this.EndTermValue = endTermValue;
     this.Account = endTermValue.Account;
     if (endTermValue.DividWepRecord != null)
     {
         this.DividWep = endTermValue.DividWepRecord;
         IncludedinDividWep = true;
     }
     else
         IncludedinDividWep = false;
 }
Beispiel #2
0
        public DividWepRecord(ICustomerAccount account, IEndTermValue endTermValue )
        {
            this.Account = account;
            this.EndTermRecord = endTermValue;
            this.EndTermRecord.DividWepRecord = this;
            IContact primary = account.PrimaryAccountHolder.Contact;
            bool isPerson = (primary.ContactType == ContactTypeEnum.Person);

            this.recordType = "5";
            this.AccountNumber = massageData(account.Number, 10);
            this.Naam = massageData(primary.CurrentNAW.Name, 49);

            this.Voorletters = massageData(isPerson ? ((IContactPerson)primary).FirstName : "", 5);
            this.Voorvoegsels = massageData(isPerson ? ((IContactPerson)primary).MiddleName : "",8);
            this.Straatnaam = massageData(primary.CurrentNAW.ResidentialAddress.Street, 25);
            this.Huisnummer = massageData(primary.CurrentNAW.ResidentialAddress.HouseNumber,5);
            this.Toevoeging = massageData(primary.CurrentNAW.ResidentialAddress.HouseNumberSuffix,5);
            this.Postcode = massageData(primary.CurrentNAW.ResidentialAddress.PostalCode,6);
            this.Plaatsnaam = massageData(primary.CurrentNAW.ResidentialAddress.City,20);

            if ((isPerson) && (primary.GetBirthFounding != null))
            {
                DateTime dob = primary.GetBirthFounding;
                this.Geboortedag = dob.Day.ToString().PadLeft(2, '0');
                this.Geboortemaand = dob.Month.ToString().PadLeft(2, '0');
                string interim = dob.Year.ToString().PadLeft(4, '0');
                this.Geboorteeeuw = interim.Substring(0, 2);
                this.Geboortejaar = interim.Substring(2, 2);
            }
            else
            {
                this.Geboortedag = this.Geboortemaand = this.Geboorteeeuw = this.Geboortejaar = "00";
            }
            this.Rechtsvormcode = isPerson ? "01" : "02";
            this.GezamenlijkBelang = "01";
            this.SoortFonds = "01";
            this.WepValue = Convert.ToInt32(Math.Truncate(endTermValue.ClosingValue.Quantity));
            this.Soortvalutawep = endTermValue.ClosingValue.Underlying.ToCurrency.ToString();
            this.Soortdivrente = "01";
            this.DivrentebedragValue = Convert.ToInt32(endTermValue.InternalDividend.Quantity);
            this.ValutaDivrentebedrag = endTermValue.InternalDividend.Underlying.ToCurrency.ToString();
            this.Typeobligatie = "00";
            this.Typebronbelasting = "01";
            this.BedragbronbelastingValue = Convert.ToInt32(endTermValue.InternalDividendTax.Quantity);
            this.ValutaBedragbronbelasting = endTermValue.InternalDividendTax.Underlying.ToCurrency.ToString();
            this.Valutajaar = endTermValue.EndTermDate.Year.ToString();
            string bsn = primary.GetBSN;
            this.Sofinummer = isPerson ? bsn : "000000000";
            this.KvKnummer = !isPerson ? bsn : "000000000";
        }