Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21714 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
21596 ashik.ali 2
 
30641 amit.gupta 3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
4
 
5
import javax.persistence.*;
21596 ashik.ali 6
import java.io.Serializable;
25726 amit.gupta 7
import java.time.LocalDate;
21596 ashik.ali 8
import java.time.LocalDateTime;
22243 ashik.ali 9
import java.time.format.DateTimeFormatter;
21596 ashik.ali 10
 
11
@Entity
27579 tejbeer 12
@Table(name = "fofo.fofo_order", schema = "fofo")
21596 ashik.ali 13
 
27579 tejbeer 14
@NamedQueries({
15
 
16
		@NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand,"
27586 tejbeer 17
				+ "foi.modelName, foi.modelNumber, foi.color, foi.quantity, foi.mop)"
27579 tejbeer 18
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId"
19
				+ " and fo.createTimestamp between :startDate and :endDate"),
20
 
30641 amit.gupta 21
		@NamedQuery(name = "FofoOrder.selectOrderByModelsAndSaleBetween", query = "select fo from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId"
22
				+ " join Item i on i.id=foi.itemId where fo.cancelledTimestamp is null and i.catalogItemId in :catalogItemIds"
23
				+ " and fo.createTimestamp between :startDate and :endDate"),
24
 
27723 tejbeer 25
		@NamedQuery(name = "FofoOrder.selectGroupByBrandPartnerTertiary", query = "select new com.spice.profitmandi.dao.model.BrandWiseTertiaryModel(foi.brand, "
26
				+ "sum(case when foi.createTimestamp >= :today then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27728 tejbeer 27
				+ "sum(case when foi.createTimestamp >= :threedays  and foi.createTimestamp < :endDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27723 tejbeer 28
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
29
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27748 tejbeer 30
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmsEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27723 tejbeer 31
				+ "sum(case when foi.createTimestamp >= :today then foi.quantity else 0 end),"
27728 tejbeer 32
				+ "sum(case when foi.createTimestamp >= :threedays and foi.createTimestamp < :endDate then foi.quantity else 0 end),"
27723 tejbeer 33
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
27748 tejbeer 34
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end),"
35
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmsEndDate  then foi.quantity else 0 end)"
36
				+ "	)"
37
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId "
38
				+ "  where fo.cancelledTimestamp is null and fs.active = true "
27723 tejbeer 39
				+ " and foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId"
27748 tejbeer 40
				+ " group by foi.brand "),
27723 tejbeer 41
 
27738 tejbeer 42
		@NamedQuery(name = "FofoOrder.selectItemPartnerTertiaryByBrand", query = "select new com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel(foi.brand, i.modelName,"
43
				+ " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)"
44
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join "
27748 tejbeer 45
				+ " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
46
				+ " and foi.createTimestamp >= :startDate and foi.createTimestamp < :endDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
27738 tejbeer 47
 
48
		@NamedQuery(name = "FofoOrder.selectTodayItemPartnerTertiaryByBrand", query = "select new com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel(foi.brand, i.modelName,"
49
				+ " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)"
50
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join "
27748 tejbeer 51
				+ " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
52
				+ " and foi.createTimestamp >= :startDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
27738 tejbeer 53
 
28008 tejbeer 54
		@NamedQuery(name = "FofoOrder.selectValueOfActivatedImeis", query = "select new com.spice.profitmandi.common.model.ActivatedImeisWithSellingPrice("
55
				+ "  fo.fofoId, foi.brand, sum(CAST(foi.mop  AS int) * foi.quantity)) "
56
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId join FofoLineItem fli on foi.id = fli.fofoOrderItemId join ActivatedImei ai on "
57
				+ " fli.serialNumber = ai.serialNumber where  fo.createTimestamp between :startDate and :endDate and  fo.fofoId = :fofoId and fo.cancelledTimestamp is null group by foi.brand"),
28020 tejbeer 58
 
28004 tejbeer 59
		@NamedQuery(name = "FofoOrder.selectPartnersSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
28020 tejbeer 60
				+ "  fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end))"
28004 tejbeer 61
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
62
				+ " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId "
63
				+ " join Item i on i.id = tl.itemId"
28020 tejbeer 64
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and  i.categoryId=10006 group by fs.id"),
27884 tejbeer 65
 
28004 tejbeer 66
		@NamedQuery(name = "FofoOrder.selectPartnersSaleByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
28020 tejbeer 67
				+ " fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
28004 tejbeer 68
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
69
				+ " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId "
70
				+ " join Item i on i.id = tl.itemId"
71
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null "
72
				+ " and fo.createTimestamp > :startDate and tl.mop between :startPrice and :endPrice and  i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
73
 
28032 tejbeer 74
		@NamedQuery(name = "FofoOrder.selectPartnersSaleItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
75
				+ "  fs.warehouseId, fs.id,sum(foi.quantity),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
76
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
77
				+ " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId "
78
				+ " join Item i on i.id = tl.itemId"
79
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and  i.categoryId=10006 and fs.id = :fofoId group by i.catalogItemId, i.brand,i.modelName,i.modelNumber"),
80
 
28474 tejbeer 81
		@NamedQuery(name = "FofoOrder.selectSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
82
				+ "  fs.warehouseId, fs.id,i.catalogItemId, sum(case when foi.quantity is null then 0 else  foi.quantity end))"
83
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
84
				+ " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId "
85
				+ " join Item i on i.id = tl.itemId"
28477 tejbeer 86
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId and  i.categoryId=10006 group by i.catalogItemId, fs.id"),
28474 tejbeer 87
 
31008 amit.gupta 88
 
30160 manish 89
		@NamedQuery(name = "FofoOrder.selectFocoSaleReport", query = "select new com.spice.profitmandi.dao.model.FocoSaleReportModel(fs.code, ua.name,ua.city, ua.state, w.displayName, foi.itemId,"
90
				+ " foi.brand, foi.modelName, foi.modelNumber, foi.color, foi.quantity, cast(foi.dp As int), cast(foi.sellingPrice As int), cast(foi.mop As int), fli.serialNumber, foi.createTimestamp, ca.name, ca.phoneNumber,"
91
				+ " ca.city, ca.pinCode, fo.invoiceNumber, p.purchaseReference, fo.customerGstNumber, fo.cancelledTimestamp, p.completeTimestamp, hd.hygieneRating,hd.rating, hd.status, hd.remark,"
92
				+ " hd.createdTimestamp, hd.disposedTimestamp, hd.nextTimestamp, ai.activationTimestamp, ai.createTimestamp, c.label)"
93
				+ " from FofoStore fs join Warehouse w on w.id=fs.warehouseId join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join Address ua on u.addressId = ua.id join FofoOrder fo on fo.fofoId=fs.id left join FofoOrderItem foi"
94
				+ " on foi.orderId=fo.id join Item i on i.id=foi.itemId join Category c on c.id=i.categoryId left join CustomerAddress ca on ca.id=fo.customerAddressId left join FofoLineItem fli on fli.fofoOrderItemId=foi.id"
95
				+ " left join InventoryItem ii on ii.id=fli.inventoryItemId left join Purchase p on ii.purchaseId=p.id left join HygieneData hd on hd.orderId=fo.id left join ActivatedImei ai on ai.serialNumber=fli.serialNumber"
96
				+ " where 1=1 and (foi.createTimestamp between :startDate and :endDate or foi.createTimestamp is null) and fs.code= :code and fs.id=:fofoId  group by fo.id "),
97
 
31008 amit.gupta 98
		@NamedQuery(name = "FofoOrder.selectFocoSaleReportByBrand", query = "select new com.spice.profitmandi.dao.model.FocoSaleReportModel(fs.code, ua.name,ua.city, ua.state, w.displayName, foi.itemId,"
99
				+ " foi.brand, foi.modelName, foi.modelNumber, foi.color, foi.quantity, cast(foi.dp As int), cast(foi.sellingPrice As int), cast(foi.mop As int), fli.serialNumber, foi.createTimestamp, ca.name, ca.phoneNumber,"
100
				+ " ca.city, ca.pinCode, fo.invoiceNumber, p.purchaseReference, fo.customerGstNumber, fo.cancelledTimestamp, p.completeTimestamp, hd.hygieneRating,hd.rating, hd.status, hd.remark,"
101
				+ " hd.createdTimestamp, hd.disposedTimestamp, hd.nextTimestamp, ai.activationTimestamp, ai.createTimestamp, c.label)"
102
				+ " from FofoStore fs join Warehouse w on w.id=fs.warehouseId join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join Address ua on u.addressId = ua.id join FofoOrder fo on fo.fofoId=fs.id left join FofoOrderItem foi"
103
				+ " on foi.orderId=fo.id join Item i on i.id=foi.itemId join Category c on c.id=i.categoryId left join CustomerAddress ca on ca.id=fo.customerAddressId left join FofoLineItem fli on fli.fofoOrderItemId=foi.id"
104
				+ " left join InventoryItem ii on ii.id=fli.inventoryItemId left join Purchase p on ii.purchaseId=p.id left join HygieneData hd on hd.orderId=fo.id left join ActivatedImei ai on ai.serialNumber=fli.serialNumber"
105
				+ " where (foi.createTimestamp between :startDate and :endDate or foi.createTimestamp is null) and fs.id=:fofoId and i.brand=:brand group by fo.id "),
106
 
107
		@NamedQuery(name = "FofoOrder.selectWalletSummaryReport", query = "select new com.spice.profitmandi.dao.model.WalletSummaryReportModel(uwh.id, fs.code, ua.name, "
30160 manish 108
				+ " u.emailId, ua.phoneNumber, uwh.amount, uwh.refundableAmount, uwh.reference, uwh.referenceType, uwh.timestamp, uwh.businessTimestamp, uwh.description)"
109
				+ " from FofoStore fs join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join"
110
				+ " Address ua on u.addressId=ua.id join UserWallet uw on  uw.userId=fs.id join UserWalletHistory uwh on uwh.walletId=uw.id "
111
				+ " where 1=1 and uwh.timestamp between :startDate and :endDate and fs.id=:fofoId group by uwh.timestamp"),
112
 
31008 amit.gupta 113
 
114
		@NamedQuery(name = "FofoOrder.selectPendingIndentReport", query = "select new com.spice.profitmandi.dao.model.PendingIndentReportModel(o.transactionId , o.id, o.createTimestamp,"
30160 manish 115
				+ "  l.itemId, l.brand, l.modelName, l.modelNumber, l.color, l.quantity, l.unitPrice, o.walletAmount,case o.status when 3 then  'In Process' when 4  then 'Accepted' "
116
		        + "  when 7  then 'Billed' when 9   then 'Shipped' when 12  then 'Delivered' when 13  then 'Cancellation in process' when 15 then 'Cancelled,amount refunded to wallet' "
117
		        + "  when 31  then 'Returned to Origin, refunded' when 34 then 'Low inventory cancellation, refunded' "
118
		        + "  else o.statusDescription end as Description, o.invoiceNumber, o.billingTimestamp ) from Order o join LineItem l on l.orderId=o.id "
119
		        + "  where o.partnerGrnTimestamp is null and o.retailerId= :fofoId and o.status != 1 and o.createTimestamp between :startDate and :endDate group by o.status,o.createTimestamp "),
120
 
121
	    @NamedQuery(name = "FofoOrder.selectSchemePayoutReport", query = "select new com.spice.profitmandi.dao.model.SchemePayoutReportModel(i.id, i.brand, i.modelName, i.modelNumber,"
122
	   		   + " i.color,ii.unitPrice-ii.priceDropAmount,foi.dp, s.id, s.name, s.type, s.amountType, s.amount,p.purchaseReference, fo.invoiceNumber,(case when sio.rolledBackTimestamp is null "
30195 manish 123
	   		   + " then sio.amount when sio.rolledBackTimestamp  is not null then 0 end),sio.status, sio.statusDescription, sio.createTimestamp, sio.rolledBackTimestamp, ii.serialNumber ) from "
124
	   		   + " SchemeInOut sio join InventoryItem ii on sio.inventoryItemId=ii.id join com.spice.profitmandi.dao.entity.catalog.Item i on i.id=ii.itemId join FofoStore fs on fs.id=ii.fofoId "
125
	   		   + " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address ua on u.addressId = ua.id join Scheme s on sio.schemeId=s.id join Purchase p on p.id=ii.purchaseId"
126
	   		   + " left join FofoLineItem fli on fli.inventoryItemId=ii.id left join FofoOrderItem foi on foi.id=fli.fofoOrderItemId left join FofoOrder fo on fo.id=foi.orderId where  foi.createTimestamp"
127
	   		   + " between :startDate and :endDate and ii.fofoId= :fofoId "),
30160 manish 128
 
129
	    @NamedQuery(name = "FofoOrder.selectInvoiceSchemeOutSummaryReport", query = "select new com.spice.profitmandi.dao.model.FocoSchemeOutReportModel(fo.invoiceNumber, foi.quantity, foi.brand,"
130
	    		+ " foi.modelName, foi.modelNumber, foi.color,  sum(cast(sio.amount As float)) ) FROM FofoOrderItem foi join FofoOrder fo on fo.id=foi.orderId join FofoLineItem fli on "
131
	    		+ " fli.fofoOrderItemId=foi.id join SchemeInOut sio on sio.inventoryItemId=fli.inventoryItemId join Scheme s on s.id=sio.schemeId where s.type ='IN' and fo.fofoId= :fofoId and"
132
	    		+ " fo.createTimestamp between :startDate and :endDate and sio.rolledBackTimestamp is null group by fo.id, foi.id "),
133
 
134
 
30178 manish 135
	    @NamedQuery(name = "FofoOrder.selectPartnerBillingSummaryReport", query = "select new com.spice.profitmandi.dao.model.PartnerBillingSummaryModel(o.id,  o.createTimestamp, o.billingTimestamp,"
136
	    		+ " o.deliveryTimestamp, o.partnerGrnTimestamp, o.transactionId, case when o.logisticsTransactionId is null then 'NA' else o.logisticsTransactionId end,o.airwayBillNumber,  "
137
	    		+ " os.statusSubGroup, os.statusName, o.retailerId, o.retailerName, i.id, i.brand, i.modelName, i.modelNumber, i.color, l.unitPrice, l.quantity, l.totalPrice,  o.invoiceNumber,"
138
	    		+ " l.igstRate, l.cgstRate, l.sgstRate ) From Order o join LineItem l on l.orderId = o.id join Item i on l.itemId = i.id join Category c on i.categoryId = c.id join OrderStatus os on os.status=o.status"
139
	    		+ " join FofoStore fs on fs.id=o.retailerId where 1=1 and  o.billingTimestamp between :startDate and :endDate and o.retailerId = :fofoId "),
140
 
27579 tejbeer 141
})
142
public class FofoOrder implements Serializable {
143
 
21596 ashik.ali 144
	private static final long serialVersionUID = 1L;
145
 
146
	@Id
147
	@Column(name = "id")
148
	@GeneratedValue(strategy = GenerationType.IDENTITY)
149
	private int id;
27579 tejbeer 150
 
21596 ashik.ali 151
	@Column(name = "fofo_id")
152
	private int fofoId;
27579 tejbeer 153
 
21596 ashik.ali 154
	@Column(name = "customer_id")
155
	private int customerId;
27579 tejbeer 156
 
21710 ashik.ali 157
	@Column(name = "customer_address_id")
158
	private int customerAddressId;
27579 tejbeer 159
 
23369 ashik.ali 160
	@Column(name = "customer_gst_number")
161
	private String customerGstNumber;
27579 tejbeer 162
 
21596 ashik.ali 163
	@Column(name = "total_amount")
164
	private float totalAmount;
27579 tejbeer 165
 
21609 ashik.ali 166
	@Column(name = "invoice_number", length = 50)
21596 ashik.ali 167
	private String invoiceNumber;
27579 tejbeer 168
 
22859 ashik.ali 169
	@Column(name = "cashback")
170
	private float cashback;
27579 tejbeer 171
 
22009 ashik.ali 172
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21596 ashik.ali 173
	@Column(name = "create_timestamp")
27579 tejbeer 174
	private LocalDateTime createTimestamp = LocalDateTime.now();
175
 
24264 amit.gupta 176
	@Convert(converter = LocalDateTimeAttributeConverter.class)
177
	@Column(name = "cancelled_timestamp")
27579 tejbeer 178
	private LocalDateTime cancelledTimestamp;
179
 
180
	// @Convert(converter = LocalDateTimeAttributeConverter.class)
181
	// @Column(name = "billing_timestamp")
25083 amit.gupta 182
	@Transient
27579 tejbeer 183
	private LocalDateTime billingTimestamp;
184
 
26817 amit.gupta 185
	@Transient
25083 amit.gupta 186
	private FofoOrderItem orderItem;
27579 tejbeer 187
 
25726 amit.gupta 188
	@Transient
189
	private LocalDate dateOfBirth;
27579 tejbeer 190
 
25726 amit.gupta 191
	public LocalDate getDateOfBirth() {
192
		return dateOfBirth;
193
	}
27579 tejbeer 194
 
25726 amit.gupta 195
	public void setDateOfBirth(LocalDate dateOfBirth) {
196
		this.dateOfBirth = dateOfBirth;
197
	}
27579 tejbeer 198
 
25083 amit.gupta 199
	public FofoOrderItem getOrderItem() {
200
		return orderItem;
201
	}
27579 tejbeer 202
 
25083 amit.gupta 203
	public void setOrderItem(FofoOrderItem orderItem) {
204
		this.orderItem = orderItem;
205
	}
27579 tejbeer 206
 
24264 amit.gupta 207
	public LocalDateTime getCancelledTimestamp() {
208
		return cancelledTimestamp;
209
	}
27579 tejbeer 210
 
24264 amit.gupta 211
	public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
212
		this.cancelledTimestamp = cancelledTimestamp;
213
	}
27579 tejbeer 214
 
21984 kshitij.so 215
	public int getId() {
216
		return id;
217
	}
27579 tejbeer 218
 
21984 kshitij.so 219
	public void setId(int id) {
220
		this.id = id;
221
	}
27579 tejbeer 222
 
21984 kshitij.so 223
	public int getFofoId() {
224
		return fofoId;
225
	}
27579 tejbeer 226
 
21984 kshitij.so 227
	public void setFofoId(int fofoId) {
228
		this.fofoId = fofoId;
229
	}
27579 tejbeer 230
 
21984 kshitij.so 231
	public int getCustomerId() {
232
		return customerId;
233
	}
27579 tejbeer 234
 
21984 kshitij.so 235
	public void setCustomerId(int customerId) {
236
		this.customerId = customerId;
237
	}
27579 tejbeer 238
 
21984 kshitij.so 239
	public int getCustomerAddressId() {
240
		return customerAddressId;
241
	}
27579 tejbeer 242
 
21984 kshitij.so 243
	public void setCustomerAddressId(int customerAddressId) {
244
		this.customerAddressId = customerAddressId;
245
	}
27579 tejbeer 246
 
23369 ashik.ali 247
	public String getCustomerGstNumber() {
248
		return customerGstNumber;
249
	}
27579 tejbeer 250
 
23369 ashik.ali 251
	public void setCustomerGstNumber(String customerGstNumber) {
252
		this.customerGstNumber = customerGstNumber;
253
	}
27579 tejbeer 254
 
21984 kshitij.so 255
	public float getTotalAmount() {
256
		return totalAmount;
257
	}
27579 tejbeer 258
 
21984 kshitij.so 259
	public void setTotalAmount(float totalAmount) {
260
		this.totalAmount = totalAmount;
261
	}
27579 tejbeer 262
 
21984 kshitij.so 263
	public String getInvoiceNumber() {
264
		return invoiceNumber;
265
	}
27579 tejbeer 266
 
21984 kshitij.so 267
	public void setInvoiceNumber(String invoiceNumber) {
268
		this.invoiceNumber = invoiceNumber;
269
	}
27579 tejbeer 270
 
22859 ashik.ali 271
	public float getCashback() {
272
		return cashback;
273
	}
27579 tejbeer 274
 
22859 ashik.ali 275
	public void setCashback(float cashback) {
276
		this.cashback = cashback;
277
	}
27579 tejbeer 278
 
21984 kshitij.so 279
	public LocalDateTime getCreateTimestamp() {
280
		return createTimestamp;
281
	}
27579 tejbeer 282
 
21984 kshitij.so 283
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
284
		this.createTimestamp = createTimestamp;
285
	}
27579 tejbeer 286
 
287
	public String getFormattedDate() {
288
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22243 ashik.ali 289
		return this.createTimestamp.format(formatter);
27579 tejbeer 290
	}
291
 
21924 ashik.ali 292
	@Override
22009 ashik.ali 293
	public int hashCode() {
294
		final int prime = 31;
295
		int result = 1;
26817 amit.gupta 296
		result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
297
		result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
298
		result = prime * result + Float.floatToIntBits(cashback);
299
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
300
		result = prime * result + customerAddressId;
301
		result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
302
		result = prime * result + customerId;
303
		result = prime * result + ((dateOfBirth == null) ? 0 : dateOfBirth.hashCode());
304
		result = prime * result + fofoId;
22009 ashik.ali 305
		result = prime * result + id;
26817 amit.gupta 306
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
307
		result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
308
		result = prime * result + Float.floatToIntBits(totalAmount);
22009 ashik.ali 309
		return result;
310
	}
27579 tejbeer 311
 
22009 ashik.ali 312
	@Override
313
	public boolean equals(Object obj) {
314
		if (this == obj)
315
			return true;
316
		if (obj == null)
317
			return false;
318
		if (getClass() != obj.getClass())
319
			return false;
320
		FofoOrder other = (FofoOrder) obj;
26817 amit.gupta 321
		if (billingTimestamp == null) {
322
			if (other.billingTimestamp != null)
323
				return false;
324
		} else if (!billingTimestamp.equals(other.billingTimestamp))
325
			return false;
326
		if (cancelledTimestamp == null) {
327
			if (other.cancelledTimestamp != null)
328
				return false;
329
		} else if (!cancelledTimestamp.equals(other.cancelledTimestamp))
330
			return false;
331
		if (Float.floatToIntBits(cashback) != Float.floatToIntBits(other.cashback))
332
			return false;
333
		if (createTimestamp == null) {
334
			if (other.createTimestamp != null)
335
				return false;
336
		} else if (!createTimestamp.equals(other.createTimestamp))
337
			return false;
338
		if (customerAddressId != other.customerAddressId)
339
			return false;
340
		if (customerGstNumber == null) {
341
			if (other.customerGstNumber != null)
342
				return false;
343
		} else if (!customerGstNumber.equals(other.customerGstNumber))
344
			return false;
345
		if (customerId != other.customerId)
346
			return false;
347
		if (dateOfBirth == null) {
348
			if (other.dateOfBirth != null)
349
				return false;
350
		} else if (!dateOfBirth.equals(other.dateOfBirth))
351
			return false;
352
		if (fofoId != other.fofoId)
353
			return false;
22009 ashik.ali 354
		if (id != other.id)
355
			return false;
26817 amit.gupta 356
		if (invoiceNumber == null) {
357
			if (other.invoiceNumber != null)
358
				return false;
359
		} else if (!invoiceNumber.equals(other.invoiceNumber))
360
			return false;
361
		if (orderItem == null) {
362
			if (other.orderItem != null)
363
				return false;
364
		} else if (!orderItem.equals(other.orderItem))
365
			return false;
366
		if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount))
367
			return false;
22009 ashik.ali 368
		return true;
369
	}
27586 tejbeer 370
 
22009 ashik.ali 371
	@Override
21602 ashik.ali 372
	public String toString() {
21710 ashik.ali 373
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
23369 ashik.ali 374
				+ customerAddressId + ", customerGstNumber=" + customerGstNumber + ", totalAmount=" + totalAmount
375
				+ ", invoiceNumber=" + invoiceNumber + ", cashback=" + cashback + ", createTimestamp=" + createTimestamp
26817 amit.gupta 376
				+ ", cancelledTimestamp=" + cancelledTimestamp + ", billingTimestamp=" + billingTimestamp
377
				+ ", orderItem=" + orderItem + ", dateOfBirth=" + dateOfBirth + "]";
21602 ashik.ali 378
	}
27586 tejbeer 379
 
21596 ashik.ali 380
}