Exemplo n.º 1
0
        public Invoice(
            InvoiceNumber number,
            DateTime issueDate,
            DateTime paymentDate,
            SupplierInfo supplierInfo,
            Receiver receiver,
            CurrencyCode currencyCode,
            ISequence <InvoiceItem> items,
            bool isSelfBilling          = false,
            bool isCashAccounting       = false,
            PaymentMethod?paymentMethod = null)
        {
            Number           = number;
            IssueDate        = issueDate;
            PaymentDate      = paymentDate;
            SupplierInfo     = supplierInfo;
            Receiver         = receiver;
            CurrencyCode     = currencyCode;
            Items            = items;
            DeliveryDate     = Items.Values.Max(i => i.Value.ConsumptionDate);
            ExchangeRate     = GetExchangeRate(items);
            TaxSummary       = GetTaxSummary(items);
            IsSelfBilling    = isSelfBilling;
            IsCashAccounting = isCashAccounting;
            PaymentMethod    = paymentMethod.ToOption();

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