public static MLedger_DashboardItem MLedger_DashboardItem(LedgerAccountSubtotal dbLedgerAccountSubtotal) { return(new MLedger_DashboardItem() { AccountCode = dbLedgerAccountSubtotal.LedgerAccountNumberNavigation.LedgerAccountNumber, AccountDescription = dbLedgerAccountSubtotal.LedgerAccountNumberNavigation.Name, DebitCreditCode = dbLedgerAccountSubtotal.LedgerAccountNumberNavigation.DebitCreditCode, Amount = dbLedgerAccountSubtotal.Balance }); }
private LedgerAccountSubtotal GetLedgerAccountSubtotal(int ledgerAccountNumber) { var dbLedgerAccountSubtotal = m_ctx.LedgerAccountSubtotals.Where(r => r.LedgerAccountNumber == ledgerAccountNumber && r.AccountingYear == m_postDateTime.Year).SingleOrDefault(); if (dbLedgerAccountSubtotal == null) { dbLedgerAccountSubtotal = new LedgerAccountSubtotal() { LedgerAccountNumber = ledgerAccountNumber, AccountingYear = m_postDateTime.Year, Balance = 0, UpdateDateTimeUtc = m_utcNow }; _ = m_ctx.LedgerAccountSubtotals.Add(dbLedgerAccountSubtotal); } return(dbLedgerAccountSubtotal); }