Beispiel #1
0
        private BusinessType _CreateParty(PersonTypeCodeType personTypeCodeType, ResidenceTypeCodeType residenceTypeCode, string taxIdentificationNumber, object item)
        {
            var party             = new BusinessType();
            var taxIdentification = new TaxIdentificationType();

            taxIdentification.PersonTypeCode          = personTypeCodeType;
            taxIdentification.ResidenceTypeCode       = residenceTypeCode;
            taxIdentification.TaxIdentificationNumber = taxIdentificationNumber;
            party.TaxIdentification = taxIdentification;
            party.Item = item;
            return(party);
        }
Beispiel #2
0
        public Facturae AddLegalParty(bool seller, ResidenceTypeCodeType residenceTypeCode, string taxIdentificationNumber, string corporateName,
                                      string address, string postalCode, string province, string town, CountryType country)
        {
            var legal = new LegalEntityType();

            legal.CorporateName = corporateName;
            legal.Item          = _CreateAddress(residenceTypeCode, address, postalCode, province, town, country);

            var party = _CreateParty(PersonTypeCodeType.J, residenceTypeCode, taxIdentificationNumber, legal);

            if (seller)
            {
                this.Parties.SellerParty = party;
            }
            else
            {
                this.Parties.BuyerParty = party;
            }

            return(this);
        }
Beispiel #3
0
        public Facturae AddIndividualParty(bool seller, ResidenceTypeCodeType residenceTypeCode, string taxIdentificationNumber, string name,
                                           string firstSureName, string address, string postalCode, string province, string town, CountryType country)
        {
            var individual = new IndividualType();

            individual.Name         = name;
            individual.FirstSurname = firstSureName;
            individual.Item         = _CreateAddress(residenceTypeCode, address, postalCode, province, town, country);

            var party = _CreateParty(PersonTypeCodeType.F, residenceTypeCode, taxIdentificationNumber, individual);

            if (seller)
            {
                this.Parties.SellerParty = party;
            }
            else
            {
                this.Parties.BuyerParty = party;
            }

            return(this);
        }
Beispiel #4
0
 private object _CreateAddress(ResidenceTypeCodeType residenceTypeCode, string address, string postalCode, string province, string town, CountryType country)
 {
     if (residenceTypeCode == ResidenceTypeCodeType.R)
     {
         var addressLine = new AddressType();
         addressLine.Address     = address;
         addressLine.PostCode    = postalCode;
         addressLine.Province    = province;
         addressLine.Town        = town;
         addressLine.CountryCode = CountryType.ESP;
         return(addressLine);
     }
     else
     {
         var addressLine = new OverseasAddressType();
         addressLine.Address         = address;
         addressLine.PostCodeAndTown = postalCode + " " + town;
         addressLine.Province        = province;
         addressLine.CountryCode     = country;
         return(addressLine);
     }
 }