public SimplifiedInvoice( TaxPeriod taxPeriod, InvoiceId id, SchemeOrEffect schemeOrEffect, String0To500 description, TaxBreakdown taxBreakdown, bool issuedByThirdParty) { TaxPeriod = Check.IsNotNull(taxPeriod, nameof(taxPeriod)); Id = Check.IsNotNull(id, nameof(id)); SchemeOrEffect = schemeOrEffect; Description = Check.IsNotNull(description, nameof(description)); TaxBreakdown = Check.IsNotNull(taxBreakdown, nameof(taxBreakdown)); IssuedByThirdParty = issuedByThirdParty; }
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 Invoice( TaxPeriod taxPeriod, InvoiceId id, InvoiceType type, SchemeOrEffect schemeOrEffect, String0To500 description, TaxBreakdown taxBreakdown, bool issuedByThirdParty, CounterPartyCompany counterPartyCompany) { TaxPeriod = Check.IsNotNull(taxPeriod, nameof(taxPeriod)); Id = Check.IsNotNull(id, nameof(id)); Type = type; SchemeOrEffect = schemeOrEffect; Description = Check.IsNotNull(description, nameof(description)); TaxBreakdown = Check.IsNotNull(taxBreakdown, nameof(taxBreakdown)); IssuedByThirdParty = issuedByThirdParty; CounterPartyCompany = Check.IsNotNull(counterPartyCompany, nameof(counterPartyCompany)); }