Subversion Repositories SmartDukaan

Rev

Rev 36147 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31008 amit.gupta 1
package com.spice.profitmandi.dao.entity.transaction;
2
 
3
import javax.persistence.*;
36218 amit 4
import java.time.LocalDate;
31008 amit.gupta 5
import java.time.LocalDateTime;
6
import java.util.Objects;
7
 
8
@Entity
9
@Table(name = "transaction.credit_note", schema = "transaction")
10
public class CreditNote {
11
	@Id
12
	@Column(name = "id")
13
	@GeneratedValue(strategy = GenerationType.IDENTITY)
14
	private int id;
15
 
16
	@Column(name = "fofo_id")
17
	private int fofoId;
18
 
19
	@Column(name = "cn_number")
20
	private String creditNoteNumber;
21
 
22
	@Column(name = "cn_date")
23
	private LocalDateTime cnDate;
24
 
25
	@Enumerated(EnumType.STRING)
26
	@Column(name = "cn_type")
27
	private CreditNoteType type;
28
 
29
	@Column(name = "create_timestamp")
30
	private LocalDateTime createTimestamp;
31
 
36147 amit 32
	@Column(name = "original_invoice_number")
33
	private String originalInvoiceNumber;
34
 
36218 amit 35
	@Column(name = "margin_month")
36
	private LocalDate marginMonth;
37
 
38
	@Column(name = "cancelled")
39
	private boolean cancelled;
40
 
31008 amit.gupta 41
	public int getId() {
42
		return id;
43
	}
44
 
45
	public void setId(int id) {
46
		this.id = id;
47
	}
48
 
49
	public int getFofoId() {
50
		return fofoId;
51
	}
52
 
53
	public void setFofoId(int fofoId) {
54
		this.fofoId = fofoId;
55
	}
56
 
57
	public String getCreditNoteNumber() {
58
		return creditNoteNumber;
59
	}
60
 
61
	public void setCreditNoteNumber(String creditNoteNumber) {
62
		this.creditNoteNumber = creditNoteNumber;
63
	}
64
 
65
	public CreditNoteType getType() {
66
		return type;
67
	}
68
 
69
	public void setType(CreditNoteType type) {
70
		this.type = type;
71
	}
72
 
73
	public LocalDateTime getCreateTimestamp() {
74
		return createTimestamp;
75
	}
76
 
77
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
78
		this.createTimestamp = createTimestamp;
79
	}
80
 
81
	@Override
82
	public String toString() {
83
		return "CreditNote{" +
84
				"id=" + id +
85
				", fofoId=" + fofoId +
86
				", creditNoteNumber='" + creditNoteNumber + '\'' +
87
				", cnDate='" + cnDate + '\'' +
88
				", type=" + type +
89
				", createTimestamp=" + createTimestamp +
90
				'}';
91
	}
92
 
93
	public LocalDateTime getCnDate() {
94
		return cnDate;
95
	}
96
 
97
	public void setCnDate(LocalDateTime cnDate) {
98
		this.cnDate = cnDate;
99
	}
100
 
36147 amit 101
	public String getOriginalInvoiceNumber() {
102
		return originalInvoiceNumber;
103
	}
104
 
105
	public void setOriginalInvoiceNumber(String originalInvoiceNumber) {
106
		this.originalInvoiceNumber = originalInvoiceNumber;
107
	}
108
 
36218 amit 109
	public LocalDate getMarginMonth() {
110
		return marginMonth;
111
	}
112
 
113
	public void setMarginMonth(LocalDate marginMonth) {
114
		this.marginMonth = marginMonth;
115
	}
116
 
117
	public boolean isCancelled() {
118
		return cancelled;
119
	}
120
 
121
	public void setCancelled(boolean cancelled) {
122
		this.cancelled = cancelled;
123
	}
124
 
31008 amit.gupta 125
	@Override
126
	public boolean equals(Object o) {
127
		if (this == o) return true;
128
		if (o == null || getClass() != o.getClass()) return false;
129
		CreditNote that = (CreditNote) o;
130
		return id == that.id && fofoId == that.fofoId && Objects.equals(creditNoteNumber, that.creditNoteNumber) && Objects.equals(cnDate, that.cnDate) && type == that.type && Objects.equals(createTimestamp, that.createTimestamp);
131
	}
132
 
133
	@Override
134
	public int hashCode() {
135
		return Objects.hash(id, fofoId, creditNoteNumber, cnDate, type, createTimestamp);
136
	}
137
 
138
}