public SupplierPartyType getSupplierPartyType() { PartyType HPT = new PartyType(); NameType1 HNT1 = new NameType1(); HNT1.Value = $"<![CDATA[{MS.Emp.RazonSocial}]]>"; PartyNameType HPNT = new PartyNameType(); PartyNameType[] MPNT = { HPNT }; MPNT[0].Name = HNT1; IDType HIT = new IDType(); AddressType HAT = new AddressType(); AddressType[] MAT = { HAT }; HIT.Value = MS.Emp.Ubigeo; StreetNameType HSNT = new StreetNameType(); HSNT.Value = MS.Emp.DomicilioFiscal; CountryType HCT = new CountryType(); IdentificationCodeType HICT = new IdentificationCodeType(); HICT.listID = "PE"; HCT.IdentificationCode = HICT; PartyLegalEntityType HPLET = new PartyLegalEntityType(); PartyLegalEntityType[] MPLET = { HPLET }; RegistrationNameType HRNT = new RegistrationNameType(); HRNT.Value = $"<![CDATA[{MS.Emp.RazonSocial}]]>"; MPLET[0].RegistrationName = HRNT; HAT.ID = HIT; HAT.StreetName = HSNT; HAT.Country = HCT; HPT.PartyLegalEntity = MPLET; AdditionalAccountIDType HAAIT = new AdditionalAccountIDType(); AdditionalAccountIDType[] MAAIT = { HAAIT }; MAAIT[0].Value = "6"; CustomerAssignedAccountIDType CAAIDT = new CustomerAssignedAccountIDType(); CAAIDT.Value = MS.Emp.Ruc; SupplierPartyType HSPT = new SupplierPartyType(); HSPT.Party = HPT; HSPT.AdditionalAccountID = MAAIT; HSPT.CustomerAssignedAccountID = CAAIDT; return(HSPT); }
void LlenarReceptor(En_Receptor Receptor, ref DebitNoteType debitNote) { WebsiteURIType EmisorPaginaWeb = new WebsiteURIType { Value = Receptor.PaginaWeb.Trim() }; List <PartyNameType> oListaNombreComercial = new List <PartyNameType>(); PartyNameType PartyName = new PartyNameType { Name = new NameType1 { Value = Receptor.NombreComercial.Trim() } }; oListaNombreComercial.Add(PartyName); PartyIdentificationType EmisorIdentificacion = new PartyIdentificationType(); List <PartyIdentificationType> EmisorListaIdentificacion = new List <PartyIdentificationType>(); EmisorIdentificacion.ID = new IDType { Value = Receptor.NumeroDocumentoIdentidad.Trim(), schemeAgencyID = "PE:SUNAT", schemeID = Receptor.TipoDocumentoIdentidad.Trim(), schemeName = "Documento de Identidad", schemeURI = "urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06" }; EmisorListaIdentificacion.Add(EmisorIdentificacion); //Razon social PartyLegalEntityType oRazonSocial = new PartyLegalEntityType { RegistrationName = new RegistrationNameType { Value = Receptor.RazonSocial, }, RegistrationAddress = new AddressType { ID = new IDType { Value = Receptor.CodigoUbigeo.Trim(), schemeAgencyName = "PE:INEI", schemeName = "Ubigeos" }, AddressTypeCode = new AddressTypeCodeType { Value = Receptor.CodigoDomicilioFiscal.Trim(), listAgencyName = "PE:SUNAT", listName = "Establecimientos anexos" }, CitySubdivisionName = new CitySubdivisionNameType { Value = Receptor.Urbanizacion.Trim() }, CityName = new CityNameType { Value = Receptor.Provincia.Trim() }, CountrySubentity = new CountrySubentityType { Value = Receptor.Departamento.Trim() }, District = new DistrictType { Value = Receptor.Distrito.Trim() }, AddressLine = new AddressLineType[] { new AddressLineType { Line = new LineType { Value = Receptor.Direccion.Trim() } } }, Country = new CountryType { IdentificationCode = new IdentificationCodeType { listAgencyName = "United Nations Economic Commission for Europe", listID = "ISO 3166-1", listName = "Country", Value = Receptor.CodigoPais.Trim() } } } }; ContactType oContacto = new ContactType { ElectronicMail = new ElectronicMailType() { Value = Receptor.Contacto.Correo.Trim() }, Name = new NameType1 { Value = Receptor.Contacto.Nombre.Trim() }, Telephone = new TelephoneType { Value = Receptor.Contacto.Telefono.Trim() } }; CustomerPartyType oReceptor = new CustomerPartyType { Party = new PartyType { WebsiteURI = EmisorPaginaWeb, PartyIdentification = EmisorListaIdentificacion.ToArray(), PartyName = oListaNombreComercial.ToArray(), PartyLegalEntity = new PartyLegalEntityType[] { oRazonSocial }, Contact = oContacto } }; debitNote.AccountingCustomerParty = oReceptor; }