Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def minDueDate
- def elements = ctx.debt.schedules[0].schedulePayments
- def curDate = new Date()
- curDate = curDate.clearTime()
- if (
- (ctx.debt.dictValue1 == 9) ||
- (ctx.debt.dictValue1 == 11) ||
- (ctx.debt.dictValue1 == 12) ||
- (ctx.debt.dictValue1 == 13) ||
- (ctx.debt.dictValue1 == 14) ||
- (ctx.debt.dictValue1 == 16) ) {
- return 2
- }else if (ctx.debt.dictValue1 == 17) {
- return 31
- }else {
- for(item in elements) {
- if (curDate <= item.date){
- if (minDueDate==null){minDueDate=item.date}
- if (minDueDate>item.date){
- minDueDate=item.date
- }
- }
- }
- if (curDate==minDueDate){
- return 0
- } else {
- if((minDueDate-curDate)>5){
- return 5
- } else {
- return (minDueDate-curDate)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement