Subversion Repositories SmartDukaan

Rev

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