Subversion Repositories SmartDukaan

Rev

Rev 30050 | Rev 31008 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22653 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
30050 manish 3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.NamedQueries;
14
import javax.persistence.NamedQuery;
15
import javax.persistence.Table;
16
import javax.persistence.Transient;
17
 
29927 amit.gupta 18
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
19
import com.spice.profitmandi.dao.enumuration.transaction.SchemePayoutStatus;
20
 
22653 ashik.ali 21
@Entity
24592 amit.gupta 22
@Table(name = "fofo.scheme_in_out", schema = "fofo")
29578 tejbeer 23
 
24
@NamedQueries({
30050 manish 25
	@NamedQuery(name = "SchemeInOut.selectPendingActivationGroupByBrandYearMonth", query = "select new com.spice.profitmandi.dao.model.ActivationYearMonthModel(i.brand, "
26
			+ "   DATE_FORMAT(sio.createTimestamp, '%m-%Y'),sum(cast(sio.amount As integer )) ) from Scheme sc join  SchemeInOut sio  on"
27
			+ " sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
28
			+ " join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and sio.createTimestamp >= :startDate and ii.fofoId = :fofoId  "
29
			+ "  group by i.brand, DATE_FORMAT(sio.createTimestamp, '%m-%Y')"),
29578 tejbeer 30
 
30050 manish 31
	@NamedQuery(name = "SchemeInOut.selectByYearMonthActivationGroupByBrand", query = "select new com.spice.profitmandi.dao.model.ActivationBrandModel(i.brand, "
32
			+ "  sum(cast(sio.amount As integer )) ) from Scheme sc join  SchemeInOut sio  on"
33
			+ " sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
34
			+ " join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and sio.createTimestamp <= :endDate and ii.fofoId = :fofoId  "
35
			+ "  group by i.brand"),
29578 tejbeer 36
 
30050 manish 37
	@NamedQuery(name = "SchemeInOut.selectBrandPendingActivationItemDetails", query = "select new com.spice.profitmandi.dao.model.ActivationItemDetailModel(i.brand, "
38
			+ "  i.modelName,i.modelNumber,cast(sio.amount As integer ),ii.serialNumber, ii.id) from Scheme sc join SchemeInOut sio  on"
39
			+ "	 sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
40
			+ "	 join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and "
41
			+ "  ii.fofoId = :fofoId and i.brand = :brand and  DATE_FORMAT(sio.createTimestamp, '%m-%Y') = :yearMonthValue"),
29578 tejbeer 42
 
30050 manish 43
	@NamedQuery(name = "SchemeInOut.selectBrandPendingActivationItemDetailByYearMonth", query = "select new com.spice.profitmandi.dao.model.ActivationItemDetailModel(i.brand, "
44
			+ "  i.modelName,i.modelNumber,cast(sio.amount As integer ),ii.serialNumber, ii.id) from Scheme sc join SchemeInOut sio  on"
45
			+ "	 sc.id = sio.schemeId join InventoryItem ii  on ii.id = sio.inventoryItemId"
46
			+ "	 join Item i on i.id = ii.itemId where sc.type = 'ACTIVATION' and sio.status ='PENDING' and "
47
			+ "  ii.fofoId = :fofoId and i.brand = :brand and sio.createTimestamp <= :endDate"),
29578 tejbeer 48
 
30050 manish 49
 
50
		@NamedQuery(name = "SchemeInOut.selectAllPurchaseInventoryByFofoId", query = "select new com.spice.profitmandi.dao.model.AllPurchaseInventoryModel(sum(cast(sio.amount As int ))) from InventoryItem ii join SchemeInOut sio on"
51
				+ "  sio.inventoryItemId=ii.id join Scheme sc on sc.id=sio.schemeId  where sc.type= 'IN' and ii.fofoId = :fofoId and ii.createTimestamp >= :startDate and "
52
				+ "  ii.createTimestamp <= :endDate and ii.fofoId = :fofoId group by ii.fofoId"),
53
 
54
		@NamedQuery(name = "SchemeInOut.selectAllCreditedSaleInventoryByFofoId", query = "select new com.spice.profitmandi.dao.model.AllPurchaseInventoryModel(sum(cast(sio.amount As int ))) from "
55
				+ "  ScanRecord sr join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on  sio.inventoryItemId=sr.inventoryItemId join Scheme sc on sc.id=sio.schemeId   where   sc.type != 'IN' and fo.cancelledTimestamp is null and "
56
				+ "  sio.status='CREDITED' and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId group by sr.fofoId"),
57
 
58
		@NamedQuery(name = "SchemeInOut.selectFrontIncomeByFofoId", query = "select new com.spice.profitmandi.dao.model.AllPurchaseInventoryModel(sum(cast(foi.sellingPrice As int )-cast(foi.dp As int ))) "
59
				+ " from InventoryItem ii join ScanRecord sr on sr.inventoryItemId=ii.id join FofoOrder fo on fo.id=sr.orderId join FofoOrderItem foi on foi.orderId=fo.id where "
60
				+ " fo.cancelledTimestamp is null and sr.type='SALE' and sr.createTimestamp >=:startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId group by sr.fofoId"),
61
 
62
		@NamedQuery(name = "SchemeInOut.selectAllPendingSaleInventoryByFofoId", query = "select new com.spice.profitmandi.dao.model.AllPurchaseInventoryModel(sum(cast(sio.amount As int ))) from "
63
				+ "  ScanRecord sr join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on  sio.inventoryItemId=sr.inventoryItemId  where  fo.cancelledTimestamp is null and "
64
				+ "  sio.status='PENDING' and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId group by sr.fofoId"),
65
 
66
        @NamedQuery(name = "SchemeInOut.selectLastMonthCreditedIncomeByFofoId", query = "select new com.spice.profitmandi.dao.model.LastMonthCreditedIncomeModel(foi.brand,sum(cast(foi.quantity As int)), sum(cast(sio.amount As int))) from ScanRecord sr "
67
		        + " join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on sio.inventoryItemId=sr.inventoryItemId join FofoOrderItem foi on foi.orderId=fo.id join Scheme sc on sc.id=sio.schemeId   where   sc.type != 'IN' and fo.cancelledTimestamp is null and "
68
		       + "sio.status='CREDITED' and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId group by foi.brand"),
69
 
70
        @NamedQuery(name = "SchemeInOut.selectFrontIncomeByBrand", query = "select new com.spice.profitmandi.dao.model.LastMonthCreditedIncomeModel(foi.brand,sum(cast(foi.quantity As int)), sum(cast(foi.sellingPrice As int )-cast(foi.dp As int ))) "
71
				+ " from InventoryItem ii join ScanRecord sr on sr.inventoryItemId=ii.id join FofoOrder fo on fo.id=sr.orderId join FofoOrderItem foi on foi.orderId=fo.id where "
72
				+ " fo.cancelledTimestamp is null and sr.type='SALE' and sr.createTimestamp >=:startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId group by foi.brand"),
73
 
74
        @NamedQuery(name = "SchemeInOut.selectLastMonthPendingIncomeByFofoId", query = "select new com.spice.profitmandi.dao.model.LastMonthCreditedIncomeModel(foi.brand,sum(cast(foi.quantity As int)),sum(cast(sio.amount As int ))) from "
75
				+ "  ScanRecord sr join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on  sio.inventoryItemId=sr.inventoryItemId  join FofoOrderItem foi on  foi.orderId=fo.id where  fo.cancelledTimestamp is null and "
76
				+ "  sio.status='PENDING' and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId group by foi.brand"),
77
 
78
		@NamedQuery(name = "SchemeInOut.selectLastMonthPurchaseInMarginByFofoId", query = "select new com.spice.profitmandi.dao.model.LastMonthCreditedIncomeModel(i.brand, count(distinct ii.id ),sum(cast(sio.amount As int ))) from InventoryItem ii join SchemeInOut sio on"
79
				+ "  sio.inventoryItemId=ii.id join Scheme sc on sc.id=sio.schemeId join Item i on i.id=ii.itemId where sio.status='CREDITED' and sc.type= 'IN' and ii.fofoId = :fofoId and ii.createTimestamp >= :startDate and "
80
				+ "  ii.createTimestamp <= :endDate group by i.brand"),
30243 tejbeer 81
 
82
 
83
 
84
 
85
		@NamedQuery(name = "SchemeInOut.selectLastMonthBrandWiseIncome", query = "select new com.spice.profitmandi.dao.model.LastMonthBrandWiseIncomeModel(i.brand,sum(case when sio.status = 'CREDITED' then cast(foi.quantity As int) else 0 end),sum(case when sio.status = 'CREDITED' then cast(sio.amount As float) else  0 end),sum(case when sio.status = 'PENDING' then cast(sio.amount As float) else  0 end),i.catalogItemId,i.modelName,i.modelNumber,sio.status) from ScanRecord sr "
86
		        + "  join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on sio.inventoryItemId=sr.inventoryItemId join FofoOrderItem foi on foi.orderId=fo.id  join FofoLineItem  fli on fli.fofoOrderItemId=foi.id  join  Item i on i.id=foi.itemId join Scheme sc on sc.id=sio.schemeId   where   sc.type != 'IN' and fo.cancelledTimestamp is null and "
87
		        + "  (sio.status='CREDITED' or sio.status='PENDING') and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId  and foi.brand = :brand group by i.catalogItemId,i.modelName,i.modelNumber,i.brand"),
29578 tejbeer 88
 
30243 tejbeer 89
		@NamedQuery(name = "SchemeInOut.selectFrontIncomeBrandWise", query = "select new com.spice.profitmandi.dao.model.LastMonthFrontEndBrandWiseIncome(i.brand,sum(cast(foi.quantity As int)),sum(cast(foi.sellingPrice -foi.dp As float)),0.0,i.catalogItemId,i.modelName,i.modelNumber) "
30050 manish 90
					+ " from InventoryItem ii join ScanRecord sr on sr.inventoryItemId=ii.id join FofoOrder fo on fo.id=sr.orderId join FofoOrderItem foi on foi.orderId=fo.id join Item i on foi.itemId=i.id where "
91
					+ " fo.cancelledTimestamp is null and sr.type='SALE' and sr.createTimestamp >=:startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId and foi.brand = :brand group by i.catalogItemId,i.modelName,i.modelNumber,i.brand"),
92
 
30243 tejbeer 93
		@NamedQuery(name = "SchemeInOut.selectLastMonthPurchaseBrandWiseIncome", query = "select new com.spice.profitmandi.dao.model.LastMonthBrandWiseIncomeModel( i.brand ,count(distinct ii.id),sum(cast(sio.amount As float)) ,0.0,i.catalogItemId,i.modelName,i.modelNumber,sio.status) from"
30050 manish 94
				+ "  InventoryItem ii join SchemeInOut sio on sio.inventoryItemId=ii.id join Scheme sc on sc.id=sio.schemeId join Item i on i.id=ii.itemId where sio.status='CREDITED' and "
95
				+ "  sc.type= 'IN' and ii.fofoId = :fofoId and i.brand= :brand and ii.createTimestamp >= :startDate and ii.createTimestamp <= :endDate group by i.catalogItemId,i.modelName,i.modelNumber,i.brand "),
96
 
97
 
30243 tejbeer 98
 
99
 
100
 
101
		@NamedQuery(name = "SchemeInOut.selectLastMonthCreditedImei", query = "select new com.spice.profitmandi.dao.model.LastMonthImeiModel(fli.serialNumber,(case when sio.status='CREDITED' then sio.amount else 0 end),(case when sio.status='PENDING' then sio.amount else 0 end),sc.description,sr.createTimestamp,sio.status)from ScanRecord sr "
30050 manish 102
				+ "      join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on sio.inventoryItemId=sr.inventoryItemId join FofoOrderItem foi on foi.orderId=fo.id  join FofoLineItem  fli on fli.fofoOrderItemId=foi.id "
30243 tejbeer 103
				+ "      join  Item i on i.id=foi.itemId join Scheme sc on sc.id=sio.schemeId   where   sc.type != 'IN' and fo.cancelledTimestamp is null and (sio.status='CREDITED' or sio.status='PENDING' ) and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and "
30050 manish 104
				+ "      i.catalogItemId= :catalogItemId and sr.fofoId = :fofoId"),
105
 
30243 tejbeer 106
		@NamedQuery(name = "SchemeInOut.selectLastMonthPurchaseInImei", query = "select new com.spice.profitmandi.dao.model.LastMonthImeiModel(ii.serialNumber,sio.amount,cast(0.0 As float),sc.description,ii.createTimestamp,sio.status) from InventoryItem ii "
30050 manish 107
				+ "     join SchemeInOut sio on sio.inventoryItemId=ii.id join Scheme sc on sc.id=sio.schemeId join Item i on i.id=ii.itemId where sio.status='CREDITED' and sc.type= 'IN' and ii.fofoId = :fofoId and "
108
				+ "     i.catalogItemId= :catalogItemId and ii.createTimestamp >= :startDate and ii.createTimestamp <= :endDate"),
109
 
110
 
111
		@NamedQuery(name = "SchemeInOut.selectLastMonthFrontEndImei", query = "select new com.spice.profitmandi.dao.model.LastMonthFrontEndImeiModel( ii.serialNumber,foi.sellingPrice -foi.dp) from InventoryItem ii "
112
				+ "      join ScanRecord sr on sr.inventoryItemId=ii.id join FofoOrder fo on fo.id=sr.orderId join FofoOrderItem foi on foi.orderId=fo.id join Item i on foi.itemId=i.id where "
113
				+ "     fo.cancelledTimestamp is null and sr.type='SALE' and i.catalogItemId= :catalogItemId and sr.createTimestamp >=:startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId "
114
				+ "     group by ii.id"),
115
 
30243 tejbeer 116
		@NamedQuery(name = "SchemeInOut.selectLastMonthCreditedByImei", query = "select new com.spice.profitmandi.dao.model.LastMonthImeiModel(fli.serialNumber,(case when sio.status='CREDITED' then sio.amount else 0 end),(case when sio.status='PENDING' then sio.amount else 0 end),sc.description,sr.createTimestamp,sio.status)from ScanRecord sr "
30050 manish 117
				+ "      join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on sio.inventoryItemId=sr.inventoryItemId join FofoOrderItem foi on foi.orderId=fo.id  join FofoLineItem  fli on fli.fofoOrderItemId=foi.id "
30243 tejbeer 118
				+ "      join  Item i on i.id=foi.itemId join Scheme sc on sc.id=sio.schemeId   where   sc.type != 'IN' and fo.cancelledTimestamp is null and (sio.status='CREDITED' or sio.status='PENDING') and sr.type='SALE' and "
30050 manish 119
				+ "      fli.serialNumber in :imeis and sr.fofoId = :fofoId"),
120
 
30243 tejbeer 121
		@NamedQuery(name = "SchemeInOut.selectLastMonthPurchaseInByImei", query = "select new com.spice.profitmandi.dao.model.LastMonthImeiModel(ii.serialNumber,sio.amount, cast(0.0 As float) ,sc.description,ii.createTimestamp,sio.status) from InventoryItem ii "
30050 manish 122
				+ "     join SchemeInOut sio on sio.inventoryItemId=ii.id join Scheme sc on sc.id=sio.schemeId join Item i on i.id=ii.itemId where sio.status='CREDITED' and sc.type= 'IN' and ii.fofoId = :fofoId and "
123
				+ "     ii.serialNumber in :imeis"),
124
 
125
		@NamedQuery(name = "SchemeInOut.selectLastMonthFrontEndByImei", query = "select new com.spice.profitmandi.dao.model.LastMonthFrontEndImeiModel( ii.serialNumber,foi.sellingPrice -foi.dp) from InventoryItem ii "
126
				+ "      join ScanRecord sr on sr.inventoryItemId=ii.id join FofoOrder fo on fo.id=sr.orderId join FofoOrderItem foi on foi.orderId=fo.id join Item i on foi.itemId=i.id where "
127
				+ "     fo.cancelledTimestamp is null and sr.type='SALE' and ii.serialNumber in (:imeis) and sr.fofoId = :fofoId  group by ii.id"),
128
 
30243 tejbeer 129
 
130
 
131
 
132
 
133
 
30050 manish 134
		@NamedQuery(name = "SchemeInOut.selectLastMonthCategoryUpgradeMarginByBrand", query = "select new com.spice.profitmandi.dao.model.LastMonthCategoryUpgradeMargin(foi.brand, sum(case when sio.status='REJECTED' then -sio.amount else sio.amount end) ) from ScanRecord sr "
135
		        + " join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on sio.inventoryItemId=sr.inventoryItemId join FofoOrderItem foi on foi.orderId=fo.id join Scheme sc on sc.id=sio.schemeId   where   sc.type = 'CATEGORY' and fo.cancelledTimestamp is null "
136
		       +  "  and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId group by foi.brand"),
137
 
138
		@NamedQuery(name = "SchemeInOut.selectLastMonthCategoryUpgradeMarginByBrandModel", query = "select new com.spice.profitmandi.dao.model.LastMonthCategoryUpgradeMargin(i.modelNumber,sum(case when sio.status='REJECTED' then -sio.amount else sio.amount end)) from ScanRecord sr "
139
		        + " join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on sio.inventoryItemId=sr.inventoryItemId join FofoOrderItem foi on foi.orderId=fo.id  join FofoLineItem  fli on fli.fofoOrderItemId=foi.id  join  Item i on i.id=foi.itemId join Scheme sc on sc.id=sio.schemeId   where   sc.type = 'CATEGORY' and fo.cancelledTimestamp is null and "
140
		       +  " sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and sr.fofoId = :fofoId  and foi.brand = :brand group by i.catalogItemId,i.modelName,i.modelNumber,i.brand"),
141
 
142
		@NamedQuery(name = "SchemeInOut.selectLastMonthCategoryUpgradeMarginByImei", query = "select new com.spice.profitmandi.dao.model.LastMonthCategoryUpgradeMargin(fli.serialNumber,sum(case when sio.status='REJECTED' then -sio.amount else sio.amount end) ) from ScanRecord sr "
143
				+ "      join FofoOrder fo on fo.id=sr.orderId join SchemeInOut sio on sio.inventoryItemId=sr.inventoryItemId join FofoOrderItem foi on foi.orderId=fo.id  join FofoLineItem  fli on fli.fofoOrderItemId=foi.id "
144
				+ "      join  Item i on i.id=foi.itemId join Scheme sc on sc.id=sio.schemeId   where sc.type = 'CATEGORY' and fo.cancelledTimestamp is null and sr.type='SALE' and sr.createTimestamp >= :startDate and sr.createTimestamp <= :endDate and "
145
				+ "      i.catalogItemId= :catalogItemId and sr.fofoId = :fofoId group by fli.serialNumber"),
146
 
29578 tejbeer 147
})
27377 amit.gupta 148
public class SchemeInOut implements Serializable {
149
 
24592 amit.gupta 150
	public SchemeInOut(int schemeId, int inventoryItemId) {
151
		this.schemeId = schemeId;
152
		this.inventoryItemId = inventoryItemId;
153
	}
22653 ashik.ali 154
 
24592 amit.gupta 155
	public SchemeInOut() {
156
	}
27377 amit.gupta 157
 
22653 ashik.ali 158
	private static final long serialVersionUID = 1L;
24592 amit.gupta 159
 
22859 ashik.ali 160
	@Id
23968 amit.gupta 161
	@GeneratedValue(strategy = GenerationType.IDENTITY)
162
	private int id;
24592 amit.gupta 163
 
22859 ashik.ali 164
	@Column(name = "scheme_id")
165
	private int schemeId;
22653 ashik.ali 166
 
22859 ashik.ali 167
	@Column(name = "inventory_item_id")
168
	private int inventoryItemId;
24592 amit.gupta 169
 
22653 ashik.ali 170
	@Column(name = "amount")
171
	private float amount;
24592 amit.gupta 172
 
27377 amit.gupta 173
	@Column(name = "status")
174
	@Enumerated(EnumType.STRING)
175
	private SchemePayoutStatus status;
176
 
23345 ashik.ali 177
	@Column(name = "create_timestamp")
23339 ashik.ali 178
	private LocalDateTime createTimestamp = LocalDateTime.now();
24592 amit.gupta 179
 
23509 amit.gupta 180
	@Column(name = "rolled_back_timestamp")
23527 ashik.ali 181
	private LocalDateTime rolledBackTimestamp;
27377 amit.gupta 182
 
183
	@Column(name = "credit_timestamp")
184
	private LocalDateTime creditTimestamp;
185
 
27381 amit.gupta 186
	@Column(name = "description")
27377 amit.gupta 187
	private String statusDescription;
188
 
189
	public int getId() {
190
		return id;
191
	}
192
 
193
	public void setId(int id) {
194
		this.id = id;
195
	}
196
 
197
	public SchemePayoutStatus getStatus() {
198
		return status;
199
	}
200
 
201
	public void setStatus(SchemePayoutStatus status) {
202
		this.status = status;
203
	}
204
 
205
	public LocalDateTime getCreditTimestamp() {
206
		return creditTimestamp;
207
	}
208
 
209
	public void setCreditTimestamp(LocalDateTime creditTimestamp) {
210
		this.creditTimestamp = creditTimestamp;
211
	}
212
 
213
	public String getStatusDescription() {
214
		return statusDescription;
215
	}
216
 
217
	public void setStatusDescription(String statusDescription) {
218
		this.statusDescription = statusDescription;
219
	}
220
 
24592 amit.gupta 221
	@Transient
24671 amit.gupta 222
	private int reference;
27377 amit.gupta 223
 
24671 amit.gupta 224
	public int getReference() {
225
		return reference;
226
	}
227
 
228
	public void setReference(int reference) {
229
		this.reference = reference;
230
	}
231
 
232
	@Transient
24592 amit.gupta 233
	private String serialNumber;
27377 amit.gupta 234
 
24592 amit.gupta 235
	@Transient
236
	private String storeCode;
27377 amit.gupta 237
 
24592 amit.gupta 238
	@Transient
239
	private SchemeType schemeType;
23509 amit.gupta 240
 
24592 amit.gupta 241
	public String getStoreCode() {
242
		return storeCode;
243
	}
244
 
245
	public void setStoreCode(String storeCode) {
246
		this.storeCode = storeCode;
247
	}
248
 
249
	public SchemeType getSchemeType() {
250
		return schemeType;
251
	}
252
 
253
	public void setSchemeType(SchemeType schemeType) {
254
		this.schemeType = schemeType;
255
	}
256
 
257
	public String getSerialNumber() {
258
		return serialNumber;
259
	}
260
 
261
	public void setSerialNumber(String serialNumber) {
262
		this.serialNumber = serialNumber;
263
	}
264
 
22859 ashik.ali 265
	public int getSchemeId() {
266
		return schemeId;
22653 ashik.ali 267
	}
24592 amit.gupta 268
 
22859 ashik.ali 269
	public void setSchemeId(int schemeId) {
270
		this.schemeId = schemeId;
22653 ashik.ali 271
	}
24592 amit.gupta 272
 
22859 ashik.ali 273
	public int getInventoryItemId() {
274
		return inventoryItemId;
275
	}
24592 amit.gupta 276
 
22859 ashik.ali 277
	public void setInventoryItemId(int inventoryItemId) {
278
		this.inventoryItemId = inventoryItemId;
279
	}
24592 amit.gupta 280
 
22653 ashik.ali 281
	public float getAmount() {
282
		return amount;
283
	}
24592 amit.gupta 284
 
22653 ashik.ali 285
	public void setAmount(float amount) {
286
		this.amount = amount;
287
	}
24592 amit.gupta 288
 
23339 ashik.ali 289
	public LocalDateTime getCreateTimestamp() {
290
		return createTimestamp;
291
	}
24592 amit.gupta 292
 
23339 ashik.ali 293
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
294
		this.createTimestamp = createTimestamp;
295
	}
24592 amit.gupta 296
 
23527 ashik.ali 297
	public LocalDateTime getRolledBackTimestamp() {
298
		return rolledBackTimestamp;
299
	}
24592 amit.gupta 300
 
23527 ashik.ali 301
	public void setRolledBackTimestamp(LocalDateTime rolledBackTimestamp) {
302
		this.rolledBackTimestamp = rolledBackTimestamp;
303
	}
22859 ashik.ali 304
 
22653 ashik.ali 305
	@Override
306
	public int hashCode() {
307
		final int prime = 31;
308
		int result = 1;
22859 ashik.ali 309
		result = prime * result + Float.floatToIntBits(amount);
23339 ashik.ali 310
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
24592 amit.gupta 311
		result = prime * result + id;
22859 ashik.ali 312
		result = prime * result + inventoryItemId;
24592 amit.gupta 313
		result = prime * result + ((rolledBackTimestamp == null) ? 0 : rolledBackTimestamp.hashCode());
22859 ashik.ali 314
		result = prime * result + schemeId;
24592 amit.gupta 315
		result = prime * result + ((schemeType == null) ? 0 : schemeType.hashCode());
316
		result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
22653 ashik.ali 317
		return result;
318
	}
22859 ashik.ali 319
 
22653 ashik.ali 320
	@Override
321
	public boolean equals(Object obj) {
322
		if (this == obj)
323
			return true;
324
		if (obj == null)
325
			return false;
326
		if (getClass() != obj.getClass())
327
			return false;
22859 ashik.ali 328
		SchemeInOut other = (SchemeInOut) obj;
329
		if (Float.floatToIntBits(amount) != Float.floatToIntBits(other.amount))
22653 ashik.ali 330
			return false;
23339 ashik.ali 331
		if (createTimestamp == null) {
332
			if (other.createTimestamp != null)
333
				return false;
334
		} else if (!createTimestamp.equals(other.createTimestamp))
335
			return false;
24592 amit.gupta 336
		if (id != other.id)
337
			return false;
22859 ashik.ali 338
		if (inventoryItemId != other.inventoryItemId)
339
			return false;
24592 amit.gupta 340
		if (rolledBackTimestamp == null) {
341
			if (other.rolledBackTimestamp != null)
342
				return false;
343
		} else if (!rolledBackTimestamp.equals(other.rolledBackTimestamp))
344
			return false;
22859 ashik.ali 345
		if (schemeId != other.schemeId)
346
			return false;
24592 amit.gupta 347
		if (schemeType != other.schemeType)
348
			return false;
349
		if (serialNumber == null) {
350
			if (other.serialNumber != null)
351
				return false;
352
		} else if (!serialNumber.equals(other.serialNumber))
353
			return false;
22653 ashik.ali 354
		return true;
355
	}
356
 
357
	@Override
358
	public String toString() {
24592 amit.gupta 359
		return "SchemeInOut [id=" + id + ", schemeId=" + schemeId + ", inventoryItemId=" + inventoryItemId + ", amount="
27377 amit.gupta 360
				+ amount + ", status=" + status + ", createTimestamp=" + createTimestamp + ", rolledBackTimestamp="
361
				+ rolledBackTimestamp + ", creditTimestamp=" + creditTimestamp + ", statusDescription="
362
				+ statusDescription + ", reference=" + reference + ", serialNumber=" + serialNumber + ", storeCode="
363
				+ storeCode + ", schemeType=" + schemeType + "]";
22653 ashik.ali 364
	}
24592 amit.gupta 365
 
22653 ashik.ali 366
}