示例#1
0
        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);
                }
            }
        }
示例#2
0
 public IEnumerable <CustomerAccount> GetContractUnits(int customerId)
 {
     return(_contractUnitRepository.GetMany(c => c.CustomerId == customerId));
 }