示例#1
0
 protected virtual void AppendPostalAddress(BaseDocument baseDoc, XmlDocument doc, XmlElement parent, string addressName, PostalAddress address)
 {
     address.Append(baseDoc, doc, parent, addressName);
 }
示例#2
0
        public override PostalAddress CreditorAddress(Uniconta.DataModel.Creditor creditor, PostalAddress creditorAddress, bool unstructured = false)
        {
            switch (companyBankEnum)
            {
            case CompanyBankENUM.Deutsche_Kreditwirtschaft:
            case CompanyBankENUM.Volks_Raiffeisenbanken:
            case CompanyBankENUM.Commerzbank:
                return(null);

            default:
                return(base.CreditorAddress(creditor, creditorAddress));
            }
        }
示例#3
0
 public override PostalAddress DebtorAddress(Company company, PostalAddress debtorAddress)
 {
     return(null);
 }
示例#4
0
 /// <summary>
 /// Party to which an amount of money is due.
 /// </summary>
 /// <param name="name">Name by which a party is known and which is usually used to identify that party.</param>
 /// <param name="postalAddress">Information that locates and identifies a specific address, as defined by postal services.</param>
 public Cdtr(string creditorName, PostalAddress postalAddress)
 {
     this.creditorName  = creditorName;
     this.postalAddress = postalAddress;
 }
示例#5
0
        /// <summary>
        /// LT: Only two Addresslines are accepted
        /// </summary>
        public override PostalAddress CreditorAddress(Uniconta.DataModel.Creditor creditor, PostalAddress creditorAddress, bool unstructured = false)
        {
            if (CredPaymFormat.Bank == ltBank.Standard)
            {
                return(null);
            }

            var adr1    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address1, allowedCharactersRegEx, replaceCharactersRegEx);
            var adr2    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address2, allowedCharactersRegEx, replaceCharactersRegEx);
            var adr3    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address3, allowedCharactersRegEx, replaceCharactersRegEx);
            var zipCode = StandardPaymentFunctions.RegularExpressionReplace(creditor._ZipCode, allowedCharactersRegEx, replaceCharactersRegEx);
            var city    = StandardPaymentFunctions.RegularExpressionReplace(creditor._City, allowedCharactersRegEx, replaceCharactersRegEx);

            unstructured = false;
            switch (CredPaymFormat.Bank)
            {
            case ltBank.Swedbank:
            case ltBank.SEB:
            case ltBank.Luminor:
                unstructured = false;
                break;

            default:
                unstructured = false;
                break;
            }

            if (unstructured)
            {
                var strB        = StringBuilderReuse.Create();
                var adr1_result = strB.Append(adr1).Append(AddSeparator(adr2)).Append(adr2).ToString();
                creditorAddress.AddressLine1 = adr1_result.Length > 70 ? adr1_result.Substring(0, 70) : adr1_result;
                strB.Clear();
                var adr2_result = strB.Append(adr3).Append(AddSeparator(zipCode)).Append(zipCode).Append(AddSeparator(city)).Append(city).ToString();
                creditorAddress.AddressLine2 = adr2_result.Length > 70 ? adr2_result.Substring(0, 70) : adr2_result;
                creditorAddress.Unstructured = true;
                strB.Release();
            }
            else
            {
                creditorAddress.ZipCode    = zipCode;
                creditorAddress.CityName   = city;
                creditorAddress.StreetName = adr1;
            }

            creditorAddress.CountryId = ((CountryISOCode)creditor._Country).ToString();

            return(creditorAddress);
        }
示例#6
0
        public override PostalAddress CreditorAddress(Uniconta.DataModel.Creditor creditor, PostalAddress creditorAddress, bool unstructured = false)
        {
            if (companyBankEnum == CompanyBankENUM.CreditSuisse)
            {
                return(base.CreditorAddress(creditor, creditorAddress, unstructured));
            }

            return(null);
        }
示例#7
0
 /// <summary>
 /// Debtor identifies the owner of the DebtorAccount
 /// </summary>
 /// <param name="debtorName">Name by which a party is known and which is usually used to identify that party.</param>
 /// <param name="postalAddress">Information that locates and identifies a specific address, as defined by postal services.</param>
 public Dbtr(string debtorName, PostalAddress postalAddress, string debtorIdentificationCode = "")
 {
     this.postalAddress            = postalAddress;
     this.debtorName               = debtorName;
     this.debtorIdentificationCode = debtorIdentificationCode;
 }
示例#8
0
        public override PostalAddress CreditorAddress(Uniconta.DataModel.Creditor creditor, PostalAddress creditorAddress, bool unstructured = false)
        {
            if (paymentType != ISO20022PaymentTypes.DOMESTIC && (companyBankEnum == CompanyBankENUM.Nordea_DK || companyBankEnum == CompanyBankENUM.Nordea_NO))
            {
                int maxLines  = 3;
                int maxStrLen = 34;

                string adrText = string.Concat(creditor._Address1, " ", creditor._Address2, " ", creditor._Address3, " ", creditor._ZipCode, " ", creditor._City);

                if (adrText.Length > maxLines * maxStrLen)
                {
                    adrText = adrText.Substring(0, maxLines * maxStrLen);
                }

                var resultList = adrText.Select((x, i) => i)
                                 .Where(i => i % maxStrLen == 0)
                                 .Select(i => adrText.Substring(i, adrText.Length - i >= maxStrLen ? maxStrLen : adrText.Length - i)).ToArray();

                var len = resultList.Length;
                creditor._Address1 = len > 0 ? resultList[0].Trim() : null;
                creditor._Address2 = len > 1 ? resultList[1].Trim() : null;
                creditor._Address3 = len > 2 ? resultList[2].Trim() : null;

                unstructured = true;
            }

            return(base.CreditorAddress(creditor, creditorAddress, unstructured));
        }
        /// <summary>
        /// Creditor Address
        /// </summary>
        public virtual PostalAddress CreditorAddress(Uniconta.DataModel.Creditor creditor, PostalAddress creditorAddress, bool unstructured = false)
        {
            var adr1    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address1, allowedCharactersRegEx, replaceCharactersRegEx);
            var adr2    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address2, allowedCharactersRegEx, replaceCharactersRegEx);
            var adr3    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address3, allowedCharactersRegEx, replaceCharactersRegEx);
            var zipCode = StandardPaymentFunctions.RegularExpressionReplace(creditor._ZipCode, allowedCharactersRegEx, replaceCharactersRegEx);
            var city    = StandardPaymentFunctions.RegularExpressionReplace(creditor._City, allowedCharactersRegEx, replaceCharactersRegEx);

            if (creditor._ZipCode != null && !unstructured)
            {
                creditorAddress.ZipCode    = zipCode;
                creditorAddress.CityName   = city;
                creditorAddress.StreetName = adr1;
            }
            else
            {
                creditorAddress.AddressLine1 = adr1;
                creditorAddress.AddressLine2 = adr2;
                creditorAddress.AddressLine3 = adr3;
                creditorAddress.Unstructured = true;
            }

            creditorAddress.CountryId = ((CountryISOCode)creditor._Country).ToString();

            return(creditorAddress);
        }
示例#10
0
 public override PostalAddress CreditorAddress(Uniconta.DataModel.Creditor creditor, PostalAddress creditorAddress, bool unstructured = false)
 {
     return(null);
 }
示例#11
0
        /// <summary>
        /// Creditor Address
        /// </summary>
        public override PostalAddress CreditorAddress(Uniconta.DataModel.Creditor creditor, PostalAddress creditorAddress, bool unstructured = false)
        {
            var adr1    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address1, allowedCharactersRegEx, replaceCharactersRegEx);
            var adr2    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address2, allowedCharactersRegEx, replaceCharactersRegEx);
            var adr3    = StandardPaymentFunctions.RegularExpressionReplace(creditor._Address3, allowedCharactersRegEx, replaceCharactersRegEx);
            var zipCode = StandardPaymentFunctions.RegularExpressionReplace(creditor._ZipCode, allowedCharactersRegEx, replaceCharactersRegEx);
            var city    = StandardPaymentFunctions.RegularExpressionReplace(creditor._City, allowedCharactersRegEx, replaceCharactersRegEx);

            if (creditor._ZipCode != null)
            {
                creditorAddress.ZipCode    = zipCode;
                creditorAddress.CityName   = city;
                creditorAddress.StreetName = adr1;
            }
            else
            {
                if (companyBankEnum == CompanyBankENUM.Rabobank) //Rabobank: Only two Addresslines are accepted
                {
                    var strB        = StringBuilderReuse.Create();
                    var adr1_result = strB.Append(adr1).Append(AddSeparator(adr2)).Append(adr2).ToString();
                    creditorAddress.AddressLine1 = adr1_result.Length > 70 ? adr1_result.Substring(0, 70) : adr1_result;
                    strB.Clear();
                    var adr2_result = strB.Append(adr3).Append(AddSeparator(zipCode)).Append(zipCode).Append(AddSeparator(city)).Append(city).ToString();
                    creditorAddress.AddressLine2 = adr2_result.Length > 70 ? adr2_result.Substring(0, 70) : adr2_result;
                    creditorAddress.Unstructured = true;
                    strB.Release();
                }
                else
                {
                    creditorAddress.AddressLine1 = adr1;
                    creditorAddress.AddressLine2 = adr2;
                    creditorAddress.AddressLine3 = adr3;
                    creditorAddress.Unstructured = true;
                }
            }

            creditorAddress.CountryId = ((CountryISOCode)creditor._Country).ToString();

            return(creditorAddress);
        }