add ค่าควบคุมงานก่อสร้าง
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2023-11-17 10:52:31 +07:00
parent af9a9c8af5
commit 79269514ba
12 changed files with 145 additions and 6 deletions

View File

@@ -1022,10 +1022,11 @@ namespace rmutr_report.Controllers
{
detail.total_amount = (detail.amount + detail.car_act);
}
switch (detail.month)
{
case 1:
detail.month_th = "มกราคม";
detail.month_th = "มกราคม";
break;
case 2:
detail.month_th = "กุมภาพันธ์";
@@ -1061,7 +1062,6 @@ namespace rmutr_report.Controllers
detail.month_th = "ธันวาคม";
break;
}
}
var _insurances = new List<budget_progress_insurances>() { insurances };
@@ -1382,5 +1382,55 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("ค่าควบคุมงานก่อสร้าง")]
[HttpPost, Route("reports/control_cost_construction/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetConstructionReport([FromRoute] string type,
[FromBody] control_cost_construction _expense)
{
if (_expense.topic_type == 1)
{
_expense.topic = "ค่าควบคุมงานก่อสร้าง (หัวหน้าควบคุมงานก่อสร้าง)";
}
if (_expense.topic_type == 2)
{
_expense.topic = "ค่าควบคุมงานก่อสร้าง (ผู้ปฏิบัติการ)";
}
foreach (var detail in _expense.data)
{
detail.total_amount = (detail.quantity_day * detail.quantity_person * detail.amount);
}
var expenses = new List<control_cost_construction>() { _expense };
Report report = new Report();
report.Load(_setting.report_path + "control_cost_construction.frx");
report.RegisterData(expenses, "control_cost_construction");
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();
}
}
}

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
namespace rmutr_report.Models
{
public class control_cost_construction
{
public int? topic_type { get; set; }
public string topic { get; set; }
public List<control_cost_construction_detail> data { get; set; }
}
public class control_cost_construction_detail
{
public decimal? quantity_day { get; set; }
public decimal? quantity_person { get; set; }
public decimal? amount { get; set; }
public decimal? quantity_work { get; set; }
public decimal? total_amount { get; set; }
}
}

View File

@@ -1 +1 @@
04ffabe9d09db3eaf66c7e59e1b69ef6220d980e
9cfeedd89b72b1f5267ec4e7959ae277c719f5c6

View File

@@ -336,6 +336,22 @@
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<OriginalItemSpec>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\contributions.frx))</OriginalItemSpec>
</StaticWebAsset>
<StaticWebAsset Include="$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\control_cost_construction.frx))">
<SourceType>Package</SourceType>
<SourceId>rmutr_report</SourceId>
<ContentRoot>$(MSBuildThisFileDirectory)..\staticwebassets\</ContentRoot>
<BasePath>_content/rmutr_report</BasePath>
<RelativePath>reports\control_cost_construction.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\control_cost_construction.frx))</OriginalItemSpec>
</StaticWebAsset>
<StaticWebAsset Include="$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\data_line_academic.frx))">
<SourceType>Package</SourceType>
<SourceId>rmutr_report</SourceId>

View File

@@ -1 +1 @@
9fdb36bdc21e43e3de61118b3e5b09a1b8490e9e
29054d1f7148e9432a37c4b95d7e6c92af540091

View File

@@ -1 +1 @@
17001217270031729
17001321833144528

View File

@@ -1 +1 @@
17001321833144528
17001930966561955

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/13/2021 00:11:35" ReportInfo.Modified="11/17/2023 10:47:04" ReportInfo.CreatorVersion="2021.1.0.0">
<Dictionary>
<BusinessObjectDataSource Name="control_cost_construction" ReferenceName="control_cost_construction" DataType="null" Enabled="true">
<Column Name="topic_type" DataType="System.Int32"/>
<Column Name="topic" DataType="System.String"/>
<BusinessObjectDataSource Name="data" DataType="null" Enabled="true">
<Column Name="quantity_day" DataType="System.Decimal"/>
<Column Name="quantity_person" DataType="System.Decimal"/>
<Column Name="amount" DataType="System.Decimal"/>
<Column Name="quantity_work" DataType="System.Decimal"/>
<Column Name="total_amount" DataType="System.Decimal"/>
</BusinessObjectDataSource>
</BusinessObjectDataSource>
</Dictionary>
<ReportPage Name="Sheet1" Landscape="true" PaperWidth="297" PaperHeight="210" RawPaperSize="9" Watermark.Font="Arial, 60pt">
<PageHeaderBand Name="PageHeader1" Width="1047.06" Height="85.05">
<TextObject Name="Text1" Width="737.1" Height="37.8" Text="[control_cost_construction.topic]" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
<TableObject Name="Table1" Top="37.8" Width="737.14" Height="47.25">
<TableColumn Name="Column1" Width="160.67"/>
<TableColumn Name="Column2" Width="141.77"/>
<TableColumn Name="Column3" Width="141.75"/>
<TableColumn Name="Column4" Width="141.75"/>
<TableColumn Name="Column19" Width="151.2"/>
<TableRow Name="Row1" Height="47.25">
<TableCell Name="Cell1" Border.Lines="All" Fill.Color="214, 220, 228" Text="จำนวนวันก่อสร้าง" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
<TableCell Name="Cell2" Border.Lines="All" Fill.Color="214, 220, 228" Text="จำนวนคน" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
<TableCell Name="Cell3" Border.Lines="All" Fill.Color="214, 220, 228" Text="จำนวนเงิน" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
<TableCell Name="Cell4" Border.Lines="All" Fill.Color="214, 220, 228" Text="จำนวนงาน" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
<TableCell Name="Cell19" Border.Lines="All" Fill.Color="214, 220, 228" Text="จำนวนเงินรวม" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt, style=Bold"/>
</TableRow>
</TableObject>
</PageHeaderBand>
<DataBand Name="Data1" Top="90.24" Width="1047.06">
<DataBand Name="Data3" Top="95.44" Width="1047.06" Height="37.8" DataSource="data">
<TableObject Name="Table2" Width="737.14" Height="37.8">
<TableColumn Name="Column15" Width="160.67"/>
<TableColumn Name="Column16" Width="141.77"/>
<TableColumn Name="Column17" Width="141.75"/>
<TableColumn Name="Column18" Width="141.75"/>
<TableColumn Name="Column21" Width="151.2"/>
<TableRow Name="Row2" Height="37.8">
<TableCell Name="Cell15" Border.Lines="All" Text="[control_cost_construction.data.quantity_day]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
<TableCell Name="Cell16" Border.Lines="All" Text="[control_cost_construction.data.quantity_person]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" AutoShrinkMinSize="12" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
<TableCell Name="Cell17" Border.Lines="All" Text="[control_cost_construction.data.amount]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" AutoShrinkMinSize="11" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
<TableCell Name="Cell18" Border.Lines="All" Text="[control_cost_construction.data.quantity_work]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" AutoShrinkMinSize="9" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
<TableCell Name="Cell21" Border.Lines="All" Text="[control_cost_construction.data.total_amount]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH SarabunPSK, 16pt"/>
</TableRow>
</TableObject>
</DataBand>
</DataBand>
</ReportPage>
</Report>