public async Task <ActionResult> MoneySummary(int projectId)
        {
            var project = await ProjectRepository.GetProjectWithFinances(projectId);

            if (project == null)
            {
                return(HttpNotFound());
            }

            var transfers =
                await FinanceReportRepository.GetAllMoneyTransfers(projectId);

            var payments = project.PaymentTypes
                           .Select(pt => new PaymentTypeSummaryViewModel(pt, project.FinanceOperations))
                           .Where(m => m.Total != 0).OrderByDescending(m => m.Total).ToArray();

            var viewModel = new MoneyInfoTotalViewModel(project,
                                                        transfers,
                                                        UriService,
                                                        project.FinanceOperations.ToArray(),
                                                        payments,
                                                        CurrentUserId);

            return(View(viewModel));
        }
        public async Task <ActionResult> SummaryByMaster(string token, int projectId)
        {
            var project = await ProjectRepository.GetProjectWithFinances(projectId);

            var guid = new Guid(token.FromHexString());

            var acl = project.ProjectAcls.SingleOrDefault(a => a.Token == guid);

            if (acl == null)
            {
                return(Content("Unauthorized"));
            }

            var masterOperations = project.FinanceOperations.ToArray();

            var masterTransfers = await FinanceReportRepository.GetAllMoneyTransfers(projectId);

            var summary =
                MasterBalanceBuilder.ToMasterBalanceViewModels(masterOperations, masterTransfers, projectId);

            var generator = ExportDataService.GetGenerator(ExportType.Csv, summary,
                                                           new MoneySummaryByMasterExporter(UriService));

            return(await ReturnExportResult(project.ProjectName + ": " + "money-summary", generator));
        }