Пример #1
0
        public LegalEntityType IsLegalEntity()
        {
            var legalEntity = new LegalEntityType(this);

            this.Item = legalEntity;

            if (this.TaxIdentification != null)
            {
                this.TaxIdentification.PersonTypeCode = PersonTypeCodeType.LegalEntity;

                if (this.TaxIdentification.ResidenceTypeCode == ResidenceTypeCodeType.ResidentInSpain)
                {
                    AddressType address = new AddressType();

                    address.CountryCode = CountryType.ESP;

                    legalEntity.Item = address;
                }
                else
                {
                    legalEntity.Item = new OverseasAddressType();
                }
            }

            return(legalEntity);
        }
Пример #2
0
        /// <summary>
        /// Sets an invoice business party as a legal entity.
        /// </summary>
        /// <returns></returns>
        public LegalEntityType AsLegalEntity()
        {
            var legalEntity = new LegalEntityType(this);

            this.Item = legalEntity;

            if (this.TaxIdentification != null)
            {
                this.TaxIdentification.PersonTypeCode = PersonTypeCodeType.LegalEntity;

                if (this.TaxIdentification.ResidenceTypeCode == ResidenceTypeCodeType.ResidentInSpain)
                {
                    legalEntity.Item = new AddressType { CountryCode = CountryType.ESP };
                }
                else
                {
                    legalEntity.Item = new OverseasAddressType();
                }
            }

            return legalEntity;
        }