public async Task<ActionResult> FinanceMng(int CompSn = 0, int BizWorkSn = 0) { ViewBag.LeftMenu = Global.Report; if(CompSn == 0) { CompSn = int.Parse(Session[Global.CompSN].ToString()); } //기업회원 승인된 사업이 없으면 리다이렉트 함 if(Session[Global.UserType].ToString() == Global.Company) { var scCompMappings = await _scCompMappingService.GetCompMappingsForCompanyAsync(CompSn); if (scCompMappings.Count == 0) { TempData["alert"] = "승인된 사업이 없습니다."; return RedirectToAction("index", "Company/Main"); } } // 로그인 기업의 승인된 사업정보를 가져옮 ViewBag.SelectYearList = ReportHelper.MakeYear(2014); ViewBag.SelectMonthList = ReportHelper.MakeMonth(); FinanceMngViewModel financeMngViewModel = new FinanceMngViewModel(); financeMngViewModel.Display = "N"; financeMngViewModel.CompSn = CompSn; financeMngViewModel.BizWorkSn = BizWorkSn; financeMngViewModel.curMenthTotalCostViewModel = new TotalCostViewModel(); financeMngViewModel.curMenthTotalCostViewModel.AllOtherAmt = "0"; financeMngViewModel.curMenthTotalCostViewModel.ManufacturingAmt = "0"; financeMngViewModel.curMenthTotalCostViewModel.MaterialAmt = "0"; financeMngViewModel.curMenthTotalCostViewModel.OperatingAmt = "0"; financeMngViewModel.curMenthTotalCostViewModel.ProfitAmt = "0"; financeMngViewModel.curMenthTotalCostViewModel.SalesAmt = "0"; return View(financeMngViewModel); }
public async Task<ActionResult> FinanceMng(FinanceMngViewModel financeMngViewModel) { ViewBag.LeftMenu = Global.Report; // 로그인 기업의 승인된 사업정보를 가져옮 var scCompInfo = await _scCompInfoService.GetScCompInfoByCompSn(financeMngViewModel.CompSn); ViewBag.SelectYearList = ReportHelper.MakeYear(2014); ViewBag.SelectMonthList = ReportHelper.MakeMonth(int.Parse(financeMngViewModel.Year)); financeMngViewModel.Display = "Y"; financeMngViewModel.CompNm = scCompInfo.CompNm; // 현금시제 var cashResultList = await _finenceReportService.GetMonthlyCashListAsync(ReportHelper.MakeProcedureParams(scCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], financeMngViewModel.Year.ToString(), financeMngViewModel.Month.ToString())); financeMngViewModel.cashViewModel = ReportHelper.MakeCashViewModel(cashResultList); // 매출 var salesResult = await _finenceReportService.GetMonthlySalesAsync(ReportHelper.MakeProcedureParams(scCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], financeMngViewModel.Year.ToString(), financeMngViewModel.Month.ToString())); var yearTotalResult = await _finenceReportService.GetYearTotalSalesAsync(ReportHelper.MakeProcedureParams(scCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], financeMngViewModel.Year.ToString(), financeMngViewModel.Month.ToString())); financeMngViewModel.salesViewModel = ReportHelper.MakeSalesViewModel(salesResult, yearTotalResult); // 이익분석 var costAnalysisListResult = await _finenceReportService.GetCostAnalysisAsync(ReportHelper.MakeProcedureParams(scCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], financeMngViewModel.Year.ToString(), financeMngViewModel.Month.ToString())); financeMngViewModel.curMenthTotalCostViewModel = ReportHelper.MakeCostAnalysisViewModel(costAnalysisListResult[0]); //financeMngViewModel.lastMenthTotalCostViewModel = ReportHelper.MakeCostAnalysisViewModel(costAnalysisListResult[1]); // 비용분석 var expenseCostResult = await _finenceReportService.GetExpenseCostAsync(ReportHelper.MakeProcedureParams(scCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], financeMngViewModel.Year.ToString(), financeMngViewModel.Month.ToString())); financeMngViewModel.expenseCostViewModel = ReportHelper.MakeExpenseCostViewModel(expenseCostResult[0]); // 주요매출 var taxSalesResult = await _finenceReportService.GetTaxSalesAsync(ReportHelper.MakeProcedureParams(scCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], financeMngViewModel.Year.ToString(), financeMngViewModel.Month.ToString())); financeMngViewModel.taxSalesListViewModel = ReportHelper.MakeTaxSalseListViewModel(taxSalesResult, salesResult); // 주요지출 var bankOutResult = await _finenceReportService.GetBankOutAsync(ReportHelper.MakeProcedureParams(scCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], financeMngViewModel.Year.ToString(), financeMngViewModel.Month.ToString())); financeMngViewModel.bankOutListViewModel = ReportHelper.MakeBnakOutListViewModel(bankOutResult); return View(financeMngViewModel); }