This commit is contained in:
@@ -27,43 +27,69 @@ namespace rmutr_report.Controllers
|
||||
public IActionResult GetEBudgetingReport([FromRoute] string type, [FromBody] summary_invest summaryInvest)
|
||||
{
|
||||
var summaryInvests = new List<summary_invest>() { summaryInvest };
|
||||
foreach (var summaryInvestYear in summaryInvest.years)
|
||||
if (summaryInvest.total_budget != summaryInvest.unit_price)
|
||||
{
|
||||
summaryInvest.total_budget = summaryInvest.unit_price;
|
||||
}
|
||||
foreach (var summaryInvestYear in summaryInvest.years)
|
||||
{
|
||||
if (summaryInvestYear.total_budget != summaryInvestYear.unit_price)
|
||||
{
|
||||
summaryInvestYear.total_budget = summaryInvestYear.unit_price;
|
||||
}
|
||||
foreach (var plan in summaryInvestYear.plans)
|
||||
{
|
||||
if (plan.total_budget != plan.unit_price)
|
||||
{
|
||||
plan.total_budget = plan.unit_price;
|
||||
}
|
||||
foreach (var project in plan.projects)
|
||||
{
|
||||
if (project.total_budget != project.unit_price)
|
||||
{
|
||||
foreach (var plan in summaryInvestYear.plans)
|
||||
project.total_budget = project.unit_price;
|
||||
}
|
||||
foreach (var faculty in project.facultys)
|
||||
{
|
||||
if (faculty.total_budget != faculty.unit_price)
|
||||
{
|
||||
if (plan.total_budget<=10)
|
||||
faculty.total_budget = faculty.unit_price;
|
||||
}
|
||||
|
||||
foreach (var assetList in faculty.asset_lists)
|
||||
{
|
||||
if (assetList.total != assetList.unit_price)
|
||||
{
|
||||
plan.total_budget = plan.unit_price;
|
||||
assetList.total = assetList.unit_price;
|
||||
}
|
||||
foreach (var project in plan.projects)
|
||||
if (assetList.total == null && assetList.amount == 1)
|
||||
{
|
||||
if (project.total_budget<=10)
|
||||
{
|
||||
project.total_budget = project.unit_price;
|
||||
}
|
||||
foreach (var faculty in project.facultys)
|
||||
{
|
||||
if (faculty.total_budget<=10)
|
||||
{
|
||||
faculty.total_budget = faculty.unit_price;
|
||||
}
|
||||
|
||||
foreach (var assetList in faculty.asset_lists)
|
||||
{
|
||||
if (assetList.total<=10)
|
||||
{
|
||||
assetList.total = assetList.unit_price;
|
||||
}
|
||||
if (assetList.total==null&&assetList.amount==1)
|
||||
{
|
||||
assetList.total = assetList.unit_price;
|
||||
}
|
||||
}
|
||||
}
|
||||
assetList.total = assetList.unit_price;
|
||||
}
|
||||
if (assetList.amount > 1)
|
||||
{
|
||||
assetList.total = assetList.unit_price * assetList.amount;
|
||||
}
|
||||
}
|
||||
// foreach (var constructList in faculty.construct_lists)
|
||||
// {
|
||||
// if (constructList.total != constructList.unit_price)
|
||||
// {
|
||||
// constructList.total = constructList.unit_price;
|
||||
// }
|
||||
// if (constructList.total == null && constructList.amount == 1)
|
||||
// {
|
||||
// constructList.total = constructList.unit_price;
|
||||
// }
|
||||
// if (constructList.amount > 1)
|
||||
// {
|
||||
// constructList.total = constructList.unit_price * constructList.amount;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "summary_invest.frx");
|
||||
report.RegisterData(summaryInvests, "summary_invest");
|
||||
@@ -101,10 +127,22 @@ namespace rmutr_report.Controllers
|
||||
var summaryInvests = new List<summary_invest_v2>() { summaryInvest };
|
||||
if (summaryInvest != null)
|
||||
{
|
||||
if (summaryInvest.total_budget != summaryInvest.unit_price)
|
||||
{
|
||||
summaryInvest.total_budget = summaryInvest.unit_price;
|
||||
}
|
||||
foreach (var summaryInvestYear in summaryInvest.years)
|
||||
{
|
||||
if (summaryInvestYear.total_budget != summaryInvestYear.unit_price)
|
||||
{
|
||||
summaryInvestYear.total_budget = summaryInvestYear.unit_price;
|
||||
}
|
||||
foreach (var plan in summaryInvestYear.plans)
|
||||
{
|
||||
if (plan.total_budget != plan.unit_price)
|
||||
{
|
||||
plan.total_budget = plan.unit_price;
|
||||
}
|
||||
foreach (var assetList in plan.asset_lists)
|
||||
{
|
||||
string formattedSeller = assetList.seller.Replace("<br>", " ");
|
||||
@@ -128,10 +166,19 @@ namespace rmutr_report.Controllers
|
||||
|
||||
formattedFile = formattedFile.Trim();
|
||||
assetList.file2 = formattedFile;
|
||||
|
||||
//Console.WriteLine("seller output: " + formattedSeller);
|
||||
//Console.WriteLine("file output: " + formattedFile);
|
||||
}
|
||||
if (assetList.total != assetList.unit_price)
|
||||
{
|
||||
assetList.total = assetList.unit_price;
|
||||
}
|
||||
if (assetList.total == null && assetList.amount == 1)
|
||||
{
|
||||
assetList.total = assetList.unit_price;
|
||||
}
|
||||
if (assetList.amount > 1)
|
||||
{
|
||||
assetList.total = assetList.unit_price * assetList.amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user