public NegativeInvoice(
     LocalCompany issuer,
     NegativeInvoiceHeader header,
     IEnumerable <NegativeRevenue> revenueItems,
     StringIdentifier invoiceIdentifier = null,
     InvoiceRegistrationNumber invoiceRegistrationNumber            = null,
     InvoiceRegistrationNumber cancelledByInvoiceRegistrationNumber = null,
     ForeignCompany counterpart             = null,
     IEnumerable <NegativePayment> payments = null)
     : base(issuer, header, revenueItems, invoiceIdentifier, invoiceRegistrationNumber, cancelledByInvoiceRegistrationNumber, counterpart, payments)
 {
 }
        public InvoiceRecord(StringIdentifier invoiceIdentifier, InvoiceRegistrationNumber invoiceRegistrationNumber, InvoiceRegistrationNumber cancelledByInvoiceRegistrationNumber, InvoiceRecordParty issuer, InvoiceRecordParty counterpart,
                             InvoiceRecordHeader invoiceHeader, IEnumerable <InvoiceRecordPaymentMethodDetails> paymentMethods, IEnumerable <InvoiceRecordDetail> invoiceDetails, InvoiceRecordSummary invoiceSummary)
        {
            InvoiceIdentifier                    = invoiceIdentifier;
            InvoiceRegistrationNumber            = invoiceRegistrationNumber;
            CancelledByInvoiceRegistrationNumber = cancelledByInvoiceRegistrationNumber;
            Issuer         = issuer;
            Counterpart    = counterpart;
            InvoiceHeader  = invoiceHeader ?? throw new ArgumentNullException(nameof(invoiceHeader));
            PaymentMethods = paymentMethods;
            InvoiceDetails = invoiceDetails ?? throw new ArgumentNullException(nameof(invoiceDetails));
            InvoiceSummary = invoiceSummary ?? throw new ArgumentNullException(nameof(invoiceSummary));

            if (invoiceDetails.Count() == 0)
            {
                throw new ArgumentException($"Minimal count of {nameof(invoiceDetails)} is 1.");
            }
        }
Ejemplo n.º 3
0
        public Invoice(
            LocalCompany issuer,
            InvoiceHeader header,
            IEnumerable <Revenue> revenueItems,
            StringIdentifier invoiceIdentifier = null,
            InvoiceRegistrationNumber invoiceRegistrationNumber            = null,
            InvoiceRegistrationNumber cancelledByInvoiceRegistrationNumber = null,
            ForeignCompany counterpart     = null,
            IEnumerable <Payment> payments = null)
        {
            Issuer                              = issuer ?? throw new ArgumentNullException(nameof(issuer));
            Header                              = header ?? throw new ArgumentNullException(nameof(header));
            InvoiceIdentifier                   = invoiceIdentifier;
            InvoiceRegistrationNumber           = invoiceRegistrationNumber;
            CanceledByInvoiceRegistrationNumber = cancelledByInvoiceRegistrationNumber;
            Counterpart                         = counterpart;
            RevenueItems                        = revenueItems;
            Payments                            = payments;

            if (revenueItems.Count() == 0)
            {
                throw new ArgumentException($"Minimal count of {nameof(revenueItems)} is 1.");
            }
        }