Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
22600 ashik.ali 1
package com.spice.profitmandi.dao.entity.catalog;
2
 
35099 amit 3
import com.spice.profitmandi.common.util.FormattingUtils;
30121 amit.gupta 4
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
5
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
6
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
7
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
8
 
9
import javax.persistence.*;
22600 ashik.ali 10
import java.io.Serializable;
11
import java.time.LocalDateTime;
22859 ashik.ali 12
import java.time.format.DateTimeFormatter;
30454 amit.gupta 13
import java.util.*;
22600 ashik.ali 14
 
15
/**
16
 * This class basically contains scheme details
30896 amit.gupta 17
 *
22600 ashik.ali 18
 * @author ashikali
19
 */
31651 tejbeer 20
@NamedQueries({ @NamedQuery(name = "scheme.selectSchemesByRetailerIdsSchemeIds", query = "select sr.schemeId from"
21
		+ " SchemeRegion sr join PartnerRegion pr on pr.regionId=sr.regionId where pr.fofoId in :fofoIds and sr.schemeId in :schemeIds"),
30896 amit.gupta 22
 
31651 tejbeer 23
		@NamedQuery(name = "Scheme.selectSchemeByModelsPartnerTypeFofoId", query = "select s from Scheme s"
24
				+ " join SchemeItem si on si.schemeId = s.id" + " join SchemeRegion sr on sr.schemeId = s.id"
25
				+ " join PartnerRegion pr on pr.regionId=sr.regionId"
26
				+ " where pr.fofoId in :fofoIds and s.partnerType in :partnerTypes" + " and si.catalogId in :catalogIds"
27
				+ " and :onDate between s.startDateTime and s.endDateTime" +
28
				// " and s.endDateTime >= :onDate" +
36374 ranu 29
				" and s.activeTimestamp is not null"),
31441 amit.gupta 30
 
36374 ranu 31
		@NamedQuery(name = "Scheme.selectSchemesByBrandsAndFofoRegion", query = "select distinct s from Scheme s"
32
				+ " join SchemeItem si on si.schemeId = s.id"
33
				+ " join Item i on i.catalogItemId = si.catalogId"
34
				+ " join SchemeRegion sr on sr.schemeId = s.id"
35
				+ " where i.brand in :brands"
36
				+ " and s.activeTimestamp is not null"
37
				+ " and s.partnerType in :partnerTypes"
38
				+ " and s.startDateTime <= :onDate"
39
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
40
				+ " and (si.endDate is null or si.endDate >= :onDate)"
41
				+ " and (sr.regionId = 5 or sr.regionId in :regionIds)"
42
				+ " order by s.id desc"),
43
 
44
		@NamedQuery(name = "Scheme.selectSchemesByBrands", query = "select distinct s from Scheme s"
45
				+ " join SchemeItem si on si.schemeId = s.id"
46
				+ " join Item i on i.catalogItemId = si.catalogId"
47
				+ " where i.brand in :brands"
48
				+ " and s.activeTimestamp is not null"
49
				+ " and s.partnerType in :partnerTypes"
50
				+ " and s.startDateTime <= :onDate"
51
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
52
				+ " and (si.endDate is null or si.endDate >= :onDate)"
53
				+ " order by s.id desc"),
54
 
55
		@NamedQuery(name = "Scheme.selectActiveSchemesByFofoRegion", query = "select distinct s from Scheme s"
56
				+ " join SchemeItem si on si.schemeId = s.id"
57
				+ " join SchemeRegion sr on sr.schemeId = s.id"
58
				+ " where s.activeTimestamp is not null"
59
				+ " and s.partnerType in :partnerTypes"
60
				+ " and s.startDateTime <= :onDate"
61
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
62
				+ " and (si.endDate is null or si.endDate >= :onDate)"
63
				+ " and (sr.regionId = 5 or sr.regionId in :regionIds)"
64
				+ " order by s.id desc"),
65
 
66
		@NamedQuery(name = "Scheme.selectAllActiveSchemes", query = "select distinct s from Scheme s"
67
				+ " join SchemeItem si on si.schemeId = s.id"
68
				+ " where s.activeTimestamp is not null"
69
				+ " and s.partnerType in :partnerTypes"
70
				+ " and s.startDateTime <= :onDate"
71
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
72
				+ " and (si.endDate is null or si.endDate >= :onDate)"
73
				+ " order by s.id desc")
74
 
31651 tejbeer 75
		/*
76
		 * ,
77
		 * 
78
		 * @NamedQuery(name="scheme.getImeiMarginsPaidOnBillingMonth", query=
79
		 * "select new com.spice.profitmandi.dao.repository.catalog.ImeiMarginModel(" +
80
		 * ") from LineItemImei li1" +
81
		 * "         left join LineItemImei li2 on (li1.serialNumber = li2.serialNumber and li1.id < li2.id)"
82
		 * + "         join LineItem li on li.id = li1.lineItemId" +
83
		 * "         join Order o on o.id = li.orderId" +
84
		 * "         join Item ci on li.itemId = ci.id" +
85
		 * "         join SchemeItem si on si.catalogId = ci.catalogItemId" +
86
		 * "         join Scheme s1 on s1.id = si.schemeId" +
87
		 * "         join SchemeRegion sr on sr.schemeId = s1.id" +
88
		 * "         join PartnerRegion pr on (pr.regionId = sr.regionId and pr.fofoId in (0, o.id))"
89
		 * + "         left join PartnerTypeChange ptc on ptc.fofoId = o.retailerId" +
90
		 * "         left join PartnerTypeChange ptc2 on (ptc2.fofoId = ptc.fofoId and ptc.createTimestamp < ptc2.createTimestamp)"
91
		 * + "where li2.id is null" + "  and ptc2.createTimestamp is null" +
92
		 * "  and o.billing_timestamp between :startDate and :endDate" +
93
		 * "  and '2022-12-01' between s1.start_date_time and s1.end_date_time" +
94
		 * "  and ((ptc.partnerType is null and s1.partner_type in ('ALL', 'NEW'))" +
95
		 * "    or s1.partnerType in (ptc.partnerType, 'ALL'))" +
96
		 * "  and s1.activeTimestamp is not null" + "  and s1.amountType = 'PERCENTAGE'"
97
		 * + "group by li.serial_number) as set1\n" + "")
98
		 */
31441 amit.gupta 99
 
31170 amit.gupta 100
})
101
 
30896 amit.gupta 102
@NamedNativeQueries({
103
 
31695 tejbeer 104
		@NamedNativeQuery(name = "scheme.getActiveScheme", query = "select si.catalog_id from catalog.scheme s join "
31696 tejbeer 105
				+ " fofo.scheme_item si on s.id = si.scheme_id join catalog.item i on i.catalog_item_id = si.catalog_id"
36397 amit 106
				+ " where s.active_timestamp is not null and start_date_time <= :startDate and end_date_time >= :startDate"
107
				+ " and (si.start_date is null or :startDate between si.start_date and si.end_date)"
108
				+ " and s.type = 'SPECIAL_SUPPORT' and i.hsnCode = '85171300' order by active_timestamp desc "),
31651 tejbeer 109
 
110
		@NamedNativeQuery(name = "scheme.selectMissedActivationSale", query = "select cs.id as scheme_id, ai.serial_number, sr.order_id, ii.id as inventory_item_id, ai.activation_timestamp"
111
				+ " from fofo.activated_imei ai "
112
				+ "   join fofo.inventory_item ii on ai.serial_number = ii.serial_number "
113
				+ "   join catalog.item i on i.id = ii.item_id "
34752 amit.gupta 114
				+ "   join catalog.scheme cs on ai.activation_timestamp >= cs.start_date_time and ai.activation_timestamp <= cs.end_date_time  "
36397 amit 115
				+ "   join fofo.scheme_item si on (si.scheme_id = cs.id and i.catalog_item_id = si.catalog_id and (si.start_date is null or ai.activation_timestamp between si.start_date and si.end_date)) "
34697 amit.gupta 116
				+ "	  join fofo.scan_record sr on (sr.inventory_item_id = ii.id)"
117
				+ "   join fofo.scheme_region sre on sre.scheme_id = cs.id"
118
				+ "   join cs.partner_region pr on (pr.region_id = sre.region_id and (pr.fofo_id = ii.fofo_id or pr.fofo_id = 0))"
31651 tejbeer 119
				+ "	left join fofo.scheme_in_out sio on (sio.scheme_id = cs.id and sio.inventory_item_id = ii.id) "
34752 amit.gupta 120
				+ " where cs.active_timestamp is not null " + " and cs.type ='SPECIAL_SUPPORT'"
31651 tejbeer 121
				+ " and sr.type = 'SALE'" + " and (sio.id is null or sio.status='REJECTED') "
122
				+ " and ai.checked = false", resultSetMapping = "missedActivationSaleMapping") })
123
 
124
@SqlResultSetMappings({ @SqlResultSetMapping(name = "missedActivationSaleMapping", classes = {
125
		@ConstructorResult(targetClass = SchemesImeisModel.class, columns = {
126
				@ColumnResult(name = "serial_number", type = String.class),
127
				@ColumnResult(name = "activation_timestamp", type = LocalDateTime.class),
128
				@ColumnResult(name = "order_id", type = Integer.class),
129
				@ColumnResult(name = "inventory_item_id", type = Integer.class),
130
				@ColumnResult(name = "scheme_id", type = Integer.class), }) }) })
22600 ashik.ali 131
@Entity
31860 tejbeer 132
@Table(name = "catalog.scheme")
25503 amit.gupta 133
public class Scheme implements Serializable {
134
 
135
	public PartnerType getPartnerType() {
136
		return partnerType;
137
	}
138
 
139
	public void setPartnerType(PartnerType partnerType) {
140
		this.partnerType = partnerType;
141
	}
142
 
22600 ashik.ali 143
	private static final long serialVersionUID = 1L;
25503 amit.gupta 144
 
22600 ashik.ali 145
	public Scheme() {
146
	}
25503 amit.gupta 147
 
22600 ashik.ali 148
	@Id
25503 amit.gupta 149
	@Column(name = "id")
22600 ashik.ali 150
	@GeneratedValue(strategy = GenerationType.IDENTITY)
151
	private int id;
25503 amit.gupta 152
 
31651 tejbeer 153
	@Column(name = "`name`")
22653 ashik.ali 154
	private String name;
25503 amit.gupta 155
 
22653 ashik.ali 156
	@Column(name = "description")
157
	private String description;
25503 amit.gupta 158
 
31651 tejbeer 159
	@Column(name = "`type`")
23297 ashik.ali 160
	@Enumerated(EnumType.STRING)
22653 ashik.ali 161
	private SchemeType type;
25503 amit.gupta 162
 
22600 ashik.ali 163
	@Column(name = "amount_type")
23297 ashik.ali 164
	@Enumerated(EnumType.STRING)
23527 ashik.ali 165
	private AmountType amountType;
25503 amit.gupta 166
 
30454 amit.gupta 167
	@Column(name = "base_plus_gst_calc")
168
	private boolean basePlusGstCalc;
169
 
22600 ashik.ali 170
	@Column(name = "amount")
171
	private float amount;
25503 amit.gupta 172
 
22600 ashik.ali 173
	@Convert(converter = LocalDateTimeAttributeConverter.class)
23019 ashik.ali 174
	@Column(name = "start_date_time")
175
	private LocalDateTime startDateTime = LocalDateTime.now();
25503 amit.gupta 176
 
22600 ashik.ali 177
	@Convert(converter = LocalDateTimeAttributeConverter.class)
23019 ashik.ali 178
	@Column(name = "end_date_time")
179
	private LocalDateTime endDateTime = LocalDateTime.now();
25503 amit.gupta 180
 
22608 ashik.ali 181
	@Convert(converter = LocalDateTimeAttributeConverter.class)
22600 ashik.ali 182
	@Column(name = "create_timestamp")
22859 ashik.ali 183
	private LocalDateTime createTimestamp = LocalDateTime.now();
25503 amit.gupta 184
 
22653 ashik.ali 185
	@Convert(converter = LocalDateTimeAttributeConverter.class)
186
	@Column(name = "active_timestamp")
187
	private LocalDateTime activeTimestamp = null;
25503 amit.gupta 188
 
22653 ashik.ali 189
	@Convert(converter = LocalDateTimeAttributeConverter.class)
22702 ashik.ali 190
	@Column(name = "expire_timestamp")
22653 ashik.ali 191
	private LocalDateTime expireTimestamp = null;
25503 amit.gupta 192
 
22600 ashik.ali 193
	@Column(name = "created_by")
194
	private int createdBy;
25503 amit.gupta 195
 
32310 amit.gupta 196
	//Dummy hardcode
197
	@Transient
198
	private int target;
199
 
200
	public int getTarget() {
201
		return target;
202
	}
203
 
204
	public void setTarget(int target) {
205
		this.target = target;
206
	}
207
 
26679 amit.gupta 208
	@Column
26685 amit.gupta 209
	private boolean cashback;
26679 amit.gupta 210
 
22859 ashik.ali 211
	@Transient
34697 amit.gupta 212
	private Set<Integer> retailerIds;
30896 amit.gupta 213
 
27388 amit.gupta 214
	@Transient
215
	private String amountModel;
30896 amit.gupta 216
 
28653 amit.gupta 217
	@Transient
218
	private float schemeValue;
25503 amit.gupta 219
 
28653 amit.gupta 220
	public float getSchemeValue() {
221
		return schemeValue;
222
	}
223
 
224
	public void setSchemeValue(float schemeValue) {
225
		this.schemeValue = schemeValue;
226
	}
227
 
35099 amit 228
	public String getSchemePeriod() {
229
		return FormattingUtils.formatDateMonthNonHyphenated(this.getStartDateTime()) + " - " + FormattingUtils.formatDateMonthNonHyphenated(this.getEndDateTime());
230
	}
231
 
30454 amit.gupta 232
	@Column(name = "partner_type")
25503 amit.gupta 233
	@Enumerated(EnumType.STRING)
234
	private PartnerType partnerType;
235
 
30454 amit.gupta 236
	@Override
237
	public String toString() {
31651 tejbeer 238
		return "Scheme{" + "id=" + id + ", name='" + name + '\'' + ", description='" + description + '\'' + ", type="
239
				+ type + ", amountType=" + amountType + ", gstReversal=" + basePlusGstCalc + ", amount=" + amount
240
				+ ", startDateTime=" + startDateTime + ", endDateTime=" + endDateTime + ", createTimestamp="
241
				+ createTimestamp + ", activeTimestamp=" + activeTimestamp + ", expireTimestamp=" + expireTimestamp
242
				+ ", createdBy=" + createdBy + ", cashback=" + cashback + ", retailerIds=" + retailerIds
243
				+ ", amountModel='" + amountModel + '\'' + ", schemeValue=" + schemeValue + ", partnerType="
244
				+ partnerType + ", catalogStringMap=" + catalogStringMap + '}';
30454 amit.gupta 245
	}
246
 
247
	@Override
248
	public boolean equals(Object o) {
31651 tejbeer 249
		if (this == o)
250
			return true;
251
		if (o == null || getClass() != o.getClass())
252
			return false;
30454 amit.gupta 253
		Scheme scheme = (Scheme) o;
31651 tejbeer 254
		return id == scheme.id && basePlusGstCalc == scheme.basePlusGstCalc && Float.compare(scheme.amount, amount) == 0
255
				&& createdBy == scheme.createdBy && cashback == scheme.cashback
256
				&& Float.compare(scheme.schemeValue, schemeValue) == 0 && Objects.equals(name, scheme.name)
257
				&& Objects.equals(description, scheme.description) && type == scheme.type
258
				&& amountType == scheme.amountType && Objects.equals(startDateTime, scheme.startDateTime)
259
				&& Objects.equals(endDateTime, scheme.endDateTime)
260
				&& Objects.equals(createTimestamp, scheme.createTimestamp)
261
				&& Objects.equals(activeTimestamp, scheme.activeTimestamp)
262
				&& Objects.equals(expireTimestamp, scheme.expireTimestamp)
263
				&& Objects.equals(retailerIds, scheme.retailerIds) && Objects.equals(amountModel, scheme.amountModel)
264
				&& partnerType == scheme.partnerType && Objects.equals(catalogStringMap, scheme.catalogStringMap);
30454 amit.gupta 265
	}
266
 
267
	@Override
268
	public int hashCode() {
31651 tejbeer 269
		return Objects.hash(id, name, description, type, amountType, basePlusGstCalc, amount, startDateTime,
270
				endDateTime, createTimestamp, activeTimestamp, expireTimestamp, createdBy, cashback, retailerIds,
271
				amountModel, schemeValue, partnerType, catalogStringMap);
30454 amit.gupta 272
	}
273
 
22859 ashik.ali 274
	@Transient
30121 amit.gupta 275
	private Map<Integer, String> catalogStringMap = new HashMap<>();
25503 amit.gupta 276
 
22600 ashik.ali 277
	public int getId() {
278
		return id;
279
	}
25503 amit.gupta 280
 
22600 ashik.ali 281
	public void setId(int id) {
282
		this.id = id;
283
	}
25503 amit.gupta 284
 
27388 amit.gupta 285
	public String getAmountModel() {
286
		return amountModel;
287
	}
288
 
289
	public void setAmountModel(String amountModel) {
290
		this.amountModel = amountModel;
291
	}
292
 
22653 ashik.ali 293
	public String getName() {
294
		return name;
22600 ashik.ali 295
	}
25503 amit.gupta 296
 
22653 ashik.ali 297
	public void setName(String name) {
298
		this.name = name;
22600 ashik.ali 299
	}
25503 amit.gupta 300
 
22653 ashik.ali 301
	public String getDescription() {
302
		return description;
22600 ashik.ali 303
	}
25503 amit.gupta 304
 
22653 ashik.ali 305
	public void setDescription(String description) {
306
		this.description = description;
22600 ashik.ali 307
	}
25503 amit.gupta 308
 
26685 amit.gupta 309
	public boolean isCashback() {
310
		return cashback;
26679 amit.gupta 311
	}
312
 
26685 amit.gupta 313
	public void setCashback(boolean cashback) {
314
		this.cashback = cashback;
26679 amit.gupta 315
	}
316
 
22653 ashik.ali 317
	public SchemeType getType() {
318
		return type;
319
	}
25503 amit.gupta 320
 
22653 ashik.ali 321
	public void setType(SchemeType type) {
322
		this.type = type;
323
	}
25503 amit.gupta 324
 
23527 ashik.ali 325
	public AmountType getAmountType() {
22600 ashik.ali 326
		return amountType;
327
	}
25503 amit.gupta 328
 
23527 ashik.ali 329
	public void setAmountType(AmountType amountType) {
22600 ashik.ali 330
		this.amountType = amountType;
331
	}
25503 amit.gupta 332
 
22600 ashik.ali 333
	public float getAmount() {
334
		return amount;
335
	}
25503 amit.gupta 336
 
22600 ashik.ali 337
	public void setAmount(float amount) {
338
		this.amount = amount;
339
	}
25503 amit.gupta 340
 
23019 ashik.ali 341
	public LocalDateTime getStartDateTime() {
342
		return startDateTime;
22600 ashik.ali 343
	}
25503 amit.gupta 344
 
23019 ashik.ali 345
	public void setStartDateTime(LocalDateTime startDateTime) {
346
		this.startDateTime = startDateTime;
22600 ashik.ali 347
	}
25503 amit.gupta 348
 
23019 ashik.ali 349
	public LocalDateTime getEndDateTime() {
350
		return endDateTime;
22653 ashik.ali 351
	}
25503 amit.gupta 352
 
23019 ashik.ali 353
	public void setEndDateTime(LocalDateTime endDateTime) {
354
		this.endDateTime = endDateTime;
22653 ashik.ali 355
	}
25503 amit.gupta 356
 
22859 ashik.ali 357
	public LocalDateTime getCreateTimestamp() {
358
		return createTimestamp;
22600 ashik.ali 359
	}
25503 amit.gupta 360
 
22859 ashik.ali 361
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
362
		this.createTimestamp = createTimestamp;
22600 ashik.ali 363
	}
25503 amit.gupta 364
 
22600 ashik.ali 365
	public int getCreatedBy() {
366
		return createdBy;
367
	}
25503 amit.gupta 368
 
22600 ashik.ali 369
	public void setCreatedBy(int createdBy) {
370
		this.createdBy = createdBy;
371
	}
25503 amit.gupta 372
 
22653 ashik.ali 373
	public LocalDateTime getActiveTimestamp() {
374
		return activeTimestamp;
22600 ashik.ali 375
	}
25503 amit.gupta 376
 
22653 ashik.ali 377
	public void setActiveTimestamp(LocalDateTime activeTimestamp) {
378
		this.activeTimestamp = activeTimestamp;
22600 ashik.ali 379
	}
25503 amit.gupta 380
 
22653 ashik.ali 381
	public LocalDateTime getExpireTimestamp() {
382
		return expireTimestamp;
383
	}
25503 amit.gupta 384
 
22653 ashik.ali 385
	public void setExpireTimestamp(LocalDateTime expireTimestamp) {
386
		this.expireTimestamp = expireTimestamp;
387
	}
25503 amit.gupta 388
 
389
	public String getFormattedStartDateTime() {
390
		if (startDateTime == null) {
22859 ashik.ali 391
			return null;
392
		}
24402 amit.gupta 393
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
23019 ashik.ali 394
		return startDateTime.format(formatter);
25503 amit.gupta 395
	}
396
 
397
	public String getFormattedEndDateTime() {
398
		if (endDateTime == null) {
22859 ashik.ali 399
			return null;
400
		}
24402 amit.gupta 401
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
23019 ashik.ali 402
		return endDateTime.format(formatter);
25503 amit.gupta 403
	}
404
 
405
	public String getFormattedCreateTimestamp() {
406
		if (createTimestamp == null) {
22859 ashik.ali 407
			return null;
408
		}
24402 amit.gupta 409
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22859 ashik.ali 410
		return createTimestamp.format(formatter);
25503 amit.gupta 411
	}
412
 
413
	public String getFormattedActiveTimestamp() {
414
		if (activeTimestamp == null) {
22859 ashik.ali 415
			return null;
416
		}
24402 amit.gupta 417
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22859 ashik.ali 418
		return activeTimestamp.format(formatter);
25503 amit.gupta 419
	}
420
 
421
	public String getFormattedExpireTimestamp() {
422
		if (expireTimestamp == null) {
22859 ashik.ali 423
			return null;
424
		}
24402 amit.gupta 425
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22859 ashik.ali 426
		return expireTimestamp.format(formatter);
25503 amit.gupta 427
	}
428
 
22859 ashik.ali 429
	public Set<Integer> getRetailerIds() {
430
		return retailerIds;
431
	}
25503 amit.gupta 432
 
22859 ashik.ali 433
	public void setRetailerIds(Set<Integer> retailerIds) {
434
		this.retailerIds = retailerIds;
435
	}
25503 amit.gupta 436
 
437
	public String getRetailerIdsString() {
36374 ranu 438
		if (retailerIds == null || retailerIds.isEmpty()) {
439
			return "";
440
		}
22859 ashik.ali 441
		Set<String> stringRetailerIds = new HashSet<>();
36374 ranu 442
		for (int retailerId : retailerIds) {
443
			stringRetailerIds.add(String.valueOf(retailerId));
22859 ashik.ali 444
		}
445
		return String.join(", ", stringRetailerIds);
446
	}
25503 amit.gupta 447
 
30454 amit.gupta 448
	public boolean isBasePlusGstCalc() {
449
		return basePlusGstCalc;
450
	}
451
 
452
	public void setBasePlusGstCalc(boolean gstReversal) {
453
		this.basePlusGstCalc = gstReversal;
454
	}
455
 
30121 amit.gupta 456
	public Map<Integer, String> getCatalogStringMap() {
457
		return catalogStringMap;
22859 ashik.ali 458
	}
25503 amit.gupta 459
 
30121 amit.gupta 460
	public void setCatalogStringMap(Map<Integer, String> catalogStringMap) {
461
		this.catalogStringMap = catalogStringMap;
22859 ashik.ali 462
	}
25503 amit.gupta 463
 
30640 amit.gupta 464
	public boolean isWithinRange(LocalDateTime testDate) {
465
		return !(testDate.isBefore(this.startDateTime) || testDate.isAfter(endDateTime));
466
	}
22600 ashik.ali 467
}