bug fixed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2023-11-23 17:12:25 +07:00
parent 3a2f956d02
commit 5ba7919b29
16 changed files with 836 additions and 472 deletions

View File

@@ -1235,6 +1235,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("2ค่าตอบแทนผู้ปฏิบัติงานให้ราชการ_6 7 8")]
[HttpPost, Route("reports/consultant_compensation/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
@@ -1243,36 +1244,41 @@ namespace rmutr_report.Controllers
{
var types = compensation.data.ToList();
if (compensation.topic_type==1)
if (compensation.topic_type == 1)
{
compensation.topic_name = "ค่าตอบแทนที่ปรึกษา";
}
if (compensation.topic_type==2)
if (compensation.topic_type == 2)
{
compensation.topic_name = "ค่าตอบแทนเหมาจ่ายจัดหารถประจำตำแหน่ง";
}
if (compensation.topic_type==3)
if (compensation.topic_type == 3)
{
compensation.topic_name = "ค่าตอบแทนอื่น ๆ";
}
if (compensation.topic_type==4)
if (compensation.topic_type == 4)
{
compensation.topic_name = "ค่าคณะกรรมการตรวจการจ้าง";
}
if (compensation.topic_type==5)
if (compensation.topic_type == 5)
{
compensation.topic_name = "ค่าคณะกรรมการตรวจรับพัสดุ";
}
if (compensation.topic_type==6)
if (compensation.topic_type == 6)
{
compensation.topic_name = "ค่าคณะกรรมการกำหนดราคากลาง";
}
foreach (var detail in compensation.data)
{
detail.total_amount = detail.quantity_day * detail.quantity_person * detail.rate;
}
compensation.total_amount = types.Sum(d => d.total_amount);
var compensations = new List<consultant_compensation>() { compensation };
Report report = new Report();
@@ -1344,33 +1350,67 @@ namespace rmutr_report.Controllers
public IActionResult GetCalReport([FromRoute] string type,
[FromBody] calculate_meeting_expenses calculate)
{
if (calculate.topic_type==1)
var c = calculate.data.ToList();
if (calculate.topic_type == 1)
{
calculate.text1 = "ค่าใช้สอย : ค่าอาหารว่าง และค่าอาหารกลางวันในการประชุม";
calculate.text2 = "ผลการเบิกจ่าย ค่าอาหารว่าง\nและค่าอาหารกลางวันเบิกจ่ายจริง";
calculate.text3 = "อัตราค่าใช้จ่ายค่าอาหารว่าง\nและค่าอาหารกลางวัน";
calculate.text4 = "รวมค่าอาหารว่างและค่าอาหารกลางวัน";
}
if (calculate.topic_type==2)
if (calculate.topic_type == 2)
{
calculate.text1 = "ค่าตอบแทน : ค่าเบี้ยประชุมคณะกรรมการ";
calculate.text2 = "ผลการเบิกจ่าย ค่าเบี้ยประชุมเบิกจ่ายจริง";
calculate.text3 = "อัตราค่าเบี้ยประชุม";
calculate.text4 = "รวมค่าเบี้ยประชุม";
}
//var newlist = new List<calculate_meeting_expenses>() { };
//var newlist2 = newlist.SelectMany(newlist => newlist.data);
int n = 1;
foreach (var data in calculate.data)
foreach (var data in calculate.data)
{
if (data.topic_type==1)
if (data.topic_type == 1)
{
data.row_no = null;
data.no = n.ToString();
n++;
}
}
if (data.topic_type == 2)
{
data.total = data.expense_rate * data.count_person * data.count_meetings;
}
}
calculate.disbursement_result = c.Where(e => e.topic_type == 1).Sum(d => d.disbursement_result);
calculate.expense_rate = c.Where(e => e.topic_type == 1).Sum(d => d.expense_rate);
calculate.count_person = c.Where(e => e.topic_type == 1).Sum(d => d.count_person);
calculate.count_meetings = c.Where(e => e.topic_type == 1).Sum(d => d.count_meetings);
calculate.total = c.Where(e => e.topic_type == 1).Sum(d => d.total);
var calculateMeeting = new List<calculate_meeting_expenses>() { calculate };
// calculate.data.Add(new calculate_meeting_expenses_data_datail()
// {
// topic_type = 1,
// disbursement_result = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2)
// .Sum(c => c.disbursement_result),
// count_person = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2)
// .Sum(c => c.count_person)
// });
// foreach (var cc in c)
// {
// if (cc.topic_type==1)
// {
// cc.disbursement_result = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2)
// .Sum(c => c.disbursement_result);
// cc.count_person = calculateMeeting.SelectMany(d => d.data).Where(t => t.topic_type == 2)
// .Sum(c => c.count_person);
// }
//
// }
Report report = new Report();
report.Load(_setting.report_path + "calculate_meeting_expenses.frx");
report.RegisterData(calculateMeeting, "calculate_meeting_expenses");