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();
}
}
}