public static AccountTransactionViewModel FromModel(JournalEntryAccount model)
        {
            if (model == null)
            {
                return(null);
            }

            return(new AccountTransactionViewModel()
            {
                Id = model.JournalEntry.Id,
                EntryId = model.JournalEntry.EntryId,
                EntryDate = model.JournalEntry.EntryDate,
                Description = model.JournalEntry.Description,
                Note = model.JournalEntry.Note,
                CheckNumber = model.JournalEntry.CheckNumber,
                Created = model.JournalEntry.Created,
                Updated = model.JournalEntry.Updated,
                PostDate = model.JournalEntry.PostDate,
                CancelDate = model.JournalEntry.CancelDate,
                Status = model.JournalEntry.Status,
                Period = AccountingPeriodLiteViewModel.FromModel(model.JournalEntry.AccountingPeriod),
                AccountId = model.AccountId,
                Amount = new AmountViewModel(model.Amount, model.AssetType),
                PreviousBalance = model.PreviousBalance,
                NewBalance = model.NewBalance
            });
        }
Exemplo n.º 2
0
        public static AccountingPeriodLiteViewModel Fill(
            AccountingPeriodLiteViewModel viewModel,
            AccountingPeriod model)
        {
            viewModel.Id         = model.Id;
            viewModel.PeriodType = model.PeriodType;
            viewModel.Year       = model.Year;
            viewModel.Month      = model.Month;
            viewModel.Quarter    = model.Quarter;
            viewModel.Name       = model.Name;
            viewModel.Closed     = model.Closed;

            return(viewModel);
        }