diff --git a/Controllers/RoThree.Controller.cs b/Controllers/RoThree.Controller.cs index a7f8cd7..12eaf79 100644 --- a/Controllers/RoThree.Controller.cs +++ b/Controllers/RoThree.Controller.cs @@ -1037,6 +1037,166 @@ namespace rmutr_report.Controllers break; } + return Ok(); + } + [SwaggerOperation("ค่าตอบแทนอื่นๆ")] + [HttpPost, Route("reports/other_compensation/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetCompensationReport([FromRoute] string type, + [FromBody] parcel_inspection_committee committee) + { + int no = 1; + + foreach (var data in committee.data) + { + data.list = "รายการ " + no; + no++; + foreach (var detail in data.data_detail) + { + if (detail != null) + { + detail.total_amount = ( detail.quantity_person * + detail.amount); + } + } + + data.total_amount = data.data_detail.Sum(f => f.total_amount); + + var s = committee.data.Sum(d => d.total_amount); + committee.total_all_amount = s; + } + + var expenses = new List() { committee }; + Report report = new Report(); + report.Load(_setting.report_path + "other_compensation.frx"); + report.RegisterData(expenses, "parcel_inspection_committee"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "other_compensation" + ".xlsx"); + } + + return Ok(); + } + [SwaggerOperation("ค่าตอบแทน_ค่าเช่าบ้าน")] + [HttpPost, Route("reports/house_rent_ro_three/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetHouseRentReport([FromRoute] string type, + [FromBody] house_rent_ro_three houseRent) + { + if (houseRent.topic_type == 1) + { + houseRent.topic_name = "ค่าเช่าบ้านชาวต่างประเทศ"; + + } + + if (houseRent.topic_type == 2) + { + houseRent.topic_name = "ค่าเช่าบ้านครูอาสาสมัคร(ชาวจีน)"; + + } + + if (houseRent.topic_type == 3) + { + houseRent.topic_name = "ค่าเช่าบ้านที่ปรึกษาชาวต่างประเทศ"; + } + + + var house = new List() { houseRent }; + Report report = new Report(); + report.Load(_setting.report_path + "house_rent_ro_three.frx"); + report.RegisterData(house, "house_rent_ro_three"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "house_rent_ro_three" + ".xlsx"); + } + + return Ok(); + } + [SwaggerOperation("ค่าตอบแทนพิเศษรายเดือน_ค่าตอบแทนเงินประจำตำแหน่ง")] + [HttpPost, Route("reports/compensation_ro_three/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetCompensationMoneyReport([FromRoute] string type, + [FromBody] compensation_ro_three compensationRoThree) + { + var compensation = compensationRoThree.data.ToList(); + if (compensationRoThree.topic_type == 1) + { + compensationRoThree.topic_name = "ค่าตอบแทนพิเศษรายเดือน อาจารย์ชาวต่างประเทศ"; + + } + + if (compensationRoThree.topic_type == 2) + { + compensationRoThree.topic_name = "ค่าตอบแทนเงินประจำตำแหน่ง"; + + } + + foreach (var detail in compensationRoThree.data) + { + detail.budget_amount = (detail.salary_rate * 12); + } + compensationRoThree.total_amount = compensation.Sum(f => f.budget_amount); + + var compensationRoThrees = new List() { compensationRoThree }; + Report report = new Report(); + report.Load(_setting.report_path + "compensation_ro_three.frx"); + report.RegisterData(compensationRoThrees, "compensation_ro_three"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "compensation_ro_three" + ".xlsx"); + } + return Ok(); } } diff --git a/Models/RoReport/compensation_ro_three.cs b/Models/RoReport/compensation_ro_three.cs new file mode 100644 index 0000000..3604236 --- /dev/null +++ b/Models/RoReport/compensation_ro_three.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models.RoThree +{ + public class compensation_ro_three + { + public int? topic_type { get; set; } //1 2 3 + public string topic_name { get; set; } + public string budget_year { get; set; } + public string date_range { get; set; } + public string product { get; set; } + public string agency_name_th { get; set; } + public string sector { get; set; } + public decimal? total_amount { get; set; } + public List data { get; set; } + } + + public class compensation_ro_three_detail + { + public string faculty_name_th { get; set; } + public string display_name_th { get; set; } + public decimal? salary_rate { get; set; } + public decimal? budget_amount { get; set; } + public string remark { get; set; } + + } +} \ No newline at end of file diff --git a/Models/RoReport/house_rent_ro_three.cs b/Models/RoReport/house_rent_ro_three.cs new file mode 100644 index 0000000..a72b046 --- /dev/null +++ b/Models/RoReport/house_rent_ro_three.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models.RoThree +{ + public class house_rent_ro_three + { + public int? topic_type { get; set; } //1 2 3 + public string topic_name { get; set; } + public string budget_year { get; set; } + public string product { get; set; } + public string agency_name_th { get; set; } + public string sector { get; set; } + public List data { get; set; } + } + + public class house_rent_ro_three_detail + { + public string display_name_th { get; set; } + public string position { get; set; } + public string qualification { get; set; } + public decimal? salary_rate { get; set; } + public decimal? other_compensation { get; set; } + public decimal? rent_per_month { get; set; } + public decimal? rent_per_year { get; set; } + public decimal? book { get; set; } + public decimal? insurance { get; set; } + public decimal? fee { get; set; } + + public string station { get; set; } + } +} \ No newline at end of file diff --git a/Models/budget/parcel_inspection_committee.cs b/Models/budget/parcel_inspection_committee.cs index 09ac945..707e10c 100644 --- a/Models/budget/parcel_inspection_committee.cs +++ b/Models/budget/parcel_inspection_committee.cs @@ -23,6 +23,7 @@ namespace rmutr_report.Models public decimal? quantity { get; set; } public decimal? quantity_person { get; set; } public decimal? amount { get; set; } + public decimal? total_amount { get; set; } public decimal? quantity_work { get; set; } public string unit { get; set; } } diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 432e961..a66f7c0 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.dll and b/bin/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.pdb b/bin/Debug/netcoreapp3.1/rmutr_report.pdb index c07703e..36b0890 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.pdb and b/bin/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 3a1fd01..badd940 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -4fbc03ee83ba8c63e3851e021e2d1fb743067dae +38a9d07017ef8cf4da24333a91be9dc5a1c91c4d diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 432e961..a66f7c0 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.dll and b/obj/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.pdb b/obj/Debug/netcoreapp3.1/rmutr_report.pdb index c07703e..36b0890 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props b/obj/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props index 860529b..0f74358 100644 --- a/obj/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props +++ b/obj/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props @@ -304,6 +304,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\compensation_head_major.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\compensation_ro_three.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\compensation_ro_three.frx)) + Package rmutr_report @@ -480,6 +496,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\faculty_council.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\house_rent_ro_three.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\house_rent_ro_three.frx)) + Package rmutr_report @@ -1120,6 +1152,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\other_committee_fee.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\other_compensation.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\other_compensation.frx)) + Package rmutr_report diff --git a/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache b/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache index db5ebbc..5407f81 100644 --- a/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache +++ b/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache @@ -1 +1 @@ -c5f222989e07e2a5023c6ece5f0951ac96f2245c +27b0df10d71791bb35e369c161be6ce323153ef6 diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index 2a652d1..1ba63a6 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -16992429240644035 \ No newline at end of file +16992484278328616 \ No newline at end of file diff --git a/wwwroot/reports/compensation_ro_three.frx b/wwwroot/reports/compensation_ro_three.frx new file mode 100644 index 0000000..f73196d --- /dev/null +++ b/wwwroot/reports/compensation_ro_three.frx @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/house_rent_ro_three.frx b/wwwroot/reports/house_rent_ro_three.frx new file mode 100644 index 0000000..db8363b --- /dev/null +++ b/wwwroot/reports/house_rent_ro_three.frx @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/other_compensation.frx b/wwwroot/reports/other_compensation.frx new file mode 100644 index 0000000..53705e3 --- /dev/null +++ b/wwwroot/reports/other_compensation.frx @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/parcel_inspection_committee.frx b/wwwroot/reports/parcel_inspection_committee.frx index 3fb3fe6..450fd48 100644 --- a/wwwroot/reports/parcel_inspection_committee.frx +++ b/wwwroot/reports/parcel_inspection_committee.frx @@ -18,9 +18,9 @@ - - - + + + @@ -30,17 +30,17 @@ - - - - - - + + + + + + - - - + + + @@ -50,12 +50,12 @@ - - - - - - + + + + + +