Subversion Repositories SmartDukaan

Rev

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