Subversion Repositories SmartDukaan

Rev

Rev 32308 | Rev 33124 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32308 Rev 32615
Line 10... Line 10...
10
import java.time.LocalDate;
10
import java.time.LocalDate;
11
import java.time.LocalDateTime;
11
import java.time.LocalDateTime;
12
 
12
 
13
/**
13
/**
14
 * This class basically contains store code details
14
 * This class basically contains store code details
15
 * 
-
 
16
 * @author ashikali
-
 
17
 *
15
 *
-
 
16
 * @author ashikali
18
 */
17
 */
19
@Entity
18
@Entity
20
@Table(name = "fofo.fofo_store")
19
@Table(name = "fofo.fofo_store")
21
 
20
 
22
@NamedQueries({
21
@NamedQueries({
23
 
22
 
24
		@NamedQuery(name = "FofoStore.selectAllDtrUserIds", query = "select ua.userId from FofoStore fs join UserAccount ua on fs.id=ua.accountKey "
23
        @NamedQuery(name = "FofoStore.selectAllDtrUserIds", query = "select ua.userId from FofoStore fs join UserAccount ua on fs.id=ua.accountKey "
25
				+ "where ua.type='saholic' and fs.internal=false and fs.active=true"),
24
                + "where ua.type='saholic' and fs.internal=false and fs.active=true"),
26
 
25
 
27
		@NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
26
        @NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
28
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
27
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
29
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
28
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
30
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
29
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
31
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
30
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
32
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
31
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
33
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
32
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
34
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true "
33
                + " 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  where fo.cancelledTimestamp is null and fs.active = true "
35
				+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId = :categoryId and fs.id in :fofoId"
34
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId = :categoryId and fs.id in :fofoId"
36
				+ " group by foi.brand"),
35
                + " group by foi.brand"),
37
 
36
 
38
		@NamedQuery(name = "FofoStore.selectGroupByWarehouseBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel("
37
        @NamedQuery(name = "FofoStore.selectGroupByWarehouseBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel("
39
				+ "(case when a.city in ('Noida', 'Ghaziabad')  and foi.brand = 'Vivo' then 7573 else fs.warehouseId end) AS col_0_0_,"
38
                + "(case when a.city in ('Noida', 'Ghaziabad')  and foi.brand = 'Vivo' then 7573 else fs.warehouseId end) AS col_0_0_,"
40
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
39
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
41
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
40
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
42
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
41
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
43
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
42
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
44
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
43
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
45
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
44
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
46
				+ " 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"
45
                + " 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"
47
				+ " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address a on a.id = u.addressId"
46
                + " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address a on a.id = u.addressId"
48
				+ " where fo.cancelledTimestamp is null and fs.active = true"
47
                + " where fo.cancelledTimestamp is null and fs.active = true"
49
				+ " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId"
48
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId"
50
				+ " group by col_0_0_"),
49
                + " group by col_0_0_"),
51
 
50
 
52
		@NamedQuery(name = "FofoStore.selectWarehouseBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
51
        @NamedQuery(name = "FofoStore.selectWarehouseBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
53
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
52
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
54
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
53
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
55
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
54
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
56
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
55
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
57
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
56
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
58
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
57
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
59
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true"
58
                + " 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  where fo.cancelledTimestamp is null and fs.active = true"
60
				+ " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId group by i.id"),
59
                + " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId group by i.id"),
61
 
60
 
62
		@NamedQuery(name = "FofoStore.selectGroupByBrandAccesoriesWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
61
        @NamedQuery(name = "FofoStore.selectGroupByBrandAccesoriesWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
63
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
62
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
64
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
63
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
65
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
64
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
66
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
65
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
67
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
66
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
68
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
67
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
69
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true "
68
                + " 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  where fo.cancelledTimestamp is null and fs.active = true "
70
				+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
69
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
71
				+ " group by foi.brand"),
70
                + " group by foi.brand"),
72
 
71
 
73
		@NamedQuery(name = "FofoStore.selectGroupByWarehouseAccesoriesBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel(fs.warehouseId,"
72
        @NamedQuery(name = "FofoStore.selectGroupByWarehouseAccesoriesBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel(fs.warehouseId,"
74
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
73
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
75
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
74
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
76
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
75
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
77
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
76
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
78
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
77
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
79
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
78
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
80
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true"
79
                + " 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  where fo.cancelledTimestamp is null and fs.active = true"
81
				+ " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId != :categoryId and fs.id in :fofoId"
80
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId != :categoryId and fs.id in :fofoId"
82
				+ " group by fs.warehouseId"),
81
                + " group by fs.warehouseId"),
83
 
82
 
84
		@NamedQuery(name = "FofoStore.selectWarehouseAccesoriesBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
83
        @NamedQuery(name = "FofoStore.selectWarehouseAccesoriesBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
85
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
84
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
86
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
85
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
87
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
86
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
88
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
87
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
89
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
88
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
90
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
89
                + "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
91
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true"
90
                + " 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  where fo.cancelledTimestamp is null and fs.active = true"
92
				+ " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId != :categoryId  and fs.id in :fofoId group by i.id"),
91
                + " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId != :categoryId  and fs.id in :fofoId group by i.id"),
93
 
92
 
94
		@NamedQuery(name = "FofoStore.selectPartnerPendingIndentItem", query = "select new com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel(o.retailerName,"
93
        @NamedQuery(name = "FofoStore.selectPartnerPendingIndentItem", query = "select new com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel(o.retailerName,"
95
				+ " li.quantity, li.totalPrice)"
94
                + " li.quantity, li.totalPrice)"
96
				+ " from FofoStore fs join Order o on fs.id = o.retailerId join  LineItem li on li.orderId = o.id "
95
                + " from FofoStore fs join Order o on fs.id = o.retailerId join  LineItem li on li.orderId = o.id "
97
				+ " where li.itemId = :itemId and fs.warehouseId = :warehouseId and o.status = 3"),
96
                + " where li.itemId = :itemId and fs.warehouseId = :warehouseId and o.status = 3"),
98
 
97
 
99
		@NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByBrand", query = "select new com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel(i.brand,"
98
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByBrand", query = "select new com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel(i.brand,"
100
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
99
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
101
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
100
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
102
				+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
101
                + " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
103
				+ " where fs.active = true and ii.goodQuantity >= 1 and fs.id in :fofoId group by i.brand"),
102
                + " where fs.active = true and ii.goodQuantity >= 1 and fs.id in :fofoId group by i.brand"),
104
 
103
 
105
		@NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel(fs.warehouseId,"
104
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel(fs.warehouseId,"
106
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
105
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
107
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
106
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
108
				+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
107
                + " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
109
				+ " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.id in :fofoId group by fs.warehouseId"),
108
                + " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.id in :fofoId group by fs.warehouseId"),
110
 
109
 
111
		@NamedQuery(name = "FofoStore.selectWarehouseBrandItemUnbilledActivateStock", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
110
        @NamedQuery(name = "FofoStore.selectWarehouseBrandItemUnbilledActivateStock", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
112
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
111
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
113
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
112
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
114
				+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
113
                + " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
115
				+ " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.warehouseId in :warehouseId and fs.id in :fofoId  group by i.id"),
114
                + " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.warehouseId in :warehouseId and fs.id in :fofoId  group by i.id"),
116
 
115
 
117
		@NamedQuery(name = "FofoStore.selectGroupByBrandLms", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(foi.brand, DATE_FORMAT(fo.createTimestamp, :groupParameter),sum(cast(foi.mop*foi.quantity As int)))"
116
        @NamedQuery(name = "FofoStore.selectGroupByBrandLms", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(foi.brand, DATE_FORMAT(fo.createTimestamp, :groupParameter),sum(cast(foi.mop*foi.quantity As int)))"
118
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true "
117
                + " 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  where fo.cancelledTimestamp is null and fs.active = true "
119
				+ " and (foi.createTimestamp between :lmsStartDate and :endDate) and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
118
                + " and (foi.createTimestamp between :lmsStartDate and :endDate) and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
120
				+ " group by foi.brand,DATE_FORMAT(fo.createTimestamp, :groupParameter)"), })
119
                + " group by foi.brand,DATE_FORMAT(fo.createTimestamp, :groupParameter)"),})
121
 
120
 
122
public class FofoStore implements Serializable {
121
public class FofoStore implements Serializable {
123
 
122
 
124
	private static final long serialVersionUID = 1L;
123
    private static final long serialVersionUID = 1L;
125
 
124
    @Id
126
	public FofoStore() {
125
    @Column(name = "id", unique = true, updatable = false)
127
	}
126
    private int id;
128
 
127
    private int codeInt;
129
	@Id
128
    @Column(name = "code", unique = true)
130
	@Column(name = "id", unique = true, updatable = false)
129
    private String code;
131
	private int id;
130
    @Column(name = "latitude")
132
 
131
    private String latitude;
133
	@Column(name = "code", unique = true)
132
    @Column(name = "longitude")
134
	private String code;
133
    private String longitude;
135
 
134
    @Column(name = "counter_size")
136
	@Column(name = "latitude")
135
    @Enumerated(EnumType.STRING)
137
	private String latitude;
136
    private CounterSize counterSize = CounterSize.TEN_LAC;
138
 
137
    @Column(name = "counter_potential")
139
	@Column(name = "longitude")
138
    private float counterPotential;
140
	private String longitude;
139
    @Column(name = "warehouse_id")
141
 
140
    private int warehouseId;
142
	@Column(name = "counter_size")
141
    @Column(name = "minimum_investment")
143
	@Enumerated(EnumType.STRING)
142
    private float minimumInvestment;
144
	private CounterSize counterSize = CounterSize.TEN_LAC;
143
    @Column(name = "grace_date")
145
 
144
    private LocalDate graceDate;
146
	@Column(name = "counter_potential")
145
    @Column(name = "investment_ok")
147
	private float counterPotential;
146
    private boolean investmentOk;
148
 
147
    @Column
149
	@Column(name = "warehouse_id")
148
    private boolean active = true;
150
	private int warehouseId;
149
    @Column
151
 
150
    private String pan;
152
	@Column(name = "minimum_investment")
151
    @Transient
153
	private float minimumInvestment;
152
    private Address userAddress;
154
 
153
    @Column(name = "internal")
155
	@Column(name = "grace_date")
154
    private boolean internal;
156
	private LocalDate graceDate;
155
    @Column(name = "bags_last_credited")
157
 
156
    private LocalDateTime bagsLastCredited;
158
	@Column(name = "investment_ok")
157
    @Column(name = "fofo_type")
159
	private boolean investmentOk;
158
    @Enumerated(EnumType.STRING)
160
 
159
    private FofoType fofoType;
161
	@Column
160
    @Column(name = "activation_type")
162
	private boolean active = true;
161
    @Enumerated(EnumType.STRING)
163
 
162
    private ActivationType activationType = ActivationType.BILLING_PENDING;
164
	@Column
163
    @Column(name = "active_timestamp")
165
	private String pan;
164
    private LocalDateTime activeTimeStamp;
166
 
165
    @Column(name = "target")
167
	@Transient
166
    private int target;
168
	private Address userAddress;
167
    @Column(name = "grace_count")
169
 
168
    private int graceCount;
170
	@Column(name = "internal")
169
 
171
	private boolean internal;
170
    public FofoStore() {
172
 
171
    }
173
	@Column(name = "bags_last_credited")
172
 
174
	private LocalDateTime bagsLastCredited;
173
    public int getCodeInt() {
175
 
174
        return codeInt;
176
	@Column(name = "fofo_type")
175
    }
177
	@Enumerated(EnumType.STRING)
176
 
178
	private FofoType fofoType;
177
    public void setCodeInt(int codeInt) {
179
 
178
        this.codeInt = codeInt;
180
	@Column(name = "activation_type")
179
    }
181
	@Enumerated(EnumType.STRING)
180
 
182
	private ActivationType activationType = ActivationType.BILLING_PENDING;
181
    public int getTarget() {
183
 
182
        return target;
184
	@Column(name = "active_timestamp")
183
    }
185
	private LocalDateTime activeTimeStamp;
184
 
186
 
185
    public void setTarget(int target) {
187
	@Column(name = "target")
186
        this.target = target;
188
	private int target;
187
    }
189
 
188
 
190
	public int getTarget() {
189
    public ActivationType getActivationType() {
191
		return target;
190
        return activationType;
192
	}
191
    }
193
 
192
 
194
	public void setTarget(int target) {
193
    public void setActivationType(ActivationType activationType) {
195
		this.target = target;
194
        this.activationType = activationType;
196
	}
195
    }
197
 
196
 
198
	public ActivationType getActivationType() {
197
    public float getCounterPotential() {
199
		return activationType;
198
        return counterPotential;
200
	}
199
    }
201
 
200
 
202
	public float getCounterPotential() {
201
    public void setCounterPotential(float counterPotential) {
203
		return counterPotential;
202
        this.counterPotential = counterPotential;
204
	}
203
    }
205
 
204
 
206
	public void setCounterPotential(float counterPotential) {
205
    public LocalDateTime getBagsLastCredited() {
207
		this.counterPotential = counterPotential;
206
        return bagsLastCredited;
208
	}
207
    }
209
 
208
 
210
	public void setActivationType(ActivationType activationType) {
209
    public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
211
		this.activationType = activationType;
210
        this.bagsLastCredited = bagsLastCredited;
212
	}
211
    }
213
 
212
 
214
	public LocalDateTime getBagsLastCredited() {
213
    public boolean isInternal() {
215
		return bagsLastCredited;
214
        return internal;
216
	}
215
    }
217
 
216
 
218
	public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
217
    public void setInternal(boolean internal) {
219
		this.bagsLastCredited = bagsLastCredited;
218
        this.internal = internal;
220
	}
219
    }
221
 
220
 
222
	public boolean isInternal() {
221
    public int getWarehouseId() {
223
		return internal;
222
        return warehouseId;
224
	}
223
    }
225
 
224
 
226
	public void setInternal(boolean internal) {
225
    public void setWarehouseId(int warehouseId) {
227
		this.internal = internal;
226
        this.warehouseId = warehouseId;
228
	}
227
    }
229
 
228
 
230
	public int getWarehouseId() {
229
    public boolean isInvestmentOk() {
231
		return warehouseId;
230
        return investmentOk;
232
	}
231
    }
233
 
232
 
234
	public void setWarehouseId(int warehouseId) {
233
    public void setInvestmentOk(boolean investmentOk) {
235
		this.warehouseId = warehouseId;
234
        this.investmentOk = investmentOk;
236
	}
235
    }
237
 
236
 
238
	public boolean isInvestmentOk() {
237
    public String getPan() {
239
		return investmentOk;
238
        return pan;
240
	}
239
    }
241
 
240
 
242
	public void setInvestmentOk(boolean investmentOk) {
241
    public void setPan(String pan) {
243
		this.investmentOk = investmentOk;
242
        this.pan = pan;
244
	}
243
    }
245
 
244
 
246
	@Column(name = "grace_count")
245
    public int getGraceCount() {
247
	private int graceCount;
246
        return graceCount;
248
 
247
    }
249
	public String getPan() {
248
 
250
		return pan;
249
    public void setGraceCount(int graceCount) {
251
	}
250
        this.graceCount = graceCount;
252
 
251
    }
253
	public void setPan(String pan) {
252
 
254
		this.pan = pan;
253
    public boolean isActive() {
255
	}
254
        return active;
256
 
255
    }
257
	public int getGraceCount() {
256
 
258
		return graceCount;
257
    public void setActive(boolean active) {
259
	}
258
        this.active = active;
260
 
259
    }
261
	public boolean isActive() {
260
 
262
		return active;
261
    public LocalDate getGraceDate() {
263
	}
262
        return graceDate;
264
 
263
    }
265
	public void setActive(boolean active) {
264
 
266
		this.active = active;
265
    public void setGraceDate(LocalDate graceDate) {
267
	}
266
        this.graceDate = graceDate;
268
 
267
    }
269
	public void setGraceCount(int graceCount) {
268
 
270
		this.graceCount = graceCount;
269
    public float getMinimumInvestment() {
271
	}
270
        return minimumInvestment;
272
 
271
    }
273
	public LocalDate getGraceDate() {
272
 
274
		return graceDate;
273
    public void setMinimumInvestment(float minimumInvestment) {
275
	}
274
        this.minimumInvestment = minimumInvestment;
276
 
275
    }
277
	public void setGraceDate(LocalDate graceDate) {
276
 
278
		this.graceDate = graceDate;
277
    /*
279
	}
278
     * public int getCreditCycle() { return creditCycle; } public void
280
 
279
     * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
281
	public float getMinimumInvestment() {
280
     */
282
		return minimumInvestment;
281
    public CounterSize getCounterSize() {
283
	}
282
        return counterSize;
284
 
283
    }
285
	public void setMinimumInvestment(float minimumInvestment) {
284
 
286
		this.minimumInvestment = minimumInvestment;
285
    public void setCounterSize(CounterSize counterSize) {
287
	}
286
        this.counterSize = counterSize;
288
 
287
    }
289
	/*
288
 
290
	 * public int getCreditCycle() { return creditCycle; } public void
289
    public int getId() {
291
	 * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
290
        return id;
292
	 */
291
    }
293
	public CounterSize getCounterSize() {
292
 
294
		return counterSize;
293
    public void setId(int id) {
295
	}
294
        this.id = id;
296
 
295
    }
297
	public void setCounterSize(CounterSize counterSize) {
296
 
298
		this.counterSize = counterSize;
297
    public String getCode() {
299
	}
298
        return code;
300
 
299
    }
301
	public int getId() {
300
 
302
		return id;
301
    public void setCode(String code) {
303
	}
302
        this.code = code;
304
 
303
    }
305
	public void setId(int id) {
304
 
306
		this.id = id;
305
    public String getLatitude() {
307
	}
306
        return latitude;
308
 
307
    }
309
	public String getCode() {
308
 
310
		return code;
309
    public void setLatitude(String latitude) {
311
	}
310
        this.latitude = latitude;
312
 
311
    }
313
	public void setCode(String code) {
312
 
314
		this.code = code;
313
    public String getLongitude() {
315
	}
314
        return longitude;
316
 
315
    }
317
	public String getLatitude() {
316
 
318
		return latitude;
317
    public void setLongitude(String longitude) {
319
	}
318
        this.longitude = longitude;
320
 
319
    }
321
	public void setLatitude(String latitude) {
320
 
322
		this.latitude = latitude;
321
    public Address getUserAddress() {
323
	}
322
        return userAddress;
324
 
323
    }
325
	public String getLongitude() {
324
 
326
		return longitude;
325
    public void setUserAddress(Address userAddress) {
327
	}
326
        this.userAddress = userAddress;
328
 
327
    }
329
	public void setLongitude(String longitude) {
328
 
330
		this.longitude = longitude;
329
    public LocalDateTime getActiveTimeStamp() {
331
	}
330
        return activeTimeStamp;
332
 
331
    }
333
	public Address getUserAddress() {
332
 
334
		return userAddress;
333
    public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
335
	}
334
        this.activeTimeStamp = activeTimeStamp;
336
 
335
    }
337
	public void setUserAddress(Address userAddress) {
336
 
338
		this.userAddress = userAddress;
337
    public FofoType getFofoType() {
339
	}
338
        return fofoType;
340
 
339
    }
341
	public LocalDateTime getActiveTimeStamp() {
340
 
342
		return activeTimeStamp;
341
    public void setFofoType(FofoType fofoType) {
343
	}
342
        this.fofoType = fofoType;
344
 
343
    }
345
	public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
344
 
346
		this.activeTimeStamp = activeTimeStamp;
345
    @Override
347
	}
346
    public int hashCode() {
348
 
347
        final int prime = 31;
349
	public FofoType getFofoType() {
348
        int result = 1;
350
		return fofoType;
349
        result = prime * result + ((activationType == null) ? 0 : activationType.hashCode());
351
	}
350
        result = prime * result + (active ? 1231 : 1237);
352
 
351
        result = prime * result + ((activeTimeStamp == null) ? 0 : activeTimeStamp.hashCode());
353
	public void setFofoType(FofoType fofoType) {
352
        result = prime * result + ((bagsLastCredited == null) ? 0 : bagsLastCredited.hashCode());
354
		this.fofoType = fofoType;
353
        result = prime * result + ((code == null) ? 0 : code.hashCode());
355
	}
354
        result = prime * result + Float.floatToIntBits(counterPotential);
356
 
355
        result = prime * result + ((counterSize == null) ? 0 : counterSize.hashCode());
357
	@Override
356
        result = prime * result + ((fofoType == null) ? 0 : fofoType.hashCode());
358
	public int hashCode() {
357
        result = prime * result + graceCount;
359
		final int prime = 31;
358
        result = prime * result + ((graceDate == null) ? 0 : graceDate.hashCode());
360
		int result = 1;
359
        result = prime * result + id;
361
		result = prime * result + ((activationType == null) ? 0 : activationType.hashCode());
360
        result = prime * result + (internal ? 1231 : 1237);
362
		result = prime * result + (active ? 1231 : 1237);
361
        result = prime * result + (investmentOk ? 1231 : 1237);
363
		result = prime * result + ((activeTimeStamp == null) ? 0 : activeTimeStamp.hashCode());
362
        result = prime * result + ((latitude == null) ? 0 : latitude.hashCode());
364
		result = prime * result + ((bagsLastCredited == null) ? 0 : bagsLastCredited.hashCode());
363
        result = prime * result + ((longitude == null) ? 0 : longitude.hashCode());
365
		result = prime * result + ((code == null) ? 0 : code.hashCode());
364
        result = prime * result + Float.floatToIntBits(minimumInvestment);
366
		result = prime * result + Float.floatToIntBits(counterPotential);
365
        result = prime * result + ((pan == null) ? 0 : pan.hashCode());
367
		result = prime * result + ((counterSize == null) ? 0 : counterSize.hashCode());
366
        result = prime * result + ((userAddress == null) ? 0 : userAddress.hashCode());
368
		result = prime * result + ((fofoType == null) ? 0 : fofoType.hashCode());
367
        result = prime * result + warehouseId;
369
		result = prime * result + graceCount;
368
        return result;
370
		result = prime * result + ((graceDate == null) ? 0 : graceDate.hashCode());
369
    }
371
		result = prime * result + id;
370
 
372
		result = prime * result + (internal ? 1231 : 1237);
371
    @Override
373
		result = prime * result + (investmentOk ? 1231 : 1237);
372
    public boolean equals(Object obj) {
374
		result = prime * result + ((latitude == null) ? 0 : latitude.hashCode());
373
        if (this == obj)
375
		result = prime * result + ((longitude == null) ? 0 : longitude.hashCode());
374
            return true;
376
		result = prime * result + Float.floatToIntBits(minimumInvestment);
375
        if (obj == null)
377
		result = prime * result + ((pan == null) ? 0 : pan.hashCode());
376
            return false;
378
		result = prime * result + ((userAddress == null) ? 0 : userAddress.hashCode());
377
        if (getClass() != obj.getClass())
379
		result = prime * result + warehouseId;
378
            return false;
380
		return result;
379
        FofoStore other = (FofoStore) obj;
381
	}
380
        if (activationType != other.activationType)
382
 
381
            return false;
383
	@Override
382
        if (active != other.active)
384
	public boolean equals(Object obj) {
383
            return false;
385
		if (this == obj)
384
        if (activeTimeStamp == null) {
386
			return true;
385
            if (other.activeTimeStamp != null)
387
		if (obj == null)
386
                return false;
388
			return false;
387
        } else if (!activeTimeStamp.equals(other.activeTimeStamp))
389
		if (getClass() != obj.getClass())
388
            return false;
390
			return false;
389
        if (bagsLastCredited == null) {
391
		FofoStore other = (FofoStore) obj;
390
            if (other.bagsLastCredited != null)
392
		if (activationType != other.activationType)
391
                return false;
393
			return false;
392
        } else if (!bagsLastCredited.equals(other.bagsLastCredited))
394
		if (active != other.active)
393
            return false;
395
			return false;
394
        if (code == null) {
396
		if (activeTimeStamp == null) {
395
            if (other.code != null)
397
			if (other.activeTimeStamp != null)
396
                return false;
398
				return false;
397
        } else if (!code.equals(other.code))
399
		} else if (!activeTimeStamp.equals(other.activeTimeStamp))
398
            return false;
400
			return false;
399
        if (Float.floatToIntBits(counterPotential) != Float.floatToIntBits(other.counterPotential))
401
		if (bagsLastCredited == null) {
400
            return false;
402
			if (other.bagsLastCredited != null)
401
        if (counterSize != other.counterSize)
403
				return false;
402
            return false;
404
		} else if (!bagsLastCredited.equals(other.bagsLastCredited))
403
        if (fofoType != other.fofoType)
405
			return false;
404
            return false;
406
		if (code == null) {
405
        if (graceCount != other.graceCount)
407
			if (other.code != null)
406
            return false;
408
				return false;
407
        if (graceDate == null) {
409
		} else if (!code.equals(other.code))
408
            if (other.graceDate != null)
410
			return false;
409
                return false;
411
		if (Float.floatToIntBits(counterPotential) != Float.floatToIntBits(other.counterPotential))
410
        } else if (!graceDate.equals(other.graceDate))
412
			return false;
411
            return false;
413
		if (counterSize != other.counterSize)
412
        if (id != other.id)
414
			return false;
413
            return false;
415
		if (fofoType != other.fofoType)
414
        if (internal != other.internal)
416
			return false;
415
            return false;
417
		if (graceCount != other.graceCount)
416
        if (investmentOk != other.investmentOk)
418
			return false;
417
            return false;
419
		if (graceDate == null) {
418
        if (latitude == null) {
420
			if (other.graceDate != null)
419
            if (other.latitude != null)
421
				return false;
420
                return false;
422
		} else if (!graceDate.equals(other.graceDate))
421
        } else if (!latitude.equals(other.latitude))
423
			return false;
422
            return false;
424
		if (id != other.id)
423
        if (longitude == null) {
425
			return false;
424
            if (other.longitude != null)
426
		if (internal != other.internal)
425
                return false;
427
			return false;
426
        } else if (!longitude.equals(other.longitude))
428
		if (investmentOk != other.investmentOk)
427
            return false;
429
			return false;
428
        if (Float.floatToIntBits(minimumInvestment) != Float.floatToIntBits(other.minimumInvestment))
430
		if (latitude == null) {
429
            return false;
431
			if (other.latitude != null)
430
        if (pan == null) {
432
				return false;
431
            if (other.pan != null)
433
		} else if (!latitude.equals(other.latitude))
432
                return false;
434
			return false;
433
        } else if (!pan.equals(other.pan))
435
		if (longitude == null) {
434
            return false;
436
			if (other.longitude != null)
435
        if (userAddress == null) {
437
				return false;
436
            if (other.userAddress != null)
438
		} else if (!longitude.equals(other.longitude))
437
                return false;
439
			return false;
438
        } else if (!userAddress.equals(other.userAddress))
440
		if (Float.floatToIntBits(minimumInvestment) != Float.floatToIntBits(other.minimumInvestment))
439
            return false;
441
			return false;
440
        if (warehouseId != other.warehouseId)
442
		if (pan == null) {
441
            return false;
443
			if (other.pan != null)
442
        return true;
444
				return false;
443
    }
445
		} else if (!pan.equals(other.pan))
444
 
446
			return false;
445
    @Override
447
		if (userAddress == null) {
446
    public String toString() {
448
			if (other.userAddress != null)
447
        return "FofoStore [id=" + id + ", code=" + code + ", latitude=" + latitude + ", longitude=" + longitude
449
				return false;
448
                + ", counterSize=" + counterSize + ", counterPotential=" + counterPotential + ", warehouseId="
450
		} else if (!userAddress.equals(other.userAddress))
449
                + warehouseId + ", minimumInvestment=" + minimumInvestment + ", graceDate=" + graceDate
451
			return false;
450
                + ", investmentOk=" + investmentOk + ", active=" + active + ", pan=" + pan + ", userAddress="
452
		if (warehouseId != other.warehouseId)
451
                + userAddress + ", internal=" + internal + ", bagsLastCredited=" + bagsLastCredited + ", fofoType="
453
			return false;
452
                + fofoType + ", activationType=" + activationType + ", activeTimeStamp=" + activeTimeStamp
454
		return true;
453
                + ", graceCount=" + graceCount + "]";
455
	}
454
    }
456
 
-
 
457
	@Override
-
 
458
	public String toString() {
-
 
459
		return "FofoStore [id=" + id + ", code=" + code + ", latitude=" + latitude + ", longitude=" + longitude
-
 
460
				+ ", counterSize=" + counterSize + ", counterPotential=" + counterPotential + ", warehouseId="
-
 
461
				+ warehouseId + ", minimumInvestment=" + minimumInvestment + ", graceDate=" + graceDate
-
 
462
				+ ", investmentOk=" + investmentOk + ", active=" + active + ", pan=" + pan + ", userAddress="
-
 
463
				+ userAddress + ", internal=" + internal + ", bagsLastCredited=" + bagsLastCredited + ", fofoType="
-
 
464
				+ fofoType + ", activationType=" + activationType + ", activeTimeStamp=" + activeTimeStamp
-
 
465
				+ ", graceCount=" + graceCount + "]";
-
 
466
	}
-
 
467
 
455
 
468
}
456
}
469
457