diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index 53dfadc..65a85a7 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -3476,6 +3476,42 @@ namespace rmutr_report.Controllers "student_overview" + ".xlsx"); } + return Ok(); + } + [SwaggerOperation("สรุปงบประมาณรายจ่าย")] + [HttpPost, Route("reports/summary_budget_expense/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetBudgetSummaryExpenseReport([FromRoute] string type, + [FromBody] summary_budget_expense budget) + { + + var summaryBudget = new List() { budget }; + + Report report = new Report(); + report.Load(_setting.report_path + "summary_budget_expense.frx"); + report.RegisterData(summaryBudget, "summary_budget_expense"); + 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", + "summary_budget_expense" + ".xlsx"); + } + return Ok(); } } diff --git a/Models/budget/summary_budget_expense.cs b/Models/budget/summary_budget_expense.cs new file mode 100644 index 0000000..e062ec8 --- /dev/null +++ b/Models/budget/summary_budget_expense.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class summary_budget_expense + { + public string budget_year { get; set; } + public string agency_name_th { get; set; } + public string budget_plan_name_th { get; set; } + public string parent_agency_name { get; set; } + public List data { get; set; } + public decimal? total_equipment { get; set; } + public decimal? total_land_building { get; set; } + public decimal? total_subsidy { get; set; } + public decimal? total_compensation { get; set; } + public decimal? total_living_expenses { get; set; } + public decimal? total_material { get; set; } + public decimal? total_utilities { get; set; } + public decimal? total_other_expenses { get; set; } + public decimal? total_other_budget_expenses { get; set; } + public decimal? total_all { get; set; } + } + + public class summary_budget_expense_detail + { + public string budget_project_name_th { get; set; } + public decimal? equipment { get; set; } + public decimal? land_building { get; set; } + public decimal? subsidy { get; set; } + public decimal? compensation { get; set; } + public decimal? living_expenses { get; set; } + public decimal? material { get; set; } + public decimal? utilities { get; set; } + public decimal? other_expenses { get; set; } + public decimal? other_budget_expenses { get; set; } + public decimal? total { get; set; } + } +} \ No newline at end of file diff --git a/bin/Debug/net5.0/rmutr_report.dll b/bin/Debug/net5.0/rmutr_report.dll index fa146f7..f681b9a 100644 Binary files a/bin/Debug/net5.0/rmutr_report.dll and b/bin/Debug/net5.0/rmutr_report.dll differ diff --git a/bin/Debug/net5.0/rmutr_report.pdb b/bin/Debug/net5.0/rmutr_report.pdb index a21b8a9..22d7511 100644 Binary files a/bin/Debug/net5.0/rmutr_report.pdb and b/bin/Debug/net5.0/rmutr_report.pdb differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 452fd64..8de2f86 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 7d3dd11..414ff00 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/net5.0/ref/rmutr_report.dll b/obj/Debug/net5.0/ref/rmutr_report.dll index 95611e1..97b747b 100644 Binary files a/obj/Debug/net5.0/ref/rmutr_report.dll and b/obj/Debug/net5.0/ref/rmutr_report.dll differ diff --git a/obj/Debug/net5.0/refint/rmutr_report.dll b/obj/Debug/net5.0/refint/rmutr_report.dll index 95611e1..97b747b 100644 Binary files a/obj/Debug/net5.0/refint/rmutr_report.dll and b/obj/Debug/net5.0/refint/rmutr_report.dll differ diff --git a/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs b/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs index f7188f7..11ffe45 100644 --- a/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs +++ b/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+11d4269f2a953099a1a2e2a18a12481feb57743d")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5f44fa4ecbad606ad73975fffc8699ac8e1af4ea")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache b/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache index b219327..32bce40 100644 --- a/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -03b0534922c4aafb3191ccd7974eadf115d743c6c7b4b6da29d3cc29594325f0 +1135665427bbeecf8c2ad531dc444d715aaefb436e07fb44d540ba2feb6dd557 diff --git a/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache b/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache index b8d0b11..9d383a4 100644 --- a/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache +++ b/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache @@ -1 +1 @@ -6f1697b6b3ee209a8dc6494f742f942d1069dcf6f0776195128b7d2b88e95220 +814cbd923d0b771afb4468edd956b64b37aff6602890bfb34cfcf0a5743cec8f diff --git a/obj/Debug/net5.0/rmutr_report.csproj.CoreCompileInputs.cache b/obj/Debug/net5.0/rmutr_report.csproj.CoreCompileInputs.cache index fdfd4a9..8405e1a 100644 --- a/obj/Debug/net5.0/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net5.0/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -151a50b1ee190d1aeaee2cba3f62986c63ace172165d58d9d44da5f25e02d993 +e2b740473ce2922e386ca29207bf0ddd8d311b9fa433e7d972dee6de2a5bd678 diff --git a/obj/Debug/net5.0/rmutr_report.dll b/obj/Debug/net5.0/rmutr_report.dll index fa146f7..f681b9a 100644 Binary files a/obj/Debug/net5.0/rmutr_report.dll and b/obj/Debug/net5.0/rmutr_report.dll differ diff --git a/obj/Debug/net5.0/rmutr_report.pdb b/obj/Debug/net5.0/rmutr_report.pdb index a21b8a9..22d7511 100644 Binary files a/obj/Debug/net5.0/rmutr_report.pdb and b/obj/Debug/net5.0/rmutr_report.pdb differ diff --git a/obj/Debug/net5.0/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props b/obj/Debug/net5.0/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props index 280274a..e931b1f 100644 --- a/obj/Debug/net5.0/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props +++ b/obj/Debug/net5.0/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props @@ -2752,6 +2752,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\summary_all_project_table.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\summary_budget_expense.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\summary_budget_expense.frx)) + Package rmutr_report diff --git a/obj/Debug/net5.0/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache b/obj/Debug/net5.0/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache index 352ee4c..23efb3e 100644 --- a/obj/Debug/net5.0/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache +++ b/obj/Debug/net5.0/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache @@ -1 +1 @@ -3aa706f2c61e17142c6c20bf3e6e70812f5704e5e1fd08724f95f850b6ae70ed +3a5ed6e019ac50427c04c5dcc311649c0287e5ab2253e898c63f505c41bfa92f diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs index 07936f8..11ffe45 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs +++ b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+da2936ee0d4f518eed75d681e659b829b5c83b70")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5f44fa4ecbad606ad73975fffc8699ac8e1af4ea")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache index c3a49ae..32bce40 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -d422d09f7ef4c657f7792bcea4a4e378820d0b0f1fb3a5b9c031dcf2a2fae350 +1135665427bbeecf8c2ad531dc444d715aaefb436e07fb44d540ba2feb6dd557 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache index 0cd0822..9d383a4 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache @@ -1 +1 @@ -9f60262dad61b3efce04caf2181f0daca67f75db1b054c8852d368c6ea861cba +814cbd923d0b771afb4468edd956b64b37aff6602890bfb34cfcf0a5743cec8f diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 8829694..6d5782a 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -33fc03236a4722f554f10fac37fe989dc73f2aafe8cf22c724021db85b56c8dd +da06089eb1c3be2785a14fe62b3131711b3e91545e14a70bec5baf07f6b78f23 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 452fd64..8de2f86 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 7d3dd11..414ff00 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 07392bd..e931b1f 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 @@ -512,6 +512,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\durable_articles_threeold.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\durable_articles_three_old.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\durable_articles_three_old.frx)) + Package rmutr_report @@ -2736,6 +2752,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\summary_all_project_table.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\summary_budget_expense.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\summary_budget_expense.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 00a52c0..23efb3e 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 @@ -0940c1c1a0b8dafd8584f37614446a60332eb78045fff61b1d37512d1601cad0 +3a5ed6e019ac50427c04c5dcc311649c0287e5ab2253e898c63f505c41bfa92f diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index 639243a..5fad534 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -17032367224993865 \ No newline at end of file +17080675174043013 \ No newline at end of file diff --git a/wwwroot/reports/summary_budget_expense.frx b/wwwroot/reports/summary_budget_expense.frx new file mode 100644 index 0000000..32d07c4 --- /dev/null +++ b/wwwroot/reports/summary_budget_expense.frx @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +