private IRenvelope CreateIRenvelopeBody(Sender sender, Business business, PeriodData periodData, VAT100 vatData) { IRenvelope irenvelope = new IRenvelope(); IRheader irheader = new IRheader(); IRheaderKey irheaderkey = new IRheaderKey { Type = "VATRegNo", Value = business.VATRegNo }; irheader.PeriodID = periodData.PeriodrefId; irheader.Sender = IRheaderSender.Individual; // irheader.PeriodStart = periodData.StartPeriod; //irheader.PeriodEnd = periodData.EndPeriod; IRheaderKey[] irHeaderKeys = new IRheaderKey[1]; irHeaderKeys[0] = irheaderkey; irheader.Keys = irHeaderKeys; VATDeclarationRequest_ContactDetailsStructure contact = new VATDeclarationRequest_ContactDetailsStructure(); VATDeclarationRequest_ContactDetailsStructureName name = new VATDeclarationRequest_ContactDetailsStructureName { Fore = new[] { sender.ForName1, sender.ForName2 }, Sur = sender.SurName, Ttl = sender.Title }; VATDeclarationRequest_ContactDetailsStructureEmail email = new VATDeclarationRequest_ContactDetailsStructureEmail { Preferred = VATDeclarationRequest_YesNoType.yes, PreferredSpecified = true, Type = VATDeclarationRequest_WorkHomeType.work, TypeSpecified = true, Value = sender.Email }; contact.Name = name; VATDeclarationRequest_ContactDetailsStructureEmail[] Emails = new VATDeclarationRequest_ContactDetailsStructureEmail[1]; Emails[0] = email; contact.Email = Emails; IRheaderPrincipal principal = new IRheaderPrincipal { Contact = contact }; irheader.Principal = principal; IRheaderIRmark irmark = new IRheaderIRmark(); irmark.Type = IRheaderIRmarkType.generic; irmark.Value = ""; irheader.IRmark = irmark; VATDeclarationRequest vatreq = new VATDeclarationRequest { VATDueOnOutputs = vatData.Box1, VATDueOnECAcquisitions = vatData.Box2, TotalVAT = vatData.Box3, VATReclaimedOnInputs = vatData.Box4, NetVAT = vatData.Box5, NetSalesAndOutputs = vatData.Box6, NetPurchasesAndInputs = vatData.Box7, NetECSupplies = vatData.Box8, NetECAcquisitions = vatData.Box9 }; //set values here irenvelope.IRheader = irheader; irenvelope.VATDeclarationRequest = vatreq; return(irenvelope); }
public IRenvelope CreateIREnvelopeBody(Sender sender, Business business) { IRenvelope irenvelope = new IRenvelope(); IRheader irheader = new IRheader(); IRheaderKey irheaderkey = new IRheaderKey(); irheaderkey.Type = "VATRegNo"; irheaderkey.Value = business.VATRegNo; irheader.PeriodID = _periodData.PeriodrefId; irheader.Sender = IRheaderSender.Individual; irheader.PeriodStart = _periodData.StartPeriod; irheader.PeriodEnd = _periodData.EndPeriod; IRheaderKey[] irHeaderKeys = new IRheaderKey[1]; irHeaderKeys[0] = irheaderkey; irheader.Keys = irHeaderKeys; VATDeclarationRequest_ContactDetailsStructure contact = new VATDeclarationRequest_ContactDetailsStructure(); VATDeclarationRequest_ContactDetailsStructureName name = new VATDeclarationRequest_ContactDetailsStructureName(); name.Fore = new[] { sender.ForName1, sender.ForName2 }; name.Sur = sender.SurName; name.Ttl = sender.Title; VATDeclarationRequest_ContactDetailsStructureEmail email = new VATDeclarationRequest_ContactDetailsStructureEmail(); email.Preferred = VATDeclarationRequest_YesNoType.yes; email.PreferredSpecified = true; email.Type = VATDeclarationRequest_WorkHomeType.work; email.TypeSpecified = true; email.Value = sender.Email; contact.Name = name; VATDeclarationRequest_ContactDetailsStructureEmail[] Emails = new VATDeclarationRequest_ContactDetailsStructureEmail[1]; Emails[0] = email; contact.Email = Emails; IRheaderPrincipal principal = new IRheaderPrincipal(); principal.Contact = contact; irheader.Principal = principal; IRheaderIRmark irmark = new IRheaderIRmark(); irmark.Type = IRheaderIRmarkType.generic; irmark.Value = ""; irheader.IRmark = irmark; VATDeclarationRequest vatreq = new VATDeclarationRequest(); vatreq.VATDueOnOutputs = _vat100Data.Box1; vatreq.VATDueOnECAcquisitions = _vat100Data.Box2; vatreq.TotalVAT = _vat100Data.Box3; vatreq.VATReclaimedOnInputs = _vat100Data.Box4; vatreq.NetVAT = _vat100Data.Box5; vatreq.NetSalesAndOutputs = _vat100Data.Box6; vatreq.NetPurchasesAndInputs = _vat100Data.Box7; vatreq.NetECSupplies = _vat100Data.Box8; vatreq.NetECAcquisitions = _vat100Data.Box9; //set values here irenvelope.IRheader = irheader; irenvelope.VATDeclarationRequest = vatreq; return(irenvelope); }
public void InitialiseIRHeader(ILoggingService loggingService) { _irHeader = new IRheader(); _loggingService = loggingService; }