เพิ่มหน้า ui รายงาน เงินเดือน
This commit is contained in:
120
ApiControllers/rpt_payroll_summaryControllers.cs
Normal file
120
ApiControllers/rpt_payroll_summaryControllers.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/rpt_payroll_summary")]
|
||||
public class rpt_payroll_summaryController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<rpt_payroll_summaryController> _logger;
|
||||
private Irpt_payroll_summaryService _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public rpt_payroll_summaryController(ILogger<rpt_payroll_summaryController> logger, Irpt_payroll_summaryService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(rpt_payroll_summaryWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download Report
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("rpt_payroll_summary_report")]
|
||||
[ProducesResponseType(typeof(FileStreamResult), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult rpt_payroll_summary_report(rpt_payroll_summaryReportRequestModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = new WebClient();
|
||||
|
||||
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
|
||||
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
|
||||
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
|
||||
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rpt_payroll_summary.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
return File(stream, model.contentType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception while GetReport.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
EXCEL/eva_level_score@rpt_payroll_summary.xlsx
Normal file
BIN
EXCEL/eva_level_score@rpt_payroll_summary.xlsx
Normal file
Binary file not shown.
@@ -33,6 +33,8 @@ namespace TodoAPI2.Models
|
||||
List<external_linkageViewModel> GetAllChildInDep(int? dep_id);
|
||||
List<external_linkageViewModel> GetChildInDep(int? dep_id);
|
||||
List<external_linkageViewModel> GetSortingDep();
|
||||
List<external_linkageViewModel> GetFiscalYear2();
|
||||
List<external_linkageViewModel> GetThaiMonth();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Net;
|
||||
using TTSW.Configure;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
@@ -354,6 +355,26 @@ namespace TodoAPI2.Models
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetFiscalYear2()
|
||||
{
|
||||
int start_year = DateTime.Now.Year - 10;
|
||||
if (start_year < 2400) start_year += 543;
|
||||
int end_year = DateTime.Now.Year + 3;
|
||||
if (end_year < 2400) end_year += 543;
|
||||
|
||||
var result = new List<external_linkageViewModel>();
|
||||
for (int x = start_year; x <= end_year; x++)
|
||||
{
|
||||
var i = new external_linkageViewModel();
|
||||
i.external_id = x - 543;
|
||||
i.external_code = x.ToString();
|
||||
i.external_name = x.ToString();
|
||||
result.Add(i);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//public List<external_linkageViewModel> GetEvaRound()
|
||||
//{
|
||||
// var sql = string.Format("select distinct eva_performance_plan.id,eva_performance_plan.{0}theTime{0} , eva_performance_plan.fiscal_year from eva_performance_plan order by eva_performance_plan.fiscal_year,eva_performance_plan.{0}theTime{0}", '"'.ToString());
|
||||
@@ -426,6 +447,26 @@ where detail.parent_department_id={1} or data1.id={1};", '"'.ToString(), dep_id.
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetThaiMonth()
|
||||
{
|
||||
var result = new List<external_linkageViewModel>();
|
||||
|
||||
for (int monthNo = 1; monthNo <= 12; monthNo++)
|
||||
{
|
||||
var bar = new DateTime(DateTime.Now.Year, monthNo, 1);
|
||||
string month = bar.ToString("MMMM", new CultureInfo("th-TH"));
|
||||
|
||||
var i = new external_linkageViewModel();
|
||||
//i.external_guid = null;
|
||||
i.external_id = monthNo;
|
||||
i.external_code = monthNo.ToString();
|
||||
i.external_name = month;
|
||||
result.Add(i);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetSortingDep()
|
||||
{
|
||||
var sql = string.Format(@"
|
||||
|
||||
20
Models/rpt_payroll_summary/Irpt_payroll_summaryService.cs
Normal file
20
Models/rpt_payroll_summary/Irpt_payroll_summaryService.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public interface Irpt_payroll_summaryService
|
||||
{
|
||||
rpt_payroll_summaryWithSelectionViewModel GetBlankItem();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
28
Models/rpt_payroll_summary/rpt_payroll_summaryInputModel.cs
Normal file
28
Models/rpt_payroll_summary/rpt_payroll_summaryInputModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rpt_payroll_summaryInputModel
|
||||
{
|
||||
|
||||
public Guid? id { get; set; }
|
||||
|
||||
public int? rpt_year { get; set; }
|
||||
|
||||
public int? rpt_month { get; set; }
|
||||
|
||||
public int? department_id { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rpt_payroll_summaryReportRequestModel : rpt_payroll_summarySearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
27
Models/rpt_payroll_summary/rpt_payroll_summarySearchModel.cs
Normal file
27
Models/rpt_payroll_summary/rpt_payroll_summarySearchModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rpt_payroll_summarySearchModel
|
||||
{
|
||||
|
||||
public Guid id { get; set; }
|
||||
|
||||
public int? rpt_year { get; set; }
|
||||
|
||||
public int? rpt_month { get; set; }
|
||||
|
||||
public int? department_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
42
Models/rpt_payroll_summary/rpt_payroll_summaryService.cs
Normal file
42
Models/rpt_payroll_summary/rpt_payroll_summaryService.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Net;
|
||||
using TTSW.Configure;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Data;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rpt_payroll_summaryService : Irpt_payroll_summaryService
|
||||
{
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
|
||||
public rpt_payroll_summaryService(IMyDatabase mydb, Iexternal_linkageService inext)
|
||||
{
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
}
|
||||
|
||||
public rpt_payroll_summaryWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new rpt_payroll_summaryWithSelectionViewModel();
|
||||
i.item_rpt_year = (from x in ext.GetFiscalYear2() orderby x.external_id descending select x).ToList();
|
||||
i.item_rpt_month = (from x in ext.GetThaiMonth() select x).ToList();
|
||||
i.item_department_id = (from x in ext.GetSortingDep() select x).ToList();
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Models/rpt_payroll_summary/rpt_payroll_summaryViewModel.cs
Normal file
28
Models/rpt_payroll_summary/rpt_payroll_summaryViewModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rpt_payroll_summaryViewModel : BaseViewModel2<Guid>
|
||||
{
|
||||
|
||||
public int? rpt_year { get; set; }
|
||||
|
||||
public int? rpt_month { get; set; }
|
||||
|
||||
public int? department_id { get; set; }
|
||||
|
||||
public string rpt_year_external_linkage_external_name { get; set; }
|
||||
public string rpt_month_external_linkage_external_name { get; set; }
|
||||
public string department_id_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class rpt_payroll_summaryWithSelectionViewModel: rpt_payroll_summaryViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_rpt_year { get; set; }
|
||||
public List<external_linkageViewModel> item_rpt_month { get; set; }
|
||||
public List<external_linkageViewModel> item_department_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -287,6 +287,8 @@ namespace Test01
|
||||
|
||||
services.AddScoped<Irep_leave_total_02Service, rep_leave_total_02Service>();
|
||||
|
||||
services.AddScoped<Irpt_payroll_summaryService, rpt_payroll_summaryService>();
|
||||
|
||||
#endregion
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
@@ -502,6 +504,10 @@ namespace Test01
|
||||
cfg.CreateMap<eva_level_scoreEntity, rep_leave_total_02ViewModel>();
|
||||
cfg.CreateMap<eva_level_scoreEntity, rep_leave_total_02WithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<rpt_payroll_summaryInputModel, eva_level_scoreEntity>();
|
||||
cfg.CreateMap<eva_level_scoreEntity, rpt_payroll_summaryViewModel>();
|
||||
cfg.CreateMap<eva_level_scoreEntity, rpt_payroll_summaryWithSelectionViewModel>();
|
||||
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
66
ViewControllers/rpt_payroll_summaryViewControllers.cs
Normal file
66
ViewControllers/rpt_payroll_summaryViewControllers.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using TodoAPI2.Models;
|
||||
using STAFF_API.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using TodoAPI2.Controllers;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
public class rpt_payroll_summaryViewController : Controller
|
||||
{
|
||||
private ILogger<rpt_payroll_summaryController> _logger;
|
||||
private Irpt_payroll_summaryService _repository;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public rpt_payroll_summaryViewController(ILogger<rpt_payroll_summaryController> logger, Irpt_payroll_summaryService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
// public IActionResult rpt_payroll_summary()
|
||||
// {
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
// }
|
||||
|
||||
// public IActionResult rpt_payroll_summary_d()
|
||||
// {
|
||||
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
// }
|
||||
|
||||
public IActionResult rpt_payroll_summary_report()
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
return View();
|
||||
}
|
||||
|
||||
//public IActionResult rpt_payroll_summary_inline()
|
||||
//{
|
||||
// if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
|
||||
// return View();
|
||||
//}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,9 @@
|
||||
<ul>
|
||||
<li><a href="~/rep_eva03View/rep_eva03_report"><div style="display: flex;align-items: center;"><span class="menu-dot">·</span>รายงานโครงสร้างของขั้นเงินเดือน</div></a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="~/rpt_payroll_summaryView/rpt_payroll_summary_report"><div style="display: flex;align-items: center;"><span class="menu-dot">·</span>รายงานเงินเดือน</div></a>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "rpt_payroll_summary";
|
||||
}
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@Configuration["SiteInformation:modulename"]
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<ol class="breadcrumb" style="">
|
||||
<li class="breadcrumb-item "><a href="javascript:window_open_from_root('@Configuration["SiteInformation:mainsite"]');">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="javascript:window_open_from_root('@Configuration["SiteInformation:modulesite"]');">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">รายงานเงินเดือน</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>รายงานเงินเดือน</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_rpt_payroll_summary_rpt_year' for='s_rpt_payroll_summary_rpt_year'>ปี</label>
|
||||
<select class="form-control" id="s_rpt_payroll_summary_rpt_year" iLabel="ปี" iRequire="true" iGroup="s_rpt_payroll_summary" title='ปี' placeholder='ปี'></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_rpt_payroll_summary_rpt_month' for='s_rpt_payroll_summary_rpt_month'>เดือน</label>
|
||||
<select class="form-control" id="s_rpt_payroll_summary_rpt_month" iLabel="เดือน" iRequire="true" iGroup="s_rpt_payroll_summary" title='เดือน' placeholder='เดือน'></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label id='lab_s_rpt_payroll_summary_department_id' for='s_rpt_payroll_summary_department_id'>หน่วยงาน</label>
|
||||
<select class="form-control" id="s_rpt_payroll_summary_department_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_rpt_payroll_summary" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-info" onclick="javascript:rpt_payroll_summary_DoSearch('pdf');">แสดงรายงาน</button>
|
||||
<button class="btn btn-info" onclick="javascript:rpt_payroll_summary_DoSearch('xlsx');">ดาวน์โหลดเป็น Excel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<br/>
|
||||
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/rpt_payroll_summary/rpt_payroll_summary_report.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
rpt_payroll_summary_InitialForm();
|
||||
SetupValidationRemark("s_rpt_payroll_summary");
|
||||
$("#s_rpt_payroll_summary_department_id").select2();
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
36
tb320eva.xml
36
tb320eva.xml
@@ -3572,6 +3572,34 @@
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rpt_payroll_summaryController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.rpt_payroll_summaryController},TodoAPI2.Models.Irpt_payroll_summaryService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rpt_payroll_summaryController.GetBlankItem">
|
||||
<summary>
|
||||
Get Blank Item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return a blank item</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rpt_payroll_summaryController.rpt_payroll_summary_report(TodoAPI2.Models.rpt_payroll_summaryReportRequestModel)">
|
||||
<summary>
|
||||
Download Report
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return list of items by specifced keyword</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.search_employeeController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.search_employeeController},TodoAPI2.Models.Isearch_employeeService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
@@ -3884,6 +3912,14 @@
|
||||
<param name="logger"></param>
|
||||
<param name="inemp"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.rpt_payroll_summaryViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.rpt_payroll_summaryController},TodoAPI2.Models.Irpt_payroll_summaryService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.search_employeeViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.search_employeeController},TodoAPI2.Models.Isearch_employeeService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
|
||||
62
wwwroot/js/rpt_payroll_summary/rpt_payroll_summary_report.js
Normal file
62
wwwroot/js/rpt_payroll_summary/rpt_payroll_summary_report.js
Normal file
@@ -0,0 +1,62 @@
|
||||
var rpt_payroll_summary_API = "/api/rpt_payroll_summary/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function rpt_payroll_summary_GetSearchParameter(fileType) {
|
||||
var rpt_payroll_summarySearchObject = new Object();
|
||||
rpt_payroll_summarySearchObject.rpt_year = $("#s_rpt_payroll_summary_rpt_year").val();
|
||||
rpt_payroll_summarySearchObject.rpt_month = $("#s_rpt_payroll_summary_rpt_month").val();
|
||||
rpt_payroll_summarySearchObject.department_id = $("#s_rpt_payroll_summary_department_id").val();
|
||||
|
||||
|
||||
rpt_payroll_summarySearchObject.fileType = fileType;
|
||||
|
||||
console.log(rpt_payroll_summarySearchObject);
|
||||
|
||||
return rpt_payroll_summarySearchObject;
|
||||
}
|
||||
|
||||
function rpt_payroll_summary_FeedDataToSearchForm(data) {
|
||||
DropDownClearFormAndFeedWithData($("#s_rpt_payroll_summary_rpt_year"), data, "id", "external_name", "item_rpt_year", data.rpt_year);
|
||||
DropDownClearFormAndFeedWithData($("#s_rpt_payroll_summary_rpt_month"), data, "id", "external_name", "item_rpt_month", data.rpt_month);
|
||||
DropDownClearFormAndFeedWithData($("#s_rpt_payroll_summary_department_id"), data, "id", "external_name", "item_department_id", data.department_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function rpt_payroll_summary_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
rpt_payroll_summary_FeedDataToSearchForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + rpt_payroll_summary_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var s_rpt_payroll_summary_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
|
||||
function rpt_payroll_summary_DoSearch(fileType) {
|
||||
if (!ValidateForm('s_rpt_payroll_summary', s_rpt_payroll_summary_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var p = $.param(rpt_payroll_summary_GetSearchParameter(fileType));
|
||||
|
||||
var report_url = apisite + "/api/rpt_payroll_summary/rpt_payroll_summary_report?" + p;
|
||||
|
||||
if (fileType === "pdf") {
|
||||
$("#report_result").attr("src", report_url);
|
||||
$("#report_result").show();
|
||||
//window.open(report_url);
|
||||
} else {
|
||||
$("#report_result").hide();
|
||||
window.open(report_url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user