public IActionResult SaveTransaction(QuickTransactionViewModel vm)
        {
            if (ModelState.IsValid == false)
            {
                vm.SelectedTransaction = accountsService.GetQuickTransactionDef(long.Parse(vm.SelectedTransaction)).Name;

                var accountHeads = accountsService.GetAllAccountHeadsByCurrency(HttpContext.Session.GetString("Currency"));
                var accountHeadsList = new SelectList(accountHeads, "AccountHeadId", "Name");
                vm.AccountHeads = accountHeadsList;

                return View("CreateTransaction", vm); 
            }

            Journal item = new Journal()
            {
                Amount = vm.Amount,
                CrAccountHeadId = vm.CrAccountHeadId,
                DrAccountHeadId = vm.DrAccountHeadId,
                Narration = vm.Narration,
                TransactionDate = vm.TransactionDate,
                ModifiedBy = "testuser", // TODO: replace with log in user id
                ModifiedDate = DateTime.Now
            };

            journalService.CreateJournal(item);

            return View("TransactionResult", item);
        }
 public void CreateJournal(Journal item)
 {
     DbContext.Journals.Add(item);
     DbContext.SaveChanges();
 }
 public ApportionItem(Journal journal)
 {
     Journal = journal;
 }