This commit is contained in:
@@ -1197,6 +1197,64 @@ namespace rmutr_report.Controllers
|
|||||||
"compensation_ro_three" + ".xlsx");
|
"compensation_ro_three" + ".xlsx");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
[SwaggerOperation("เงินสมทบกองทุนประกันสังคม_เงินสมทบกองทุนเงินทดแทน")]
|
||||||
|
[HttpPost, Route("reports/contributions/{type}")]
|
||||||
|
[ApiExplorerSettings(GroupName = "reports")]
|
||||||
|
public IActionResult GetContributionsReport([FromRoute] string type,
|
||||||
|
[FromBody] contributions contributions)
|
||||||
|
{
|
||||||
|
var compensation = contributions.data.ToList();
|
||||||
|
if (contributions.topic_type == 1)
|
||||||
|
{
|
||||||
|
contributions.topic_name = "เงินสมทบกองทุนประกันสังคม";
|
||||||
|
foreach (var detail in contributions.data)
|
||||||
|
{
|
||||||
|
detail.amount = (detail.salary * 5)/100;
|
||||||
|
detail.per_year = (detail.amount * 12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (contributions.topic_type == 2)
|
||||||
|
{
|
||||||
|
contributions.topic_name = "เงินสมทบกองทุนเงินทดแทน";
|
||||||
|
foreach (var detail in contributions.data)
|
||||||
|
{
|
||||||
|
detail.amount = (detail.salary * (decimal?)0.2)/100;
|
||||||
|
detail.per_year = (detail.amount * 12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
contributions.total_amount = compensation.Sum(f => f.per_year);
|
||||||
|
|
||||||
|
var _contributions = new List<contributions>() { contributions };
|
||||||
|
Report report = new Report();
|
||||||
|
report.Load(_setting.report_path + "contributions.frx");
|
||||||
|
report.RegisterData(_contributions, "contributions");
|
||||||
|
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",
|
||||||
|
"contributions" + ".xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
Models/RoReport/contributions.cs
Normal file
22
Models/RoReport/contributions.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace rmutr_report.Models.RoThree
|
||||||
|
{
|
||||||
|
public class contributions
|
||||||
|
{
|
||||||
|
public int? topic_type { get; set; } //1 2
|
||||||
|
public string topic_name { get; set; }
|
||||||
|
public decimal? total_amount { get; set; }
|
||||||
|
|
||||||
|
public List<contributions_detail> data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class contributions_detail
|
||||||
|
{
|
||||||
|
public string position { get; set; }
|
||||||
|
public string qualification { get; set; }
|
||||||
|
public decimal? salary { get; set; }
|
||||||
|
public decimal? amount { get; set; }
|
||||||
|
public decimal? per_year { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
38a9d07017ef8cf4da24333a91be9dc5a1c91c4d
|
04ffabe9d09db3eaf66c7e59e1b69ef6220d980e
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -320,6 +320,22 @@
|
|||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
<OriginalItemSpec>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\compensation_ro_three.frx))</OriginalItemSpec>
|
<OriginalItemSpec>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\compensation_ro_three.frx))</OriginalItemSpec>
|
||||||
</StaticWebAsset>
|
</StaticWebAsset>
|
||||||
|
<StaticWebAsset Include="$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\contributions.frx))">
|
||||||
|
<SourceType>Package</SourceType>
|
||||||
|
<SourceId>rmutr_report</SourceId>
|
||||||
|
<ContentRoot>$(MSBuildThisFileDirectory)..\staticwebassets\</ContentRoot>
|
||||||
|
<BasePath>_content/rmutr_report</BasePath>
|
||||||
|
<RelativePath>reports\contributions.frx</RelativePath>
|
||||||
|
<AssetKind></AssetKind>
|
||||||
|
<AssetMode></AssetMode>
|
||||||
|
<AssetRole></AssetRole>
|
||||||
|
<RelatedAsset></RelatedAsset>
|
||||||
|
<AssetTraitName></AssetTraitName>
|
||||||
|
<AssetTraitValue></AssetTraitValue>
|
||||||
|
<CopyToOutputDirectory></CopyToOutputDirectory>
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
<OriginalItemSpec>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\contributions.frx))</OriginalItemSpec>
|
||||||
|
</StaticWebAsset>
|
||||||
<StaticWebAsset Include="$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\data_line_academic.frx))">
|
<StaticWebAsset Include="$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\data_line_academic.frx))">
|
||||||
<SourceType>Package</SourceType>
|
<SourceType>Package</SourceType>
|
||||||
<SourceId>rmutr_report</SourceId>
|
<SourceId>rmutr_report</SourceId>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
27b0df10d71791bb35e369c161be6ce323153ef6
|
645f8f19f3f7269784e8db7e853e5c6df8c222f9
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
16983221242759201
|
16992484278328616
|
||||||
@@ -1 +1 @@
|
|||||||
16992484278328616
|
16992659798608142
|
||||||
76
wwwroot/reports/contributions.frx
Normal file
76
wwwroot/reports/contributions.frx
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Report ScriptLanguage="CSharp" ReportInfo.Created="09/14/2021 15:20:39" ReportInfo.Modified="11/06/2023 16:50:54" ReportInfo.CreatorVersion="2021.1.0.0">
|
||||||
|
<Dictionary>
|
||||||
|
<BusinessObjectDataSource Name="contributions" ReferenceName="contributions" DataType="null" Enabled="true">
|
||||||
|
<Column Name="topic_type" DataType="System.Int32"/>
|
||||||
|
<Column Name="topic_name" DataType="System.String"/>
|
||||||
|
<Column Name="total_amount" DataType="System.Decimal"/>
|
||||||
|
<BusinessObjectDataSource Name="data" DataType="null" Enabled="true">
|
||||||
|
<Column Name="position" DataType="System.String"/>
|
||||||
|
<Column Name="qualification" DataType="System.String"/>
|
||||||
|
<Column Name="salary" DataType="System.Decimal"/>
|
||||||
|
<Column Name="amount" DataType="System.Decimal"/>
|
||||||
|
<Column Name="per_year" DataType="System.Decimal"/>
|
||||||
|
</BusinessObjectDataSource>
|
||||||
|
</BusinessObjectDataSource>
|
||||||
|
</Dictionary>
|
||||||
|
<ReportPage Name="Page1" Landscape="true" PaperWidth="360" PaperHeight="1500" Watermark.Font="Arial, 60pt">
|
||||||
|
<PageHeaderBand Name="PageHeader1" Width="1285.2" Height="75.6">
|
||||||
|
<TextObject Name="Text40" Width="1285.2" Height="37.8" Text="[contributions.topic_name]" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableObject Name="Table14" Top="37.8" Width="1285.2" Height="37.8" Border.Lines="All">
|
||||||
|
<TableColumn Name="Column70"/>
|
||||||
|
<TableColumn Name="Column92" Width="274.05"/>
|
||||||
|
<TableColumn Name="Column93" Width="378"/>
|
||||||
|
<TableColumn Name="Column94" Width="179.55"/>
|
||||||
|
<TableColumn Name="Column95" Width="170.1"/>
|
||||||
|
<TableColumn Name="Column96" Width="217.35"/>
|
||||||
|
<TableRow Name="Row14" Height="37.8">
|
||||||
|
<TableCell Name="Cell110" Border.Lines="All" Text="ลำดับ" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell152" Border.Lines="All" Text="ตำแหน่ง" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell153" Border.Lines="All" Text="วุฒิ" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell154" Border.Lines="All" Text="เงินเดือน" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell155" Border.Lines="All" Text="จำนวนเงิน" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell156" Border.Lines="All" Text="จำนวนเงินต่อปี" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
</TableRow>
|
||||||
|
</TableObject>
|
||||||
|
</PageHeaderBand>
|
||||||
|
<DataBand Name="Data1" Top="80.79" Width="1285.2">
|
||||||
|
<DataBand Name="Data2" Top="85.99" Width="1285.2" Height="37.8" DataSource="data">
|
||||||
|
<TableObject Name="Table17" Width="1285.2" Height="37.8" Border.Lines="All">
|
||||||
|
<TableColumn Name="Column131"/>
|
||||||
|
<TableColumn Name="Column132" Width="274.05"/>
|
||||||
|
<TableColumn Name="Column133" Width="378"/>
|
||||||
|
<TableColumn Name="Column134" Width="179.55"/>
|
||||||
|
<TableColumn Name="Column135" Width="170.1"/>
|
||||||
|
<TableColumn Name="Column136" Width="217.35"/>
|
||||||
|
<TableRow Name="Row17" Height="37.8">
|
||||||
|
<TableCell Name="Cell191" Border.Lines="All" Text="[Row#]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" AutoShrink="FontSize" AutoShrinkMinSize="10" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
|
||||||
|
<TableCell Name="Cell192" Border.Lines="All" Text="[contributions.data.position]" Format="Custom" Format.Format="G" AutoShrink="FontSize" AutoShrinkMinSize="11" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
|
||||||
|
<TableCell Name="Cell193" Border.Lines="All" Text="[contributions.data.qualification]" Format="Custom" Format.Format="G" AutoShrink="FontSize" AutoShrinkMinSize="11" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
|
||||||
|
<TableCell Name="Cell194" Border.Lines="All" Text="[contributions.data.salary]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="2" AutoShrink="FontSize" AutoShrinkMinSize="10" HorzAlign="Right" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
|
||||||
|
<TableCell Name="Cell195" Border.Lines="All" Text="[contributions.data.amount]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="2" AutoShrink="FontSize" AutoShrinkMinSize="10" HorzAlign="Right" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
|
||||||
|
<TableCell Name="Cell196" Border.Lines="All" Text="[contributions.data.per_year]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="2" AutoShrink="FontSize" AutoShrinkMinSize="10" HorzAlign="Right" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
|
||||||
|
</TableRow>
|
||||||
|
</TableObject>
|
||||||
|
</DataBand>
|
||||||
|
</DataBand>
|
||||||
|
<ReportSummaryBand Name="ReportSummary1" Top="128.98" Width="1285.2" Height="47.25">
|
||||||
|
<TableObject Name="Table18" Width="1285.2" Height="47.25" Border.Lines="All">
|
||||||
|
<TableColumn Name="Column137"/>
|
||||||
|
<TableColumn Name="Column138" Width="274.05"/>
|
||||||
|
<TableColumn Name="Column139" Width="378"/>
|
||||||
|
<TableColumn Name="Column140" Width="179.55"/>
|
||||||
|
<TableColumn Name="Column141" Width="170.1"/>
|
||||||
|
<TableColumn Name="Column142" Width="217.35"/>
|
||||||
|
<TableRow Name="Row18" Height="47.25">
|
||||||
|
<TableCell Name="Cell197" Border.Lines="Bottom" Text="รวมทั้งสิ้น" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" AutoShrink="FontSize" AutoShrinkMinSize="10" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold" ColSpan="5"/>
|
||||||
|
<TableCell Name="Cell198" Border.Lines="All" AutoShrink="FontSize" AutoShrinkMinSize="10" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell199" Border.Lines="All" AutoShrink="FontSize" AutoShrinkMinSize="10" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell200" Border.Lines="All" AutoShrink="FontSize" AutoShrinkMinSize="10" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell201" Border.Lines="Left, Right, Bottom" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" AutoShrink="FontSize" AutoShrinkMinSize="10" HorzAlign="Right" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
<TableCell Name="Cell202" Border.Lines="Left, Bottom" Text="[contributions.total_amount]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="2" AutoShrink="FontSize" AutoShrinkMinSize="10" HorzAlign="Right" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||||
|
</TableRow>
|
||||||
|
</TableObject>
|
||||||
|
</ReportSummaryBand>
|
||||||
|
</ReportPage>
|
||||||
|
</Report>
|
||||||
Reference in New Issue
Block a user