예제 #1
0
 private CreditCardExpenseEntry GetEntry(int installment, CreditCardInvoice invoice)
 {
     return(new CreditCardExpenseEntry
            (
                $"{ReferenceName} {Date:F} {installment}/{Installments}",
                Date,
                GetDateReference(installment),
                Amount / Installments,
                Account,
                Buyer,
                invoice
            ));
 }
예제 #2
0
        public CreditCardInvoice GetInvoice(DateTime referenceDate)
        {
            var invoice = _invoices.FirstOrDefault(i => i.Reference == CreditCardInvoice.GetReferenceFromDate(referenceDate));

            if (invoice != null)
            {
                return(invoice);
            }

            invoice = new CreditCardInvoice(this, referenceDate);
            _invoices.Add(invoice);
            return(invoice);
        }
예제 #3
0
 public CreditCardExpenseEntry
 (
     string description,
     DateTime date,
     DateTime applicationDate,
     double amount,
     Account account,
     Buyer buyer,
     CreditCardInvoice creditCardInvoice
 ) : base(description, date, applicationDate, null, EEntryType.Debit, amount, account, buyer)
 {
     CreditCardInvoiceId = creditCardInvoice.Id;
     CreditCardInvoice   = creditCardInvoice;
 }
예제 #4
0
        public CreditCardInvoiceDetail
        (
            CreditCardInvoice invoice,
            CreditCardExpenseEntry entry
        ) : this()
        {
            ReferenceName = entry.Description;
            Amount        = Math.Abs(entry.Value);

            InvoiceId = invoice.Id;
            Invoice   = invoice;

            EntryId = entry.Id;
            Entry   = entry;
        }