報表查詢-日月年區間報表顯示: 全部數值都取至小數點兩位;報表匯出的檔案名稱改為公司名字
This commit is contained in:
parent
7918505b80
commit
bf09f05433
@ -976,7 +976,10 @@ namespace SolarPower.Controllers
|
|||||||
{
|
{
|
||||||
AllowClose = false
|
AllowClose = false
|
||||||
};
|
};
|
||||||
string companyName = postObject.PowerStation[0].Name;
|
|
||||||
|
int powerStationId = int.Parse(postObject.PowerStation[0].Value);
|
||||||
|
var getCompany = stationReportRepository.GetCompanyNameByPowerStationId(powerStationId);
|
||||||
|
string companyName = getCompany.Result;
|
||||||
workbook.Write(ms);
|
workbook.Write(ms);
|
||||||
ms.Flush();
|
ms.Flush();
|
||||||
ms.Seek(0, SeekOrigin.Begin);
|
ms.Seek(0, SeekOrigin.Begin);
|
||||||
@ -1591,7 +1594,9 @@ namespace SolarPower.Controllers
|
|||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename));
|
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename));
|
||||||
}
|
}
|
||||||
string companyName = postObject.PowerStation[0].Name;
|
int powerStationId = int.Parse(postObject.PowerStation[0].Value);
|
||||||
|
var getCompany = stationReportRepository.GetCompanyNameByPowerStationId(powerStationId);
|
||||||
|
string companyName = getCompany.Result;
|
||||||
var n = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename, companyName + "_" + name + "報表" + "_" + postObject.Userid + Datename + ".xlsx");
|
var n = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename, companyName + "_" + name + "報表" + "_" + postObject.Userid + Datename + ".xlsx");
|
||||||
FileStream FS = new FileStream(n, FileMode.Create, FileAccess.Write);
|
FileStream FS = new FileStream(n, FileMode.Create, FileAccess.Write);
|
||||||
workbook.Write(FS);
|
workbook.Write(FS);
|
||||||
@ -2017,7 +2022,9 @@ namespace SolarPower.Controllers
|
|||||||
{
|
{
|
||||||
AllowClose = false
|
AllowClose = false
|
||||||
};
|
};
|
||||||
string companyName = postObject.PowerStation[0].Name;
|
int powerStationId = int.Parse(postObject.PowerStation[0].Value);
|
||||||
|
var getCompany = stationReportRepository.GetCompanyNameByPowerStationId(powerStationId);
|
||||||
|
string companyName = getCompany.Result;
|
||||||
workbook.Write(ms);
|
workbook.Write(ms);
|
||||||
ms.Flush();
|
ms.Flush();
|
||||||
ms.Seek(0, SeekOrigin.Begin);
|
ms.Seek(0, SeekOrigin.Begin);
|
||||||
@ -2428,7 +2435,9 @@ namespace SolarPower.Controllers
|
|||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename));
|
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename));
|
||||||
}
|
}
|
||||||
string companyName = postObject.PowerStation[0].Name;
|
int powerStationId = int.Parse(postObject.PowerStation[0].Value);
|
||||||
|
var getCompany = stationReportRepository.GetCompanyNameByPowerStationId(powerStationId);
|
||||||
|
string companyName = getCompany.Result;
|
||||||
var n = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename, companyName + "_" + "綜合比較" + "_" + postObject.Userid + Datename + ".xlsx");
|
var n = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "report", Datename, companyName + "_" + "綜合比較" + "_" + postObject.Userid + Datename + ".xlsx");
|
||||||
FileStream FS = new FileStream(n, FileMode.Create, FileAccess.Write);
|
FileStream FS = new FileStream(n, FileMode.Create, FileAccess.Write);
|
||||||
workbook.Write(FS);
|
workbook.Write(FS);
|
||||||
|
|||||||
@ -315,12 +315,24 @@ namespace SolarPower.Repository.Implement
|
|||||||
// EXECUTE stmt;
|
// EXECUTE stmt;
|
||||||
// DEALLOCATE PREPARE stmt;";
|
// DEALLOCATE PREPARE stmt;";
|
||||||
#endregion
|
#endregion
|
||||||
|
DateTime firstDay = new DateTime(int.Parse(post.Time), 01, 01);
|
||||||
|
DateTime lastDay;
|
||||||
|
if (DateTime.Now.Year == int.Parse(post.Time))
|
||||||
|
{
|
||||||
|
lastDay = DateTime.Now.Date;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastDay = new DateTime(int.Parse(post.Time), 12, 31);
|
||||||
|
}
|
||||||
|
string days = (lastDay - firstDay).TotalDays.ToString();
|
||||||
|
|
||||||
sql = @$" DROP TABLE IF EXISTS temp_inv;
|
sql = @$" DROP TABLE IF EXISTS temp_inv;
|
||||||
create TEMPORARY TABLE temp_inv as
|
create TEMPORARY TABLE temp_inv as
|
||||||
SELECT DATE_FORMAT(a.report_date,'%Y/%m') report_date, {inv}
|
SELECT DATE_FORMAT(a.report_date,'%Y/%m') report_date, {inv}
|
||||||
b.todayKWH 'dayKWH', round((b.todayKWH / c.monthKWH)*100,2) 'dayKWHp', b.SOLARHOUR 'tothour', b.KWHKWP 'KWHKWP', b.PR,z.GeneratingCapacity,
|
b.todayKWH 'dayKWH', round((b.todayKWH / c.monthKWH)*100,2) 'dayKWHp', b.SOLARHOUR 'tothour', b.KWHKWP 'KWHKWP', b.PR,z.GeneratingCapacity,
|
||||||
d.irradiance 'irradiance', d.Temperature 'temperature', b.money 'soldmoney',
|
d.irradiance 'irradiance', d.Temperature 'temperature', b.money 'soldmoney',
|
||||||
c.monthKWH 'monthKWH', c.money 'monthmoney', stationName, powerRate 'monthmoneyone',SolarType,SiteDB, d.IrrDay
|
c.monthKWH 'monthKWH', c.money 'monthmoney', stationName, powerRate 'monthmoneyone',SolarType,SiteDB, d.IrrDay, {days} Days
|
||||||
FROM report_invday a left join
|
FROM report_invday a left join
|
||||||
( # 每日加總 inv
|
( # 每日加總 inv
|
||||||
select powerStationid, DATE_FORMAT(TIMESTAMP,'%Y-%m') report_date, siteid, sitetype,
|
select powerStationid, DATE_FORMAT(TIMESTAMP,'%Y-%m') report_date, siteid, sitetype,
|
||||||
@ -358,7 +370,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
SELECT '總計' report_date, {inv}
|
SELECT '總計' report_date, {inv}
|
||||||
round(sum(dayKWH), 2) dayKWH, round(sum(dayKWHp), 2) dayKWHp, round(max(tothour), 2) tothour, avg(KWHKWP) KWHKWP, round(avg(PR), 2) PR,
|
round(sum(dayKWH), 2) dayKWH, round(sum(dayKWHp), 2) dayKWHp, round(max(tothour), 2) tothour, avg(KWHKWP) KWHKWP, round(avg(PR), 2) PR,
|
||||||
GeneratingCapacity, round(sum(irradiance), 2) irradiance, avg(temperature) temperature, round(sum(soldmoney), 2) soldmoney,
|
GeneratingCapacity, round(sum(irradiance), 2) irradiance, avg(temperature) temperature, round(sum(soldmoney), 2) soldmoney,
|
||||||
round(monthKWH, 2) monthKWH, monthmoney, stationName, monthmoneyone, SolarType, SiteDB, IrrDay
|
round(monthKWH, 2) monthKWH, monthmoney, stationName, monthmoneyone, SolarType, SiteDB, IrrDay, 0
|
||||||
from temp_inv2 a; ";
|
from temp_inv2 a; ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -805,5 +817,35 @@ namespace SolarPower.Repository.Implement
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<string> GetCompanyNameByPowerStationId(int powerStationId)
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
using (IDbConnection conn = _databaseHelper.GetConnection())
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var sql = @$"SELECT c.Name
|
||||||
|
FROM power_station ps
|
||||||
|
LEFT JOIN company c ON ps.CompanyId = c.id
|
||||||
|
WHERE ps.id = {powerStationId} AND ps.Deleted = 0";
|
||||||
|
|
||||||
|
result = await conn.QueryFirstOrDefaultAsync<string>(sql);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,5 +14,6 @@ namespace SolarPower.Repository.Interface
|
|||||||
Task<List<MaxFormbody>> GetMaxtablebody(Select_table2 post);
|
Task<List<MaxFormbody>> GetMaxtablebody(Select_table2 post);
|
||||||
Task<dynamic> Findhaveinv(Select_table post);
|
Task<dynamic> Findhaveinv(Select_table post);
|
||||||
Task<int> CheckExcelAsync(Select_table post);
|
Task<int> CheckExcelAsync(Select_table post);
|
||||||
|
Task<string> GetCompanyNameByPowerStationId(int powerStationId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1024,25 +1024,27 @@
|
|||||||
sta += "<td>" + toThousands(Number(inverter[i]).toFixed(2)) + "</td>";
|
sta += "<td>" + toThousands(Number(inverter[i]).toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sta += "<td>" + toThousands(Number(inverter.hourKWH)) + "</td>";
|
sta += "<td>" + toThousands(Number(inverter.hourKWH).toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(Number(inverter.hourKWHp)) + "</td>";
|
sta += "<td>" + toThousands(Number(inverter.hourKWHp).toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(Number(inverter.irrDayHour)) + "</td>"; // body 小時平均日照度 irradiance
|
sta += "<td>" + toThousands(Number(inverter.irrDayHour).toFixed(2)) + "</td>"; // body 小時平均日照度 irradiance
|
||||||
sta += "<td>" + toThousands(Number(inverter.temperature)) + "</td>"; //body 小時平均模組溫度
|
sta += "<td>" + toThousands(Number(inverter.temperature).toFixed(2)) + "</td>"; //body 小時平均模組溫度
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
sta += "<td>" + toThousands(Math.round(Number(inverter.hourmoney))) + "</td>";
|
sta += "<td>" + toThousands((Number(inverter.hourmoney).toFixed(2))) + "</td>";
|
||||||
}
|
}
|
||||||
sta += "</tr>";
|
sta += "</tr>";
|
||||||
|
if (index < rel.data.length - 1) {
|
||||||
thour = inverter.tothour ? inverter.tothour.toFixed(2) : 0;
|
thour = inverter.tothour ? inverter.tothour.toFixed(2) : 0;
|
||||||
tpr = inverter.pr ? inverter.pr.toFixed(2) : 0;
|
tpr = inverter.pr ? inverter.pr.toFixed(2) : 0;
|
||||||
tkwh = inverter.totKWH ? inverter.totKWH.toFixed(2) : 0;
|
tkwh = inverter.totKWH ? inverter.totKWH.toFixed(2) : 0;
|
||||||
kWhkwp = inverter.totKWHKWP ? inverter.totKWHKWP.toFixed(2) : 0; // 日報 有效發電小時
|
//kWhkwp = inverter.totKWHKWP ? inverter.totKWHKWP.toFixed(2) : 0; // 日報 有效發電小時
|
||||||
ntd = inverter.totmoney ? Math.round(inverter.totmoney) : 0;
|
kWhkwp = inverter.totKWHKWP ? (inverter.totKWH / inverter.GeneratingCapacity).toFixed(2) : 0; // 日報 有效發電小時
|
||||||
ntdone = inverter.totmoney / inverter.totKWH ? Math.round(inverter.totmoney / inverter.totKWH * 10000) / 10000 : 0;
|
ntd = inverter.totmoney ? inverter.totmoney.toFixed(2) : 0;
|
||||||
GeneratingCapacity = inverter.GeneratingCapacity;
|
ntdone = inverter.totmoney / inverter.totKWH ? (inverter.totmoney / inverter.totKWH).toFixed(2) : 0;
|
||||||
averageDailyProfit = ntd / GeneratingCapacity ? Math.round(ntd / GeneratingCapacity * 10000) / 10000 : 0;
|
GeneratingCapacity = inverter.GeneratingCapacity ? inverter.GeneratingCapacity.toFixed(2) : 0;
|
||||||
|
averageDailyProfit = ntd / GeneratingCapacity ? (ntd / GeneratingCapacity).toFixed(2) : 0;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
var stc = "<tr>";
|
var stc = "<tr>";
|
||||||
/* stc += "<th>" + '日照小時' + "</th>";*/
|
|
||||||
stc += "<th>" + '日均發電度數' + "</th>";
|
stc += "<th>" + '日均發電度數' + "</th>";
|
||||||
stc += "<th>" + 'PR%' + "</th>";
|
stc += "<th>" + 'PR%' + "</th>";
|
||||||
stc += "<th>" + '日發電量(kWh)' + "</th>";
|
stc += "<th>" + '日發電量(kWh)' + "</th>";
|
||||||
@ -1057,14 +1059,14 @@
|
|||||||
|
|
||||||
var stb = "<tr>";
|
var stb = "<tr>";
|
||||||
/* stb += "<td>" + thour + "</td>";*/
|
/* stb += "<td>" + thour + "</td>";*/
|
||||||
stb += "<td>" + toThousands(kWhkwp) + "</td>"; //header - 有效發電小時
|
stb += "<td>" + toThousands(kWhkwp) + "</td>"; //header - 有效發電小時 kWhkwp
|
||||||
stb += "<td>" + toThousands(tpr) + "</td>"; //
|
stb += "<td>" + toThousands(tpr) + "</td>"; //
|
||||||
stb += "<td>" + toThousands(tkwh) + "</td>";
|
stb += "<td>" + toThousands(tkwh) + "</td>";
|
||||||
stb += "<td>" + toThousands(GeneratingCapacity) + "</td>";
|
stb += "<td>" + toThousands(GeneratingCapacity) + "</td>";
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
stb += "<td>" + toThousands(Math.round(ntd)) + "</td>";
|
stb += "<td>" + toThousands(ntd) + "</td>";
|
||||||
stb += "<td>" + Math.round(ntdone * 10000) / 10000 + "</td>";
|
stb += "<td>" + toThousands(ntdone) + "</td>";
|
||||||
stb += "<td>" + toThousands(Math.round(averageDailyProfit)) + "</td>";
|
stb += "<td>" + toThousands(averageDailyProfit) + "</td>";
|
||||||
}
|
}
|
||||||
stb += "</tr>";
|
stb += "</tr>";
|
||||||
|
|
||||||
@ -1095,18 +1097,18 @@
|
|||||||
if (inverter[i] == null) {
|
if (inverter[i] == null) {
|
||||||
sta += "<td>" + 0 + "</td>";
|
sta += "<td>" + 0 + "</td>";
|
||||||
} else {
|
} else {
|
||||||
sta += "<td>" + toThousands(inverter[i]) + "</td>";
|
sta += "<td>" + toThousands(inverter[i].toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sta += "<td>" + toThousands(inverter.dayKWH) + "</td>";
|
sta += "<td>" + toThousands(inverter.dayKWH.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp)) + "</td>";
|
sta += "<td>" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp.toFixed(2))) + "</td>";
|
||||||
sta += "<td>" + inverter.tothour + "</td>";
|
sta += "<td>" + inverter.tothour.toFixed(2) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.KWHKWP) + "</td>";
|
sta += "<td>" + toThousands(inverter.KWHKWP.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + "</td>";
|
sta += "<td>" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + "</td>";
|
||||||
sta += "<td>" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay)) + "</td>";
|
sta += "<td>" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay.toFixed(2))) + "</td>";
|
||||||
sta += "<td>" + inverter.temperature + "</td>";
|
sta += "<td>" + inverter.temperature.toFixed(2) + "</td>";
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
sta += "<td>" + toThousands(Math.round(inverter.soldmoney)) + "</td>";
|
sta += "<td>" + toThousands(inverter.soldmoney.toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
sta += "</tr>";
|
sta += "</tr>";
|
||||||
avghour += inverter.tothour ? inverter.tothour : 0;
|
avghour += inverter.tothour ? inverter.tothour : 0;
|
||||||
@ -1120,7 +1122,7 @@
|
|||||||
sitedb = inverter.SiteDB
|
sitedb = inverter.SiteDB
|
||||||
}
|
}
|
||||||
GeneratingCapacity = inverter.GeneratingCapacity;
|
GeneratingCapacity = inverter.GeneratingCapacity;
|
||||||
averageDailyProfit = monthmoney / GeneratingCapacity ? Math.round(monthmoney / GeneratingCapacity * 10000) / 10000 : 0;
|
averageDailyProfit = monthmoney / GeneratingCapacity ? (monthmoney / GeneratingCapacity) : 0;
|
||||||
})
|
})
|
||||||
monthday = (rel.data.length - 1);//最後一筆是總計
|
monthday = (rel.data.length - 1);//最後一筆是總計
|
||||||
monthmoneyone = rel.data[0].monthmoneyone ? rel.data[0].monthmoneyone : 0;
|
monthmoneyone = rel.data[0].monthmoneyone ? rel.data[0].monthmoneyone : 0;
|
||||||
@ -1161,16 +1163,16 @@
|
|||||||
/*stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";*/
|
/*stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";*/
|
||||||
stb += "<td>" + toThousands((avgKWHKWP / monthday).toFixed(2)) + "</td>";
|
stb += "<td>" + toThousands((avgKWHKWP / monthday).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
|
stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(monthKWH) + "</td>";
|
stb += "<td>" + toThousands(monthKWH.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(GeneratingCapacity) + "</td>";
|
stb += "<td>" + toThousands(GeneratingCapacity.toFixed(2)) + "</td>";
|
||||||
|
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
stb += "<td>" + toThousands((monthmoney / GeneratingCapacity).toFixed(3)) + "</td>";
|
stb += "<td>" + toThousands((monthmoney / GeneratingCapacity).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(Math.round(monthmoney)) + "</td>";
|
stb += "<td>" + toThousands(monthmoney.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + monthmoneyone + "</td>";
|
stb += "<td>" + toThousands(monthmoneyone.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(Math.round(averageDailyProfit / monthday)) + "</td>";
|
stb += "<td>" + toThousands((averageDailyProfit / monthday).toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
stb += "<td>" + monthday + "</td>";
|
stb += "<td>" + monthday.toFixed(2) + "</td>";
|
||||||
stb += "</tr>";
|
stb += "</tr>";
|
||||||
}
|
}
|
||||||
var std = "";
|
var std = "";
|
||||||
@ -1191,8 +1193,8 @@
|
|||||||
std += "<tr>";
|
std += "<tr>";
|
||||||
std += "<td>" + value.landowner + "</td>";
|
std += "<td>" + value.landowner + "</td>";
|
||||||
std += "<td>" + value.leaseRate + "%" + "</td>";
|
std += "<td>" + value.leaseRate + "%" + "</td>";
|
||||||
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100)) + "</td>";
|
std += "<td>" + toThousands((monthmoney * value.leaseRate / 100).toFixed(2)) + "</td>";
|
||||||
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100 * 1.05)) + "</td>";
|
std += "<td>" + toThousands((monthmoney * value.leaseRate / 100 * 1.05).toFixed(2)) + "</td>";
|
||||||
std += "</tr>";
|
std += "</tr>";
|
||||||
})
|
})
|
||||||
$('#HireTableBody').append(std);
|
$('#HireTableBody').append(std);
|
||||||
@ -1217,6 +1219,7 @@
|
|||||||
var monthmoneyone = 0;
|
var monthmoneyone = 0;
|
||||||
var monthday = 0;
|
var monthday = 0;
|
||||||
var averageDailyProfit = 0;
|
var averageDailyProfit = 0;
|
||||||
|
var days = 0;
|
||||||
var sta = "";
|
var sta = "";
|
||||||
var check_hire = false;
|
var check_hire = false;
|
||||||
var sitedb = "";
|
var sitedb = "";
|
||||||
@ -1227,27 +1230,27 @@
|
|||||||
if (inverter[i] == null) {
|
if (inverter[i] == null) {
|
||||||
sta += "<td>" + 0 + "</td>";
|
sta += "<td>" + 0 + "</td>";
|
||||||
} else {
|
} else {
|
||||||
sta += "<td>" + toThousands(inverter[i]) + "</td>";
|
sta += "<td>" + toThousands(inverter[i].toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sta += "<td>" + toThousands(inverter.dayKWH) + "</td>";
|
sta += "<td>" + toThousands(inverter.dayKWH.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.dayKWHp) + "</td>";
|
sta += "<td>" + toThousands(inverter.dayKWHp.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.tothour) + "</td>";
|
sta += "<td>" + toThousands(inverter.tothour.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.KWHKWP) + "</td>";
|
sta += "<td>" + toThousands(inverter.KWHKWP.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.PR.toFixed(2)) + "</td>";
|
sta += "<td>" + toThousands(inverter.PR.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.irradiance) + "</td>";
|
sta += "<td>" + toThousands(inverter.irradiance.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.temperature) + "</td>";
|
sta += "<td>" + toThousands(inverter.temperature.toFixed(2)) + "</td>";
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
sta += "<td>" + toThousands(Math.round(inverter.soldmoney)) + "</td>";
|
sta += "<td>" + toThousands(inverter.soldmoney.toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
sta += "</tr>";
|
sta += "</tr>";
|
||||||
avghour += inverter.tothour ? inverter.tothour : 0;
|
avghour += inverter.tothour ? inverter.tothour : 0;
|
||||||
avgKWHKWP += inverter.KWHKWP ? inverter.KWHKWP : 0;
|
avgKWHKWP += inverter.KWHKWP ? inverter.KWHKWP : 0;
|
||||||
avgdayKWH += inverter.dayKWH ? inverter.dayKWH : 0;
|
avgdayKWH += inverter.dayKWH ? inverter.dayKWH : 0;
|
||||||
monthKWH = inverter.monthKWH ? toThousands(inverter.monthKWH) : 0;
|
monthKWH = inverter.monthKWH ? inverter.monthKWH : 0;
|
||||||
monthmoney = inverter.monthmoney ? inverter.monthmoney : 0;
|
monthmoney = inverter.monthmoney ? inverter.monthmoney : 0;
|
||||||
|
|
||||||
averageDailyProfit = monthmoney / inverter.GeneratingCapacity ? Math.round(monthmoney / inverter.GeneratingCapacity * 10000) / 10000 : 0;
|
averageDailyProfit = monthmoney / inverter.GeneratingCapacity ? (monthmoney / inverter.GeneratingCapacity) : 0;
|
||||||
|
|
||||||
if (inverter.SolarType == 1) {
|
if (inverter.SolarType == 1) {
|
||||||
check_hire = true;
|
check_hire = true;
|
||||||
@ -1255,8 +1258,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
monthday = rel.data.length;
|
monthday = (rel.data.length - 1);
|
||||||
monthmoneyone = rel.data[0].monthmoneyone ? rel.data[0].monthmoneyone : 0;
|
monthmoneyone = rel.data[0].monthmoneyone ? rel.data[0].monthmoneyone : 0;
|
||||||
|
days = rel.data[0].Days;
|
||||||
|
|
||||||
|
|
||||||
var stc = "<tr>";
|
var stc = "<tr>";
|
||||||
@ -1287,16 +1291,16 @@
|
|||||||
stb += "</tr>";
|
stb += "</tr>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";
|
stb += "<td>" + toThousands((avghour / monthday).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + (avgKWHKWP / monthday).toFixed(2) + "</td>";
|
stb += "<td>" + toThousands((avgKWHKWP / monthday).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
|
stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + monthKWH + "</td>";
|
stb += "<td>" + toThousands(monthKWH.toFixed(2)) + "</td>";
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
stb += "<td>" + toThousands(Math.round(monthmoney)) + "</td>";
|
stb += "<td>" + toThousands(monthmoney.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + monthmoneyone + "</td>";
|
stb += "<td>" + toThousands(monthmoneyone.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(Math.round((averageDailyProfit / monthday / 30 * 10000) / 10000)) + "</td>";
|
stb += "<td>" + toThousands((averageDailyProfit / days).toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
stb += "<td>" + monthday + "</td>";
|
stb += "<td>" + toThousands(monthday.toFixed(2)) + "</td>";
|
||||||
stb += "</tr>";
|
stb += "</tr>";
|
||||||
}
|
}
|
||||||
var std = "";
|
var std = "";
|
||||||
@ -1317,8 +1321,8 @@
|
|||||||
std += "<tr>";
|
std += "<tr>";
|
||||||
std += "<td>" + value.landowner + "</td>";
|
std += "<td>" + value.landowner + "</td>";
|
||||||
std += "<td>" + toThousands(value.leaseRate) + "%" + "</td>";
|
std += "<td>" + toThousands(value.leaseRate) + "%" + "</td>";
|
||||||
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100)) + "</td>";
|
std += "<td>" + toThousands((monthmoney * value.leaseRate / 100).toFixed(2)) + "</td>";
|
||||||
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100 * 1.05)) + "</td>";
|
std += "<td>" + toThousands((monthmoney * value.leaseRate / 100 * 1.05).toFixed(2)) + "</td>";
|
||||||
std += "</tr>";
|
std += "</tr>";
|
||||||
})
|
})
|
||||||
$('#HireTableBody').append(std);
|
$('#HireTableBody').append(std);
|
||||||
@ -1355,18 +1359,18 @@
|
|||||||
if (inverter[i] == null) {
|
if (inverter[i] == null) {
|
||||||
sta += "<td>" + 0 + "</td>";
|
sta += "<td>" + 0 + "</td>";
|
||||||
} else {
|
} else {
|
||||||
sta += "<td>" + toThousands(inverter[i]) + "</td>";
|
sta += "<td>" + toThousands(inverter[i].toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sta += "<td>" + toThousands(inverter.dayKWH) + "</td>";
|
sta += "<td>" + toThousands(inverter.dayKWH.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp)) + "</td>";
|
sta += "<td>" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp.toFixed(2))) + "</td>";
|
||||||
sta += "<td>" + inverter.tothour + "</td>";
|
sta += "<td>" + toThousands(inverter.tothour.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + toThousands(inverter.KWHKWP) + "</td>";
|
sta += "<td>" + toThousands(inverter.KWHKWP.toFixed(2)) + "</td>";
|
||||||
sta += "<td>" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + "</td>";
|
sta += "<td>" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + "</td>";
|
||||||
sta += "<td>" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay)) + "</td>";
|
sta += "<td>" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay.toFixed(2))) + "</td>";
|
||||||
sta += "<td>" + inverter.temperature + "</td>";
|
sta += "<td>" + toThousands(inverter.temperature.toFixed(2)) + "</td>";
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
sta += "<td>" + toThousands(Math.round(inverter.soldmoney)) + "</td>";
|
sta += "<td>" + toThousands(inverter.soldmoney.toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
sta += "</tr>";
|
sta += "</tr>";
|
||||||
avghour += inverter.tothour ? inverter.tothour : 0;
|
avghour += inverter.tothour ? inverter.tothour : 0;
|
||||||
@ -1381,9 +1385,9 @@
|
|||||||
sitedb = inverter.SiteDB
|
sitedb = inverter.SiteDB
|
||||||
}
|
}
|
||||||
GeneratingCapacity = inverter.GeneratingCapacity;
|
GeneratingCapacity = inverter.GeneratingCapacity;
|
||||||
averageDailyProfit = monthmoney / GeneratingCapacity ? Math.round(monthmoney / GeneratingCapacity * 10000) / 10000 : 0;
|
averageDailyProfit = monthmoney / GeneratingCapacity ? (monthmoney / GeneratingCapacity) : 0;
|
||||||
})
|
})
|
||||||
monthday = rel.data.length;
|
monthday = (rel.data.length - 1);
|
||||||
|
|
||||||
|
|
||||||
var stc = "<tr>";
|
var stc = "<tr>";
|
||||||
@ -1421,16 +1425,16 @@
|
|||||||
/*stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";*/
|
/*stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";*/
|
||||||
stb += "<td>" + toThousands((avgKWHKWP / monthday).toFixed(2)) + "</td>";
|
stb += "<td>" + toThousands((avgKWHKWP / monthday).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
|
stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(monthKWH) + "</td>";
|
stb += "<td>" + toThousands(monthKWH.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(GeneratingCapacity) + "</td>";
|
stb += "<td>" + toThousands(GeneratingCapacity.toFixed(2)) + "</td>";
|
||||||
|
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
stb += "<td>" + toThousands((monthmoney / GeneratingCapacity).toFixed(3)) + "</td>";
|
stb += "<td>" + toThousands((monthmoney / GeneratingCapacity).toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(Math.round(monthmoney)) + "</td>";
|
stb += "<td>" + toThousands(monthmoney.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + Math.round(monthmoneyone / monthday * 10000) / 10000 + "</td>";
|
stb += "<td>" + toThousands(monthmoneyone / monthday.toFixed(2)) + "</td>";
|
||||||
stb += "<td>" + toThousands(Math.round(averageDailyProfit / monthday)) + "</td>";
|
stb += "<td>" + toThousands((averageDailyProfit / monthday).toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
stb += "<td>" + monthday + "</td>";
|
stb += "<td>" + toThousands(monthday.toFixed(2)) + "</td>";
|
||||||
stb += "</tr>";
|
stb += "</tr>";
|
||||||
}
|
}
|
||||||
var std = "";
|
var std = "";
|
||||||
@ -1451,8 +1455,8 @@
|
|||||||
std += "<tr>";
|
std += "<tr>";
|
||||||
std += "<td>" + value.landowner + "</td>";
|
std += "<td>" + value.landowner + "</td>";
|
||||||
std += "<td>" + value.leaseRate + "%" + "</td>";
|
std += "<td>" + value.leaseRate + "%" + "</td>";
|
||||||
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100)) + "</td>";
|
std += "<td>" + toThousands((monthmoney * value.leaseRate / 100).toFixed(2)) + "</td>";
|
||||||
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100 * 1.05)) + "</td>";
|
std += "<td>" + toThousands((monthmoney * value.leaseRate / 100 * 1.05).toFixed(2)) + "</td>";
|
||||||
std += "</tr>";
|
std += "</tr>";
|
||||||
})
|
})
|
||||||
$('#HireTableBody').append(std);
|
$('#HireTableBody').append(std);
|
||||||
@ -1625,17 +1629,17 @@
|
|||||||
/*StrInfoBody += "<td>" + data.generatingCapacity.toFixed(2) + "</td>";*/
|
/*StrInfoBody += "<td>" + data.generatingCapacity.toFixed(2) + "</td>";*/
|
||||||
StrInfoBody += "<td>" + data.powerRate.toFixed(2) + "</td>";
|
StrInfoBody += "<td>" + data.powerRate.toFixed(2) + "</td>";
|
||||||
StrInfoBody += "<td>" + toThousands((data.todayMoney / data.generatingCapacity / data.days).toFixed(2)) + "</td>";//每kw日均獲利
|
StrInfoBody += "<td>" + toThousands((data.todayMoney / data.generatingCapacity / data.days).toFixed(2)) + "</td>";//每kw日均獲利
|
||||||
StrInfoBody += "<td>" + toThousands(data.avgKWHKWP.toFixed(2)) + "</td>"; // 日均發電度數
|
StrInfoBody += "<td>" + toThousands((data.kwh / data.generatingCapacity).toFixed(2)) + "</td>"; // 日均發電度數
|
||||||
StrInfoBody += "<td>" + toThousands(data.kwh.toFixed(2)) + "</td>"; // 發電量
|
StrInfoBody += "<td>" + toThousands(data.kwh.toFixed(2)) + "</td>"; // 發電量
|
||||||
/*StrInfoBody += "<td>" + toThousands(data.irradiance.toFixed(2)) + "</td>"; // 累積日照*/
|
/*StrInfoBody += "<td>" + toThousands(data.irradiance.toFixed(2)) + "</td>"; // 累積日照*/
|
||||||
StrInfoBody += "<td>" + toThousands(data.avgPR.toFixed(2)) + "</td>";
|
StrInfoBody += "<td>" + toThousands(data.avgPR.toFixed(2)) + "</td>";
|
||||||
if (showmoney == 1) {
|
if (showmoney == 1) {
|
||||||
|
|
||||||
StrInfoBody += "<td>" + toThousands(Math.round(data.todayMoney, 2)) + "</td>";
|
StrInfoBody += "<td>" + toThousands(data.todayMoney.toFixed(2)) + "</td>";
|
||||||
|
|
||||||
StrInfoBody += "<td>" + Math.round(data.todayMoney * hirerate * 0.01, 2)+ "</td>";
|
StrInfoBody += "<td>" + toThousands((data.todayMoney * hirerate * 0.01).toFixed(2)) + "</td>";
|
||||||
|
|
||||||
StrInfoBody += "<td>" + toThousands(Math.round(data.todayMoney, 2)) + "</td>";
|
StrInfoBody += "<td>" + toThousands(data.todayMoney.toFixed(2)) + "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1650,7 +1654,7 @@
|
|||||||
$.each(CityArray, function (index, data) {
|
$.each(CityArray, function (index, data) {
|
||||||
CityInfoBody += "<tr>";
|
CityInfoBody += "<tr>";
|
||||||
CityInfoBody += "<td>" + data.city + "</td>";
|
CityInfoBody += "<td>" + data.city + "</td>";
|
||||||
CityInfoBody += "<td>" + data.generatingCapacity.toFixed(2) + "</td>";
|
CityInfoBody += "<td>" + toThousands(data.generatingCapacity.toFixed(2)) + "</td>";
|
||||||
CityInfoBody += "<td>" + toThousands(data.kwp.toFixed(2)) + "</td>";
|
CityInfoBody += "<td>" + toThousands(data.kwp.toFixed(2)) + "</td>";
|
||||||
CityInfoBody += "<td>" + toThousands((data.kwp / data.generatingCapacity).toFixed(2)) + "</td>";
|
CityInfoBody += "<td>" + toThousands((data.kwp / data.generatingCapacity).toFixed(2)) + "</td>";
|
||||||
CityInfoBody += "</tr>";
|
CityInfoBody += "</tr>";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user