Subversion Repositories SmartDukaan

Rev

Rev 28531 | Rev 28738 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28531 Rev 28534
Line 77... Line 77...
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());
87
					sio.setStatusDescription("Investment maintained for " + investmentMaintainedDays + "(< 12 days)");
87
					sio.setStatusDescription("Investment maintained for " + investmentMaintainedDays + "(< 12) days");
88
					totalAmount += sio.getAmount();
88
					totalAmount += sio.getAmount();
89
				} else {
89
				} else {
90
					sio.setStatus(SchemePayoutStatus.CREDITED);
90
					sio.setStatus(SchemePayoutStatus.CREDITED);
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 = "Margin rolled out for " + FormattingUtils.formatYearMonth(startOfPreviousMonth.atStartOfDay());
97
				if(investmentMaintainedDays < 12) {
97
				if(investmentMaintainedDays < 12) {
98
					description += ", as maintained for < 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
			}
102
			System.out.printf("%d\t%d\t%f%n", fofoId, investmentMaintainedDays, totalAmount);
102
			System.out.printf("%d\t%d\t%f%n", fofoId, investmentMaintainedDays, totalAmount);
103
		}
103
		}