示例#1
0
        public Invoice(
            InvoiceNumber number,
            DateTime issueDate,
            DateTime paymentDate,
            SupplierInfo supplierInfo,
            CustomerInfo customerInfo,
            CurrencyCode currencyCode,
            ISequence <InvoiceItem> items,
            bool isSelfBilling    = false,
            bool isCashAccounting = false)
        {
            Number           = number;
            IssueDate        = issueDate;
            PaymentDate      = paymentDate;
            SupplierInfo     = supplierInfo;
            CustomerInfo     = customerInfo;
            CurrencyCode     = currencyCode;
            Items            = items;
            DeliveryDate     = Items.Values.Max(i => i.Value.ConsumptionDate);
            ExchangeRate     = GetExchangeRate(items);
            TaxSummary       = GetTaxSummary(items);
            IsSelfBilling    = isSelfBilling;
            IsCashAccounting = isCashAccounting;

            CheckConsistency(this);
        }
 public ModificationInvoice(
     InvoiceNumber number,
     int modificationIndex,
     int itemIndexOffset,
     InvoiceNumber originalDocumentNumber,
     DateTime issueDate,
     DateTime paymentDate,
     SupplierInfo supplierInfo,
     CustomerInfo customerInfo,
     CurrencyCode currencyCode,
     ISequence <InvoiceItem> items,
     bool isSelfBilling       = false,
     bool isCashAccounting    = false,
     bool modifyWithoutMaster = false)
     : base(number, issueDate, paymentDate, supplierInfo, customerInfo, currencyCode, items, isSelfBilling, isCashAccounting)
 {
     OriginalDocumentNumber = originalDocumentNumber;
     ModificationIndex      = modificationIndex;
     ItemIndexOffset        = itemIndexOffset;
     ModifyWithoutMaster    = modifyWithoutMaster;
 }