| Line 76... |
Line 76... |
| 76 |
float totalAmount = 0;
|
76 |
float totalAmount = 0;
|
| 77 |
for(SchemeInOut sio : schemeInouts) {
|
77 |
for(SchemeInOut sio : schemeInouts) {
|
| 78 |
|
78 |
|
| 79 |
if (investmentMaintainedDays < 8) {
|
79 |
if (investmentMaintainedDays < 8) {
|
| 80 |
sio.setStatus(SchemePayoutStatus.REJECTED);
|
80 |
sio.setStatus(SchemePayoutStatus.REJECTED);
|
| 81 |
sio.setRolledBackTimestamp(LocalDateTime.now());
|
81 |
//sio.setRolledBackTimestamp(LocalDateTime.now());
|
| 82 |
sio.setStatusDescription("Investment maintained for " + investmentMaintainedDays + "(< 8) days");
|
82 |
sio.setStatusDescription("Investment maintained for " + investmentMaintainedDays + "(< 8) days");
|
| 83 |
} else if (investmentMaintainedDays < 12) {
|
83 |
} else if (investmentMaintainedDays < 12) {
|
| 84 |
sio.setStatus(SchemePayoutStatus.CREDITED);
|
84 |
sio.setStatus(SchemePayoutStatus.CREDITED);
|
| 85 |
sio.setAmount(sio.getAmount()/2);
|
85 |
sio.setAmount(sio.getAmount()/2);
|
| 86 |
sio.setCreditTimestamp(LocalDateTime.now());
|
86 |
sio.setCreditTimestamp(LocalDateTime.now());
|
| Line 91... |
Line 91... |
| 91 |
sio.setCreditTimestamp(LocalDateTime.now());
|
91 |
sio.setCreditTimestamp(LocalDateTime.now());
|
| 92 |
totalAmount += sio.getAmount();
|
92 |
totalAmount += sio.getAmount();
|
| 93 |
}
|
93 |
}
|
| 94 |
}
|
94 |
}
|
| 95 |
if(totalAmount > 0) {
|
95 |
if(totalAmount > 0) {
|
| 96 |
String description = "Margin rolled out for " + FormattingUtils.formatYearMonth(startOfPreviousMonth.atStartOfDay());
|
96 |
String description = "Investment margin paid for " + FormattingUtils.formatYearMonth(startOfPreviousMonth.atStartOfDay());
|
| 97 |
if(investmentMaintainedDays < 12) {
|
97 |
if(investmentMaintainedDays < 12) {
|
| 98 |
description += ", as maintained for " + investmentMaintainedDays + "(< 12) days";
|
98 |
description += ", as maintained for " + investmentMaintainedDays + "(< 12) days";
|
| 99 |
}
|
99 |
}
|
| 100 |
walletService.addAmountToWallet(fofoId,referenceId, WalletReferenceType.INVESTMENT_PAYOUT, description, totalAmount, lastOfPreviousMonth.atTime(LocalTime.MAX));
|
100 |
walletService.addAmountToWallet(fofoId,referenceId, WalletReferenceType.INVESTMENT_PAYOUT, description, totalAmount, lastOfPreviousMonth.atTime(LocalTime.MAX));
|
| 101 |
}
|
101 |
}
|