private void AddCustomerActiveContractsToInvoiceAndUpdateAccounts(Invoice invoice, Customer customer) { var activeContracts = _contractUnitRepository.GetMany(c => c.CustomerId == customer.CustomerId); foreach (var activeContract in activeContracts) { var invoiceItem = InitialiseInvoiceItem(activeContract); AddPostedEntriesToContracts(invoice, invoiceItem, activeContract); AddContractsToInvoice(invoice, invoiceItem, activeContract); if (AreThereContractItemsInInvoiceItem(invoiceItem)) { invoice.InvoiceItems.Add(invoiceItem); AddTransactionEntryForInvoice(invoice, invoiceItem); } } }
public IEnumerable <CustomerAccount> GetContractUnits(int customerId) { return(_contractUnitRepository.GetMany(c => c.CustomerId == customerId)); }