Bug Fixed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2024-08-23 20:13:50 +07:00
parent a58f124c5e
commit 9f3a5950c6
20 changed files with 114 additions and 42 deletions

View File

@@ -2692,16 +2692,24 @@ namespace rmutr_report.Controllers
[FromBody] budget_expenditure_report_from_revenue_v2 budget)
{
int no1 = 1;
int no2 = 1;
int no3 = 1;
int no4 = 1;
int no2 = 0;
int no3 = 0;
int no4 = 0;
int no5 = 1;
int no6 = 1;
int no6 = 0;
int no7 = 1;
int no8 = 1;
var detail = budget.details.ToArray();
foreach (var indetail in detail)
int no8 = 0;
int no9 = 0;
int no10 = 1;
bool numberingtype10 = false;
bool startNumbering = false;
bool startNumbering2 = false;
bool startNumbering3 = false;
bool startNumbering4 = false;
bool startNumbering5 = false;
foreach (var indetail in budget.details)
{
if (indetail.topic_type==1)
{
indetail.topic1 = indetail.topic;
@@ -2735,9 +2743,11 @@ namespace rmutr_report.Controllers
indetail.text6 = "บาท";
indetail.row_no1 = no1;
no1++;
startNumbering = true;
no2 = 1;
}
if (indetail.topic_type==5)
if (startNumbering && indetail.topic_type==5)
{
indetail.topic5 = indetail.topic;
indetail.amount7 = indetail.value1;
@@ -2745,10 +2755,12 @@ namespace rmutr_report.Controllers
indetail.text7 = "อัตรา";
indetail.text8 = "บาท";
indetail.row_no2 = no2;
no2++;
no2++;
startNumbering2 = true;
no3 = 1;
}
if (indetail.topic_type==6)
if (startNumbering2 &&indetail.topic_type==6)
{
indetail.topic9 = indetail.topic;
indetail.topic10 = indetail.qualification;
@@ -2759,15 +2771,7 @@ namespace rmutr_report.Controllers
indetail.row_no3 = no3;
no3++;
}
if (indetail.topic_type==7)
{
indetail.topic11 = indetail.topic;
indetail.amount11 = indetail.value1;
indetail.text11 = "บาท";
indetail.row_no4 = no4;
no4++;
}
if (indetail.topic_type==8)
if (indetail.topic_type==8)
{
indetail.topic12 = indetail.topic;
indetail.amount12 = indetail.value1;
@@ -2783,9 +2787,10 @@ namespace rmutr_report.Controllers
indetail.text15 = "หน่วยนับ";
indetail.text16 = "ราคาต่อหน่วย";
indetail.text17 = "รวมเงิน";
numberingtype10 = true;
no6 = 1;
}
if (indetail.topic_type==10)
if (numberingtype10&&indetail.topic_type==10)//
{
indetail.topic13 = indetail.topic;
indetail.amount13 = indetail.value1;
@@ -2802,7 +2807,10 @@ namespace rmutr_report.Controllers
indetail.topic14 = indetail.topic;
indetail.amount16 = indetail.value2;
indetail.text20 = "บาท";
//indetail.row_no1 = no1;
//no1++;
//startNumbering3 = true;
//no8 = 1;
}
if (indetail.topic_type==12)
{
@@ -2812,24 +2820,66 @@ namespace rmutr_report.Controllers
indetail.text22 = ".";
indetail.row_no7 = no7;
no7++;
}
if (indetail.topic_type==13)
if (indetail.topic_type==13)//
{
indetail.topic16 = indetail.topic;
indetail.amount18 = indetail.value2;
indetail.text23 = "บาท";
startNumbering3 = true;
no8 = 1;
}
// if (indetail.topic_type==13&&indetail.topic!="ค่าตอบแทน ค่าใช้สอยและค่าวัสดุ"&&indetail.topic!="ค่าใช้จ่ายดำเนินงาน")//
if (indetail.topic_type==13&&indetail.topic=="เงินอุดหนุน ค่าใช้จ่ายโครงการ")
{
indetail.row_no10 = 1;
}
if (indetail.topic_type==13&&indetail.topic=="ค่าครุภัณฑ์")
{
indetail.row_no10 = 1;
}
if (indetail.topic_type==14)
if (indetail.topic_type==13&&indetail.topic=="ค่าที่ดินและสิ่งก่อสร้าง")
{
indetail.row_no10 = 2;
}
if (startNumbering3&&indetail.topic_type==14)//
{
indetail.topic17 = indetail.topic;
indetail.amount19 = indetail.value2;
indetail.text24 = "บาท";
indetail.row_no8 = no8;
no8++;
indetail.row_no8 = no8;
no8++;
startNumbering4 = true;
no4 = 1;
}
if (startNumbering4 &&indetail.topic_type==7&&indetail.is_other!=true)//
{
indetail.topic11 = indetail.topic;
indetail.amount11 = indetail.value1;
indetail.text11 = "บาท";
indetail.row_no4 = no4;
no4++;
startNumbering5 = true;
no9 = 1;
}
if (startNumbering5&&indetail.topic_type==7&&indetail.is_other==true)
{
indetail.topic18 = indetail.topic;
indetail.amount20 = indetail.value1;
indetail.text25 = "บาท";
indetail.text26 = ".";
indetail.row_no9 = no9;
no9++;
}
}
int academic_year_name_th = Convert.ToInt32(budget.academic_year_name_th);
budget.academic_year_1 = (academic_year_name_th-1).ToString();
budget.academic_year_2 = academic_year_name_th.ToString();
var sum1 = budget.details.Where(f=>f.topic_type==1).Sum(d => d.value1);
var sum2 = budget.details.Where(f=>f.topic_type==2&&f.topic == "รายการบุคลากร").Sum(d => d.value2);
budget.total = sum1+sum2;