Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
37776 amit 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
4
 
5
import javax.persistence.*;
6
import java.io.Serializable;
7
import java.math.BigDecimal;
8
import java.time.LocalDateTime;
9
 
10
/**
11
 * One reversed debit-note return of a single unit: the goods never reached the warehouse, so the
12
 * refund, the stock movement and the credit note were undone. Also the idempotency guard - one row
13
 * per purchase_return_item.
14
 */
15
@Entity
16
@Table(name = "fofo.return_reversal")
17
public class ReturnReversal implements Serializable {
18
 
19
	private static final long serialVersionUID = 1L;
20
 
21
	public enum GstAction {
22
		/** The CN's IRN was still inside NIC's 24h window and was cancelled outright. */
23
		IRN_CANCELLED,
24
		/** Past the window: a DBN was issued against the CN. */
25
		DEBIT_NOTE,
26
		/** The CN was never filed at NIC (DC, B2C, internal) - voided locally. */
27
		LOCAL_VOID
28
	}
29
 
30
	@Id
31
	@Column(name = "id")
32
	@GeneratedValue(strategy = GenerationType.IDENTITY)
33
	private int id;
34
 
35
	@Column(name = "serial_number")
36
	private String serialNumber;
37
 
38
	@Column(name = "fofo_id")
39
	private int fofoId;
40
 
41
	@Column(name = "purchase_return_item_id")
42
	private int purchaseReturnItemId;
43
 
44
	@Column(name = "debit_note_id")
45
	private int debitNoteId;
46
 
47
	@Column(name = "order_id")
48
	private int orderId;
49
 
50
	@Column(name = "warehouse_inventory_item_id")
51
	private int warehouseInventoryItemId;
52
 
53
	@Column(name = "reversed_scan_id")
54
	private int reversedScanId;
55
 
56
	@Column(name = "credit_note_id")
57
	private Integer creditNoteId;
58
 
59
	@Enumerated(EnumType.STRING)
60
	@Column(name = "gst_action")
61
	private GstAction gstAction;
62
 
63
	@Column(name = "debit_note_number")
64
	private String debitNoteNumber;
65
 
66
	@Column(name = "amount")
67
	private BigDecimal amount;
68
 
69
	@Column(name = "reason")
70
	private String reason;
71
 
72
	@Column(name = "reversed_by")
73
	private String reversedBy;
74
 
75
	@Convert(converter = LocalDateTimeAttributeConverter.class)
76
	@Column(name = "create_timestamp")
77
	private LocalDateTime createTimestamp = LocalDateTime.now();
78
 
79
	public int getId() {
80
		return id;
81
	}
82
 
83
	public String getSerialNumber() {
84
		return serialNumber;
85
	}
86
 
87
	public void setSerialNumber(String serialNumber) {
88
		this.serialNumber = serialNumber;
89
	}
90
 
91
	public int getFofoId() {
92
		return fofoId;
93
	}
94
 
95
	public void setFofoId(int fofoId) {
96
		this.fofoId = fofoId;
97
	}
98
 
99
	public int getPurchaseReturnItemId() {
100
		return purchaseReturnItemId;
101
	}
102
 
103
	public void setPurchaseReturnItemId(int purchaseReturnItemId) {
104
		this.purchaseReturnItemId = purchaseReturnItemId;
105
	}
106
 
107
	public int getDebitNoteId() {
108
		return debitNoteId;
109
	}
110
 
111
	public void setDebitNoteId(int debitNoteId) {
112
		this.debitNoteId = debitNoteId;
113
	}
114
 
115
	public int getOrderId() {
116
		return orderId;
117
	}
118
 
119
	public void setOrderId(int orderId) {
120
		this.orderId = orderId;
121
	}
122
 
123
	public int getWarehouseInventoryItemId() {
124
		return warehouseInventoryItemId;
125
	}
126
 
127
	public void setWarehouseInventoryItemId(int warehouseInventoryItemId) {
128
		this.warehouseInventoryItemId = warehouseInventoryItemId;
129
	}
130
 
131
	public int getReversedScanId() {
132
		return reversedScanId;
133
	}
134
 
135
	public void setReversedScanId(int reversedScanId) {
136
		this.reversedScanId = reversedScanId;
137
	}
138
 
139
	public Integer getCreditNoteId() {
140
		return creditNoteId;
141
	}
142
 
143
	public void setCreditNoteId(Integer creditNoteId) {
144
		this.creditNoteId = creditNoteId;
145
	}
146
 
147
	public GstAction getGstAction() {
148
		return gstAction;
149
	}
150
 
151
	public void setGstAction(GstAction gstAction) {
152
		this.gstAction = gstAction;
153
	}
154
 
155
	public String getDebitNoteNumber() {
156
		return debitNoteNumber;
157
	}
158
 
159
	public void setDebitNoteNumber(String debitNoteNumber) {
160
		this.debitNoteNumber = debitNoteNumber;
161
	}
162
 
163
	public BigDecimal getAmount() {
164
		return amount;
165
	}
166
 
167
	public void setAmount(BigDecimal amount) {
168
		this.amount = amount;
169
	}
170
 
171
	public String getReason() {
172
		return reason;
173
	}
174
 
175
	public void setReason(String reason) {
176
		this.reason = reason;
177
	}
178
 
179
	public String getReversedBy() {
180
		return reversedBy;
181
	}
182
 
183
	public void setReversedBy(String reversedBy) {
184
		this.reversedBy = reversedBy;
185
	}
186
 
187
	public LocalDateTime getCreateTimestamp() {
188
		return createTimestamp;
189
	}
190
}