Subversion Repositories SmartDukaan

Rev

Rev 36719 | 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
 
37790 amit 45
	/**
46
	 * Why this note carries no IRN: NIC's refusal message, kept brief and plain ASCII (the table is
47
	 * latin1). Null on every normally-filed note.
48
	 */
49
	@Column(name = "irn_skip_reason")
50
	private String irnSkipReason;
51
 
52
	/**
53
	 * Issued as a B2C note by Finance after NIC refused the return for a cancelled/invalid buyer
54
	 * GSTIN. Carries the refunded value net of GST, with no tax on its lines and no IRN.
55
	 */
56
	@Column(name = "b2c")
57
	private boolean b2c;
58
 
31008 amit.gupta 59
	public int getId() {
60
		return id;
61
	}
62
 
63
	public void setId(int id) {
64
		this.id = id;
65
	}
66
 
67
	public int getFofoId() {
68
		return fofoId;
69
	}
70
 
71
	public void setFofoId(int fofoId) {
72
		this.fofoId = fofoId;
73
	}
74
 
75
	public String getCreditNoteNumber() {
76
		return creditNoteNumber;
77
	}
78
 
79
	public void setCreditNoteNumber(String creditNoteNumber) {
80
		this.creditNoteNumber = creditNoteNumber;
81
	}
82
 
83
	public CreditNoteType getType() {
84
		return type;
85
	}
86
 
87
	public void setType(CreditNoteType type) {
88
		this.type = type;
89
	}
90
 
91
	public LocalDateTime getCreateTimestamp() {
92
		return createTimestamp;
93
	}
94
 
95
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
96
		this.createTimestamp = createTimestamp;
97
	}
98
 
99
	@Override
100
	public String toString() {
101
		return "CreditNote{" +
102
				"id=" + id +
103
				", fofoId=" + fofoId +
104
				", creditNoteNumber='" + creditNoteNumber + '\'' +
105
				", cnDate='" + cnDate + '\'' +
106
				", type=" + type +
107
				", createTimestamp=" + createTimestamp +
108
				'}';
109
	}
110
 
111
	public LocalDateTime getCnDate() {
112
		return cnDate;
113
	}
114
 
115
	public void setCnDate(LocalDateTime cnDate) {
116
		this.cnDate = cnDate;
117
	}
118
 
36147 amit 119
	public String getOriginalInvoiceNumber() {
120
		return originalInvoiceNumber;
121
	}
122
 
123
	public void setOriginalInvoiceNumber(String originalInvoiceNumber) {
124
		this.originalInvoiceNumber = originalInvoiceNumber;
125
	}
126
 
36218 amit 127
	public LocalDate getMarginMonth() {
128
		return marginMonth;
129
	}
130
 
131
	public void setMarginMonth(LocalDate marginMonth) {
132
		this.marginMonth = marginMonth;
133
	}
134
 
135
	public boolean isCancelled() {
136
		return cancelled;
137
	}
138
 
139
	public void setCancelled(boolean cancelled) {
140
		this.cancelled = cancelled;
141
	}
142
 
36719 amit 143
	public BigDecimal getTotalAmount() {
144
		return totalAmount;
145
	}
146
 
147
	public void setTotalAmount(BigDecimal totalAmount) {
148
		this.totalAmount = totalAmount;
149
	}
150
 
37790 amit 151
	public String getIrnSkipReason() {
152
		return irnSkipReason;
153
	}
154
 
155
	public void setIrnSkipReason(String irnSkipReason) {
156
		this.irnSkipReason = irnSkipReason;
157
	}
158
 
159
	public boolean isB2c() {
160
		return b2c;
161
	}
162
 
163
	public void setB2c(boolean b2c) {
164
		this.b2c = b2c;
165
	}
166
 
31008 amit.gupta 167
	@Override
168
	public boolean equals(Object o) {
169
		if (this == o) return true;
170
		if (o == null || getClass() != o.getClass()) return false;
171
		CreditNote that = (CreditNote) o;
172
		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);
173
	}
174
 
175
	@Override
176
	public int hashCode() {
177
		return Objects.hash(id, fofoId, creditNoteNumber, cnDate, type, createTimestamp);
178
	}
179
 
180
}