コード例 #1
0
        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
                       ));
        }
コード例 #2
0
 public InvoiceId(TaxpayerIdentificationNumber issuer, String1To60 number, DateTime date)
 {
     Issuer = Check.IsNotNull(issuer, nameof(issuer));
     Number = Check.IsNotNull(number, nameof(number));
     Date   = date;
 }