diff --git a/Controllers/GovernmentBudget.Controller.cs b/Controllers/GovernmentBudget.Controller.cs index 09df75e..1afcd49 100644 --- a/Controllers/GovernmentBudget.Controller.cs +++ b/Controllers/GovernmentBudget.Controller.cs @@ -964,49 +964,87 @@ namespace rmutr_report.Controllers if (_nationalBudgetList.report_type == 1) { _nationalBudgetList.budget_year = item + _nationalBudgetList.budget_year + ")"; + foreach (var detail in _nationalBudgetList.data) + { + if (detail != null) + { + detail.total_amount = (detail.quantity * detail.unit_price); + } + } } if (_nationalBudgetList.report_type == 2) { _nationalBudgetList.budget_year = item2 + _nationalBudgetList.budget_year + ")"; + foreach (var detail in _nationalBudgetList.data) + { + if (detail != null) + { + detail.total_amount = (detail.quantity * detail.unit_price*detail.quantity_month); + } + } + } - foreach (var detail in _nationalBudgetList.data) + var nationalBudgetLists = new List() { _nationalBudgetList }; + Report report = new Report(); + if (_nationalBudgetList.report_type == 2) { - if (detail != null) + report.Load(_setting.report_path + "national_budget_list_type2.frx"); + report.RegisterData(nationalBudgetLists, "national_budget_list"); + report.Prepare(); + + MemoryStream stream1 = new MemoryStream(); + switch (type) { - detail.total_amount = (detail.quantity * detail.unit_price); + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream1); + stream1.Seek(0, SeekOrigin.Begin); + return File(stream1, "application/pdf"); + + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream1); + stream1.Seek(0, SeekOrigin.Begin); + return File( + stream1, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "ค่าเช่าทรัพย์สิน" + ".xlsx"); } } - - var nationalBudgetLists = new List() { _nationalBudgetList }; - Report report = new Report(); - report.Load(_setting.report_path + "national_budget_list.frx"); - report.RegisterData(nationalBudgetLists, "national_budget_list"); - report.Prepare(); - - MemoryStream stream = new MemoryStream(); - switch (type) + if (_nationalBudgetList.report_type == 1) { - case "pdf": - PDFExport pdf = new PDFExport(); - report.Export(pdf, stream); - stream.Seek(0, SeekOrigin.Begin); - return File(stream, "application/pdf"); + report.Load(_setting.report_path + "national_budget_list.frx"); + report.RegisterData(nationalBudgetLists, "national_budget_list"); + report.Prepare(); - 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", - "ค่าคณะกรรมการตรวจสอบพัสดุในงานจ้างก่อสร้าง" + ".xlsx"); + 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", + "ค่าคณะกรรมการตรวจสอบพัสดุในงานจ้างก่อสร้าง" + ".xlsx"); + } } + + return Ok(); } @@ -1274,6 +1312,11 @@ namespace rmutr_report.Controllers _expense.topic = "ค่าเบี้ยเลี้ยง"; _expense.text_1 = "จำนวนเงิน/วัน"; _expense.text_2 = "จำนวน (วัน)"; + foreach (var detail in _expense.data) + { + detail.total_amount = + (detail.quantity_1 * detail.quantity_2 * detail.quantity_3 * detail.quantity_4); + } } if (_expense.topic_type == 2) @@ -1281,6 +1324,10 @@ namespace rmutr_report.Controllers _expense.topic = "ค่าเช่าที่พัก"; _expense.text_1 = "จำนวนเงิน/คน/คืน"; _expense.text_2 = "จำนวนวัน"; + foreach (var detail in _expense.data) + { + detail.total_amount = (detail.quantity_1 * detail.quantity_2 * detail.quantity_3); + } } if (_expense.topic_type == 3) @@ -1288,44 +1335,74 @@ namespace rmutr_report.Controllers _expense.topic = "ค่าพาหนะ"; _expense.text_1 = "จำนวนเงิน"; _expense.text_2 = "จำนวนครั้ง"; - } - - foreach (var detail in _expense.data) - { - detail.total_amount = (detail.quantity_1 * detail.quantity_2 * detail.quantity_3); + foreach (var detail in _expense.data) + { + detail.total_amount = (detail.quantity_1 * detail.quantity_2 * detail.quantity_3); + } } _expense.quantity_1 = _expense.data.Sum(d => d.quantity_1); _expense.quantity_2 = _expense.data.Sum(d => d.quantity_2); _expense.quantity_3 = _expense.data.Sum(d => d.quantity_3); + _expense.quantity_4 = _expense.data.Sum(d => d.quantity_4); _expense.total_amount = meals.Sum(f => f.total_amount); var expenses = new List() { _expense }; Report report = new Report(); - report.Load(_setting.report_path + "expense.frx"); - report.RegisterData(expenses, "expense"); - report.Prepare(); - - MemoryStream stream = new MemoryStream(); - switch (type) + if (_expense.topic_type == 1) { - case "pdf": - PDFExport pdf = new PDFExport(); - report.Export(pdf, stream); - stream.Seek(0, SeekOrigin.Begin); - return File(stream, "application/pdf"); + report.Load(_setting.report_path + "expense_allowance.frx"); + report.RegisterData(expenses, "expense"); + report.Prepare(); + MemoryStream stream1 = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream1); + stream1.Seek(0, SeekOrigin.Begin); + return File(stream1, "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", - "ค่าใช้สอย" + ".xlsx"); + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream1); + stream1.Seek(0, SeekOrigin.Begin); + return File( + stream1, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "ค่าเบี้ยเลี้ยง" + ".xlsx"); + } } + if (_expense.topic_type != 1) + { + report.Load(_setting.report_path + "expense.frx"); + report.RegisterData(expenses, "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", + "ค่าใช้สอย" + ".xlsx"); + } + } + + return Ok(); } diff --git a/Models/budget/expense.cs b/Models/budget/expense.cs index e09d2a6..6a76398 100644 --- a/Models/budget/expense.cs +++ b/Models/budget/expense.cs @@ -11,6 +11,7 @@ namespace rmutr_report.Models public decimal? quantity_1 { get; set; } public decimal? quantity_2 { get; set; } public decimal? quantity_3 { get; set; } + public decimal? quantity_4 { get; set; } public decimal? total_amount { get; set; } public List data { get; set; } } @@ -21,6 +22,7 @@ namespace rmutr_report.Models public decimal? quantity_1 { get; set; } public decimal? quantity_2 { get; set; } public decimal? quantity_3 { get; set; } + public decimal? quantity_4 { get; set; } public decimal? total_amount { get; set; } } } \ No newline at end of file diff --git a/Models/budget/national_budget_list.cs b/Models/budget/national_budget_list.cs index 2fd3f05..4248d9f 100644 --- a/Models/budget/national_budget_list.cs +++ b/Models/budget/national_budget_list.cs @@ -16,6 +16,7 @@ namespace rmutr_report.Models public decimal? quantity { get; set; } public string unit { get; set; } public decimal? unit_price { get; set; } + public decimal? quantity_month { get; set; } public decimal? total_amount { get; set; } } diff --git a/bin/Debug/net5.0/rmutr_report.dll b/bin/Debug/net5.0/rmutr_report.dll index 6814f09..1b7cb5a 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 31cfde8..76a2484 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 1aebb18..675f894 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 f38120a..6b1ee85 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 ad692c2..b928750 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 ad692c2..b928750 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 10f994c..39daae7 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+bb28a07de16511483ded679e4bc48870a9fc097f")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [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 92ed1c6..7d63e16 100644 --- a/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -8f5779e7467558ec5cd2c9bc43fb2ffc448a0a50afbcdf6ca1295bb1880e38c2 +f5dfedcaccda50e61bd739707e09ac1f8f1f155f84f01a86842a0ff8ce71abef diff --git a/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache b/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache index 2caf3b6..ea66bd2 100644 --- a/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache +++ b/obj/Debug/net5.0/rmutr_report.RazorTargetAssemblyInfo.cache @@ -1 +1 @@ -cb1b1e2688c6fd94813d4e16c2a00268702cbaa5fa86e9bffd6abee377f2b6a2 +b55a3bbbbff27a49a26b910c544231a92861857b7c6721b0e4530b7ae5f4bd0c diff --git a/obj/Debug/net5.0/rmutr_report.dll b/obj/Debug/net5.0/rmutr_report.dll index 6814f09..1b7cb5a 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 31cfde8..76a2484 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 9aec172..2bd1056 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 @@ -560,6 +560,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\expense.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\expense_allowance.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\expense_allowance.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 8917d82..a59d63a 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 @@ -afb6f617d95b29ee880532b701a9799251d507fdef2496d78da72cd05409100e +75d85b4119ec234a6112d77fb62c7d93d30177a5fb3cf6ef31dda7f6cb8a4c26 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs index 39daae7..9934607 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")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+499df06439627c9b0448e9fb91bf971a44fd6084")] [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 7d63e16..7b90bdf 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -f5dfedcaccda50e61bd739707e09ac1f8f1f155f84f01a86842a0ff8ce71abef +92ed840424dea2842161f135a46baad576f6b1249c089f6d99e6abf606077088 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache index cbe55bb..ea66bd2 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache @@ -1 +1 @@ -e70085a502f543e6f865dcae5f1f26615f0a238b62a14648a1d38a607a23489d +b55a3bbbbff27a49a26b910c544231a92861857b7c6721b0e4530b7ae5f4bd0c diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.AssemblyReference.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.AssemblyReference.cache new file mode 100644 index 0000000..ab463e7 Binary files /dev/null and b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 1aebb18..675f894 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 f38120a..6b1ee85 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 9aec172..07392bd 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 @@ -560,6 +560,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\expense.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\expense_allowance.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\expense_allowance.frx)) + Package rmutr_report @@ -1168,6 +1184,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\national_budget_list.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\national_budget_list_type2.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\national_budget_list_type2.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 8917d82..00a52c0 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 @@ -afb6f617d95b29ee880532b701a9799251d507fdef2496d78da72cd05409100e +0940c1c1a0b8dafd8584f37614446a60332eb78045fff61b1d37512d1601cad0 diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index 81920f2..99b6edc 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -17024426939418254 \ No newline at end of file +17030501016376679 \ No newline at end of file diff --git a/wwwroot/reports/expense_allowance.frx b/wwwroot/reports/expense_allowance.frx new file mode 100644 index 0000000..d58837d --- /dev/null +++ b/wwwroot/reports/expense_allowance.frx @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/national_budget_list_type2.frx b/wwwroot/reports/national_budget_list_type2.frx new file mode 100644 index 0000000..0c031b0 --- /dev/null +++ b/wwwroot/reports/national_budget_list_type2.frx @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +