586 lines
25 KiB
C#
586 lines
25 KiB
C#
|
|
using Ease.Core.Model;
|
|||
|
|
using Ease.Core.Utility;
|
|||
|
|
using HRM.BO;
|
|||
|
|
using HRM.DA;
|
|||
|
|
using HRM.DA.Fund;
|
|||
|
|
using HRM.Report;
|
|||
|
|
using Microsoft.AspNetCore.Authorization;
|
|||
|
|
using Microsoft.AspNetCore.Http;
|
|||
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace HRM.UI
|
|||
|
|
{
|
|||
|
|
[Route("api/FundReport")]
|
|||
|
|
[Authorize]
|
|||
|
|
[ApiController]
|
|||
|
|
public class FundReportController : ControllerBase
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
public FundReportController()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getMemberInfoReport")]
|
|||
|
|
public ActionResult GetMemberInfoReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
EnumEmpSearchType status = (EnumEmpSearchType)(int)items["status"].ToObject<EnumEmpSearchType>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
DateTime toDate = DateTime.MinValue;
|
|||
|
|
DateTime fromDate = DateTime.MinValue;
|
|||
|
|
|
|||
|
|
if (status == EnumEmpSearchType.Regardless)
|
|||
|
|
{ // for year search type
|
|||
|
|
toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
}
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
bytes = new FundReports().GetMemberInfo(status, fromDate, toDate, reportType, fundTypeID);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("memberYearlyReport")]
|
|||
|
|
public ActionResult MemberYearlyReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
EnumEmpStatus status = (EnumEmpStatus)items["selectedStatus"].ToObject<int>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
fromDate = Global.DateFunctions.FirstDateOfMonth(fromDate);
|
|||
|
|
toDate = Global.DateFunctions.LastDateOfMonth(toDate);
|
|||
|
|
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
bytes = new FundReports().GetMemberYearlyReport(status, fromDate, toDate, reportType, fundTypeID);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getMemberContributionReport")]
|
|||
|
|
public ActionResult GetMemberContributionReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime fromDate = (DateTime)items["formDate"].ToObject<DateTime>();
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
int memberID = (int)items["selectedMemberID"].ToObject<int>();
|
|||
|
|
string balanceType = (string)items["summaryAndLedgerCheckbox"].ToObject<string>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
Member member = new MemberService().Get(memberID);
|
|||
|
|
if (balanceType == "Summary")
|
|||
|
|
{
|
|||
|
|
bytes = new FundReports().MakeIndividualMemberConReport(member, Global.DateFunctions.FirstDateOfMonth(fromDate), Global.DateFunctions.FirstDateOfMonth(toDate), reportType, fundTypeID);
|
|||
|
|
}
|
|||
|
|
else if (balanceType == "Ledger")
|
|||
|
|
{
|
|||
|
|
bytes = new FundReports().MakeIndividualMemberLedgerReport(member, Global.DateFunctions.FirstDateOfMonth(fromDate), Global.DateFunctions.FirstDateOfMonth(toDate), reportType, fundTypeID);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getMemberVoluntaryContributionReport")]
|
|||
|
|
public ActionResult GetMemberVoluntaryContributionReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime fromDate = (DateTime)items["formDate"].ToObject<DateTime>();
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
int memberID = (int)items["selectedMemberID"].ToObject<int>();
|
|||
|
|
string balanceType = (string)items["summaryAndLedgerCheckbox"].ToObject<string>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
Member member = new MemberService().Get(memberID);
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (balanceType == "Summary")
|
|||
|
|
{
|
|||
|
|
bytes = new FundReports().MakeIndividualMemberVoluntaryConReport(member, Global.DateFunctions.FirstDateOfMonth(fromDate), Global.DateFunctions.FirstDateOfMonth(toDate), reportType, fundTypeID);
|
|||
|
|
}
|
|||
|
|
else if (balanceType == "Ledger")
|
|||
|
|
{
|
|||
|
|
bytes = new FundReports().MakeIndividualMemberLedgerReport(member, Global.DateFunctions.FirstDateOfMonth(fromDate), Global.DateFunctions.FirstDateOfMonth(toDate), reportType, fundTypeID);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getMemberPFContributionReport")]
|
|||
|
|
public ActionResult GetMemberPFContributionReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
int memberID = (int)items["selectedMemberID"].ToObject<int>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
Member member = new MemberService().Get(memberID);
|
|||
|
|
bytes = new FundReports().GetMemberPFContribution(member, toDate, reportType, currentUser, fundTypeID);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getLoanToMemberReport")]
|
|||
|
|
public ActionResult GetLoanToMemberReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = DateTime.MinValue;
|
|||
|
|
DateTime fromDate = DateTime.MinValue;
|
|||
|
|
DateTime year = DateTime.MinValue;
|
|||
|
|
bool isYearly = (bool)items["isYearlyCheck"].ToObject<bool>();
|
|||
|
|
bool isFromTo = (bool)items["isFromToCheck"].ToObject<bool>();
|
|||
|
|
|
|||
|
|
if (isFromTo)
|
|||
|
|
{
|
|||
|
|
toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
else if (isYearly)
|
|||
|
|
{
|
|||
|
|
year = (DateTime)items["yearDate"].ToObject<DateTime>();
|
|||
|
|
fromDate = Global.DateFunctions.FirstDateOfYear(year);
|
|||
|
|
toDate = Global.DateFunctions.LastDateOfYear(year);
|
|||
|
|
}
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
bytes = new FundReports().MakeLoanToMembersReport(fromDate, toDate, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getPFStatementReport")]
|
|||
|
|
public ActionResult GetPFStatementReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
int memberID = (int)items["selectedMemberID"].ToObject<int>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
|
|||
|
|
bytes = new FundReports().GetPFStatmentReport(memberID, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getPFRefundStatmentReport")]
|
|||
|
|
public ActionResult GetPFRefundStatmentReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
int memberID = (int)items["selectedMemberID"].ToObject<int>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
bytes = new FundReports().GetPFRefundStatmentReport(memberID, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getDayBookReport")]
|
|||
|
|
public ActionResult GetDayBookReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
int voucherType = (int)items["voucherType"].ToObject<int>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
bytes = new FundReports().DayBookReport(voucherType, fromDate, toDate, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw new Exception(ex.Message);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getIndividualLoanReport")]
|
|||
|
|
public ActionResult GetIndividualLoanReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
int memID = (int)items["selectedMemberID"].ToObject<int>();
|
|||
|
|
string memName = (string)items["selectedMemberName"].ToObject<string>();
|
|||
|
|
string memCode = (string)items["selectedMemberCode"].ToObject<string>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int loanID = (int)items["loanID"].ToObject<int>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
bytes = new FundReports().MakeIndividualLoanReport(memID, memName, memCode, loanID, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw new Exception(ex.Message);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getInvestmentDetailReport")]
|
|||
|
|
public ActionResult GetInvestmentDetailReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = DateTime.MinValue;
|
|||
|
|
DateTime fromDate = DateTime.MinValue;
|
|||
|
|
DateTime year = DateTime.MinValue;
|
|||
|
|
bool isYearly = (bool)items["isYearlyCheck"].ToObject<bool>();
|
|||
|
|
bool isFromTo = (bool)items["isFromToCheck"].ToObject<bool>();
|
|||
|
|
|
|||
|
|
if (isFromTo)
|
|||
|
|
{
|
|||
|
|
toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
else if (isYearly)
|
|||
|
|
{
|
|||
|
|
year = (DateTime)items["yearDate"].ToObject<DateTime>();
|
|||
|
|
fromDate = Global.DateFunctions.FirstDateOfYear(year);
|
|||
|
|
toDate = Global.DateFunctions.LastDateOfYear(year);
|
|||
|
|
}
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int investmentType = (int)items["investmentType"].ToObject<int>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
bytes = new FundReports().InvestmentDetailReport(fromDate, toDate, investmentType, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Console.WriteLine(ex.Message);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getInvestmetSummaryReport")]
|
|||
|
|
public ActionResult GetInvestmetSummaryReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int investmentID = (int)items["investmentID"].ToObject<int>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
bytes = new FundReports().MakeInvestmentSummaryReport(fromDate, toDate, investmentID, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Console.WriteLine(ex.Message);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost("getInvestmentAccountNo")]
|
|||
|
|
public ActionResult GetInvestmentAccountNo(dynamic data)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
List<InvestmentInfo> investments = null;
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
investments = new InvestmentService().GetInvestments(fromDate, toDate, fundTypeID);
|
|||
|
|
return Ok(investments);
|
|||
|
|
}
|
|||
|
|
catch (ServiceException e)
|
|||
|
|
{
|
|||
|
|
throw new Exception(e.Message, e);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost("getLedgerReport")]
|
|||
|
|
public ActionResult GetLedgerReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
List<GL> gL = (List<GL>)items["glValue"].ToObject<List<GL>>();
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
bytes = bytes = new FundReports().LedgerReport(fromDate, toDate, gL, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (ServiceException e)
|
|||
|
|
{
|
|||
|
|
throw new Exception(e.Message, e);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getTrialBalanceReport")]
|
|||
|
|
public ActionResult GetTrialBalanceReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
bool isIncludingSub = (bool)items["isIncludingSubChecked"].ToObject<bool>();
|
|||
|
|
bool isCascading = (bool)items["isCascadingTrialChecked"].ToObject<bool>();
|
|||
|
|
int accountLevel = (int)items["accountLevel"].ToObject<int>();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
bytes = new FundReports().TrialBalanceReport(accountLevel, isIncludingSub, fromDate, toDate, isCascading, fundTypeID, reportType, payrollTypeId);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw new Exception(ex.Message);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost("getBalanceSheetReport")]
|
|||
|
|
public ActionResult GetBalanceSheetReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
DateTime date = (DateTime)items["date"].ToObject<DateTime>();
|
|||
|
|
bytes = new FundReports().GetBSReport(date, fundTypeID, payrollTypeId, reportType);
|
|||
|
|
}
|
|||
|
|
catch (ServiceException e)
|
|||
|
|
{
|
|||
|
|
throw new Exception(e.Message, e);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost("getIncomeStatmentReport")]
|
|||
|
|
public ActionResult GetIncomeStatmentReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
bytes = new FundReports().GetIncomeStatmentReport(fromDate, toDate, fundTypeID, payrollTypeId, reportType);
|
|||
|
|
}
|
|||
|
|
catch (ServiceException e)
|
|||
|
|
{
|
|||
|
|
throw new Exception(e.Message, e);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost("getLoanScheduleReport")]
|
|||
|
|
public ActionResult GetLoanScheduleReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
bytes = new FundReports().LoanScheduleReport(toDate, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (ServiceException e)
|
|||
|
|
{
|
|||
|
|
throw new Exception(e.Message, e);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost("gratuityProvisionReport")]
|
|||
|
|
public ActionResult GratuityProvisionReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
DateTime currentMonth = (DateTime)items["currentMonth"].ToObject<DateTime>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
bytes = new FundReports().GetGratuityProvisioneport(currentMonth, payrollTypeId, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (ServiceException e)
|
|||
|
|
{
|
|||
|
|
throw new Exception(e.Message, e);
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("getSubsidiaryLedgerBook")]
|
|||
|
|
public ActionResult GetSubsidiaryLedgerBook(dynamic data)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
int subsidiaryType = (int)items["subsidiaryType"].ToObject<int>();
|
|||
|
|
int subsidiaryID = (int)items["subsidiaryID"].ToObject<int>();
|
|||
|
|
GL gls = (GL)items["gls"].ToObject<GL>();
|
|||
|
|
DateTime fromDate = (DateTime)items["fromDate"].ToObject<DateTime>();
|
|||
|
|
DateTime toDate = (DateTime)items["toDate"].ToObject<DateTime>();
|
|||
|
|
bytes = new FundReports().GetSubsidiaryLedgerBookReport(gls, subsidiaryID, subsidiaryType, fundTypeID, fromDate, toDate, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[HttpPost]
|
|||
|
|
[Route("gfSettlementReport")]
|
|||
|
|
public ActionResult GFSettlementReport(dynamic data)
|
|||
|
|
{
|
|||
|
|
byte[] bytes = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
|||
|
|
string reportType = (string)items["reportType"].ToObject<string>();
|
|||
|
|
int fundTypeID = (int)items["fundTypeID"].ToObject<int>();
|
|||
|
|
int id = (int)items["id"].ToObject<int>();
|
|||
|
|
bytes = new FundReports().GetGFSettlementReport(id, fundTypeID, reportType);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
return StatusCode(500, $"Internal server error: {ex.Message}");
|
|||
|
|
}
|
|||
|
|
return Ok(bytes);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|