private PersonaFisicaJuridicaESType Convert(LocalCompany companyTitle) { return(new PersonaFisicaJuridicaESType { NombreRazon = companyTitle.Name.Value, NIF = companyTitle.TaxpayerIdentificationNumber.TaxpayerNumber }); }
private SimplifiedInvoice GetInvoice(LocalCompany issuingCompany, LocalCompany payingCompany, int invoiceIndex = 1) { var taxRateSummaries = new[] { GetTaxRateSummary(21m, 42.07M) }; var taxExemptItems = new[] { new TaxExemptItem(Amount.Create(20m).Success.Get(), CauseOfExemption.OtherGrounds) }; var nowUtc = DateTime.UtcNow; var issueDateUtc = nowUtc.Date; var invoiceNumber = $"Bill-{nowUtc:yyyy-MM-dd-HH-mm-ss}-{invoiceIndex}"; return(new SimplifiedInvoice( taxPeriod: new TaxPeriod(Year.Create(issueDateUtc.Year).Success.Get(), (Month)(issueDateUtc.Month - 1)), id: new InvoiceId(issuingCompany.TaxpayerIdentificationNumber, String1To60.CreateUnsafe(invoiceNumber), issueDateUtc), schemeOrEffect: SchemeOrEffect.GeneralTaxRegimeActivity, description: String0To500.CreateUnsafe("This is a test invoice."), taxBreakdown: new TaxBreakdown(TaxSummary.Create(taxExempt: taxExemptItems, taxed: taxRateSummaries).Success.Get()), issuedByThirdParty: true )); }
public Header(LocalCompany company, CommunicationType communicationType) { Company = company; CommunicationType = communicationType; }