如果有租金,请添加序列号 [英] Add serial number if there is rent
本文介绍了如果有租金,请添加序列号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果有与日期对应的Rent,我如何将序列号添加到索引表。
我有现在的日期和结束日期。如果租约于6/6/2018开始并于9/5/2018结束
则以下索引将打印为:
6/6/2018 $ 1
7/6/2018 $ 1
8/6/2018 $ 1
9/5/2018 0
结果:
1 6/6/2018 $ 1
2 7 / 6/2018 $ 1
3 8/6/2018 $ 1
- 9/5/2018 0
我尝试过:
How do i add serial number to the index table if there is Rent corresponding to the date.
I have present date and end date. If the lease starts on 6/6/2018 and ends on 9/5/2018
then the following index will print as :
6/6/2018 $1
7/6/2018 $1
8/6/2018 $1
9/5/2018 0
The result:
1 6/6/2018 $1
2 7/6/2018 $1
3 8/6/2018 $1
- 9/5/2018 0
What I have tried:
var firstIndex = 0;
for (var i = 0; i <= dates.length; i++) {
if (dates[i]) {
var splitDate = dates[i].split('-');
var PayDay = splitDate[1] + "/" + sDay + "/" + splitDate[0];//payment date
var PVDate = presentDate.getUTCMonth()+1 + "/" + presentDate.getUTCDate() + "/" + presentDate.getUTCFullYear();
var enddate = endDate.getUTCMonth()+1 + "/" + endDate.getUTCDate() + "/" + endDate.getUTCFullYear(); //end of lease date
//the index table
if (i == firstIndex && DiffDates ) {
htmlString += "<tr><td> </td><td>" + PVDate + "</td><td>" + "$" + 0 + " </td><td>0</td> <td>0</td><td> 0 </td><td> 0 </td></tr>";
}
//Rent
<pre> if (i!= 0 && i != lastIndex ) {
htmlString += "<tr><td> </td><td>" + PayDay + "</td><td>" + "$" + rent + " </td><td>0</td><td>0</td><td> 0 </td><td> 0 </td></tr>";
}
//endate
if (i == lastIndex)
htmlString +=
"<tr><td> </td><td>" + enddate + "</td><td>" + "$" + aRent + " </td><td>" + "$" + aResidual + "</td><td>" + "$" + aReturnCondition + " </td><td> " + "$" + aCashReturnCompensation + " </td><td> " + "$" + aTotalReturn + " </td></tr>";
}
推荐答案
1
7/6/2018
1
7/6/2018
>
1
8/6/2018
1
8/6/2018
1
9/5/2018 0
结果:
1 6/6/2018
1
9/5/2018 0
The result:
1 6/6/2018
这篇关于如果有租金,请添加序列号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文