Subversion Repositories SmartDukaan

Rev

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

Rev 32681 Rev 33528
Line 2... Line 2...
2
 
2
 
3
import com.spice.profitmandi.dao.model.DailyStatementModel;
3
import com.spice.profitmandi.dao.model.DailyStatementModel;
4
 
4
 
5
import javax.persistence.*;
5
import javax.persistence.*;
6
import java.math.BigDecimal;
6
import java.math.BigDecimal;
-
 
7
import java.time.LocalDate;
7
import java.time.LocalDateTime;
8
import java.time.LocalDateTime;
-
 
9
import java.time.temporal.ChronoUnit;
8
import java.util.List;
10
import java.util.List;
9
import java.util.Objects;
11
import java.util.Objects;
10
 
12
 
11
@Entity
13
@Entity
12
@Table(name = "transaction.loan")
14
@Table(name = "transaction.loan")
Line 51... Line 53...
51
	private boolean loanStatus;
53
	private boolean loanStatus;
52
 
54
 
53
	@Transient
55
	@Transient
54
	private BigDecimal totalPending;
56
	private BigDecimal totalPending;
55
 
57
 
-
 
58
	public long getDays() {
-
 
59
		return ChronoUnit.DAYS.between(this.getCreatedOn().toLocalDate(), LocalDateTime.now()) + 1;
-
 
60
	}
-
 
61
 
-
 
62
	public boolean isDue() {
-
 
63
		return this.getSettledOn()!=null && this.getDueDate().toLocalDate().isBefore(LocalDate.now());
-
 
64
	}
-
 
65
 
-
 
66
	public boolean isDefault() {
-
 
67
		return this.getSettledOn()!=null && this.getDueDate().toLocalDate().isAfter(LocalDate.now());
-
 
68
	}
-
 
69
 
-
 
70
	public boolean isDueDateCrossed() {
-
 
71
		return this.getSettledOn()!=null && this.getDueDate().toLocalDate().isAfter(LocalDate.now());
-
 
72
	}
-
 
73
 
56
	@Transient
74
	@Transient
57
	private List<DailyStatementModel> dailyStatementModel;
75
	private List<DailyStatementModel> dailyStatementModel;
58
 
76
 
59
	public int getId() {
77
	public int getId() {
60
		return id;
78
		return id;