Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21716 ashik.ali 1
package com.spice.profitmandi.dao.entity.transaction;
21545 ashik.ali 2
 
29966 amit.gupta 3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
35155 ranu 4
import com.spice.profitmandi.dao.model.*;
33396 amit.gupta 5
import com.spice.profitmandi.model.WarehouseItemQtyModel;
29966 amit.gupta 6
import in.shop2020.model.v1.order.OrderStatus;
7
import in.shop2020.model.v1.order.TaxType;
8
 
32417 amit.gupta 9
import javax.persistence.*;
10
import java.io.Serializable;
11
import java.time.LocalDateTime;
12
import java.time.format.DateTimeFormatter;
13
import java.util.List;
14
 
21545 ashik.ali 15
/**
16
 * This class basically contains order details
29966 amit.gupta 17
 *
21545 ashik.ali 18
 * @author ashikali
19
 */
21634 ashik.ali 20
 
21545 ashik.ali 21
@Entity
31860 tejbeer 22
@Table(name = "transaction.`order`")
23
@NamedQueries({@NamedQuery(name = "Order.selectAll", query = "select o from Order o"), @NamedQuery(name = "Order.selectById", query = "select o from Order o where o.id= :id"), @NamedQuery(name = "Order.selectByTransactionId", query = "select t.id, t.createTimestamp, o.retailerAddress1, o.retailerAddress2, o.retailerCity, " + "o.retailerPinCode, o.retailerState, o.shippingCost, o.statusDescription, o.invoiceNumber, o.airwayBillNumber, o.totalAmount, li.brand, li.modelName, " + "li.modelNumber, li.color, li.quantity, li.unitPrice, p.id, p.name,  o.shippingTimestamp, o.status, o.promisedDeliveryTime, o.retailerName, t.status, i.catalogItemId  from Transaction t join Order o on o.transactionId = t.id " + "join LineItem li on li.orderId = o.id left join Provider p on p.id = o.logisticsProviderId join Item i on i.id=li.itemId where o.transactionId = :transactionId"),
33873 ranu 24
        @NamedQuery(name = "Order.partnerStockPoAndGrnPending",
25
                query = "select new com.spice.profitmandi.dao.model.PoAndGrnPendingPartnerStockModel" +
26
                        "(li.itemId, odr.partnerGrnTimestamp, odr.billingTimestamp) " +
27
                        "FROM Order odr " +
28
                        "JOIN LineItem li on li.orderId = odr.id " +
29
                        "WHERE odr.retailerId = (:fofoId) " +
30
                        "AND odr.refundTimestamp is null " +
31
                        "AND (odr.billingTimestamp is null OR (odr.billingTimestamp is not null AND odr.partnerGrnTimestamp is null))"),
27723 tejbeer 32
 
31860 tejbeer 33
        @NamedQuery(name = "Order.selectItemIdTypeQuantity", query = "select new com.spice.profitmandi.dao.model.ItemIdTypeQuantity(li.itemId, i.type, li.quantity) from Order o join LineItem li on li.orderId = o.id join Item i on i.id = li.itemId where o.invoiceNumber = :invoiceNumber and o.retailerId = :retailerId"),
27723 tejbeer 34
 
31860 tejbeer 35
        @NamedQuery(name = "Order.selectAllBilledOrderGroupByBrand", query = "select new com.spice.profitmandi.dao.model.SecondaryOrderBillingModel(li.brand, " + "sum(case when o.billingTimestamp >= :today then CAST(o.totalAmount  AS integer) else 0 end)," + "sum(case when o.billingTimestamp >= :threedays  and o.billingTimestamp < :endDate  then CAST(o.totalAmount  AS integer) else 0 end)," + "sum(case when concat(year(o.billingTimestamp ), month(o.billingTimestamp ))= :mtd  then CAST(o.totalAmount AS integer) else 0 end)," + "sum(case when o.billingTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(o.totalAmount  AS integer) else 0 end)," + "sum(case when o.billingTimestamp between  :lmtdStartDate and :lmsEndDate  then CAST(o.totalAmount  AS integer) else 0 end)," + "	sum(case when o.billingTimestamp >= :today then li.quantity else 0 end)," + "	sum(case when o.billingTimestamp >= :threedays and o.billingTimestamp < :endDate then li.quantity else 0 end)," + " sum(case when concat(year(o.billingTimestamp), month(o.billingTimestamp))= :mtd  then li.quantity else 0 end)," + "	sum(case when o.billingTimestamp between  :lmtdStartDate and :lmtdEndDate then li.quantity else 0 end)," + "	sum(case when o.billingTimestamp between  :lmtdStartDate and :lmsEndDate  then li.quantity else 0 end)" + " )" + "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)" + "	and o.billingTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and fs.internal = false group by li.brand"),
27723 tejbeer 36
 
31860 tejbeer 37
        @NamedQuery(name = "Order.selectAllBilledOrderGroupByBrandFofoId", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(li.brand," + "	DATE_FORMAT(o.billingTimestamp, '%m-%Y'),sum(cast(o.totalAmount AS integer)))" + "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)" + "	and o.billingTimestamp >= :startDate and o.retailerId =:fofoId  group by li.brand,DATE_FORMAT(o.billingTimestamp, '%m-%Y')"),
28439 tejbeer 38
 
34849 ranu 39
        @NamedQuery(name = "Order.selectAllBilledByCategoryOrderGroupByBrandFofoId", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(li.brand," + "	DATE_FORMAT(o.billingTimestamp, '%m-%Y'),sum(cast((li.unitPrice * li.quantity) AS integer)))" + "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId join Item i on i.id = li.itemId where o.billingTimestamp >= :startDate and o.billingTimestamp <= :endDate and o.retailerId =:fofoId and i.categoryId in (:categoryIds)  group by li.brand,DATE_FORMAT(o.billingTimestamp, '%m-%Y')"),
34721 ranu 40
 
33430 amit.gupta 41
        @NamedQuery(name = "Order.selectSecondaryGroupByYearMonth", query = "select new com.spice.profitmandi.dao.model.PartnerMonthlySaleModel(o.retailerId," + "	DATE_FORMAT(o.billingTimestamp, '%m-%Y'),sum(cast(o.totalAmount AS integer)))" + "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId where  o.billingTimestamp between :startDate and :endDate and o.retailerId in :fofoIds  group by o.retailerId, DATE_FORMAT(o.billingTimestamp, '%m-%Y')"),
31361 amit.gupta 42
 
31860 tejbeer 43
        @NamedQuery(name = "Order.selectAllBilledOrderGroupByBrandWarehouse", query = "select new com.spice.profitmandi.dao.model.SecondaryWarehouseWiseOrderBilllingModel(fs.warehouseId,date(o.billingTimestamp), li.brand, " + "sum(CAST(o.totalAmount  AS integer)),sum( li.quantity))" + "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)" + "	and o.billingTimestamp >= :startDate and  o.billingTimestamp < :endDate and (null is :brand or li.brand = :brand) and fs.internal = 0 group by fs.warehouseId, date(o.billingTimestamp), li.brand"),
27867 tejbeer 44
 
31860 tejbeer 45
        @NamedQuery(name = "Order.selectAllBilledOrderItemByBrand", query = "select new com.spice.profitmandi.dao.model.SecondaryOrderItemBillingModel(o.retailerName,li.brand,i.modelName, " + " i.modelNumber, i.color," + "o.totalAmount," + "	 li.quantity)" + "	 from Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)" + "	and date(o.billingTimestamp) in :date and fs.warehouseId in :warehouseId and li.brand = :brand and fs.internal = false order by li.itemId desc"),
27738 tejbeer 46
 
31860 tejbeer 47
        @NamedQuery(name = "Order.selectTodayBilledOrderItemByBrand", query = "select new com.spice.profitmandi.dao.model.SecondaryOrderItemBillingModel(o.retailerName,li.brand,i.modelName, " + " i.modelNumber, i.color," + "o.totalAmount," + "	 li.quantity)" + "	 from Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)" + "	and o.billingTimestamp >= :startDate and fs.warehouseId in :warehouseId and li.brand in :brand order by li.itemId desc"),
27738 tejbeer 48
 
31860 tejbeer 49
        @NamedQuery(name = "Order.selectAllBilledOrderBrandByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockBrandModel(li.brand," + "	 Sum(li.quantity),Sum(CAST(o.totalAmount AS integer)))" + "	 from Order o join LineItem li on o.id = li.orderId where o.status in (7,9,10,12)" + "	and o.billingTimestamp >= :startDate and o.billingTimestamp <= :endDate and o.retailerId = :fofoId group by li.brand"),
27893 tejbeer 50
 
31860 tejbeer 51
        @NamedQuery(name = "Order.selectAllBilledOrderBrandItemByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockBrandItemModel(" + " i.brand, i.modelName, i.modelNumber, i.color,Sum(li.quantity), Sum(CAST(o.totalAmount AS integer)))" + "	 from Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId where o.status in (7,9,10,12)" + "	and o.billingTimestamp >= :startDate and o.billingTimestamp <= :endDate and o.retailerId = :fofoId  group by i.id"),
27893 tejbeer 52
 
31860 tejbeer 53
        @NamedQuery(name = "Order.selectAllGrnPendingOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel(" + "  fs.warehouseId,fs.id,sum(li.quantity )) from FofoStore fs join  Order o on fs.id = o.retailerId " + "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on (i.id = tl.itemId ) where " + "	 fs.active = false and fs.internal = true and" + "  o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null" + "  and i.catalogItemId in :catalogItemId group by fs.id"),
28004 tejbeer 54
 
31860 tejbeer 55
        @NamedQuery(name = "Order.selectAllPendingIndentOrderByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel(" + "  fs.warehouseId,fs.id,sum(case when li.quantity is null then 0 else  li.quantity end))" + "	 from FofoStore fs  join  Order o on fs.id = o.retailerId" + "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on i.id = tl.itemId  where " + "	 fs.active = false and fs.internal = true and o.status in (3,4) and i.catalogItemId in :catalogItemId group by fs.id"),
28004 tejbeer 56
 
31860 tejbeer 57
        @NamedQuery(name = "Order.selectGrnPendingOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel(" + "  fs.warehouseId,fs.id,i.catalogItemId,sum(li.quantity )) from FofoStore fs join  Order o on fs.id = o.retailerId " + "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on (i.id = tl.itemId ) where " + "	 fs.active = true and fs.internal = false and" + "  o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null" + "  and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
28474 tejbeer 58
 
31860 tejbeer 59
        @NamedQuery(name = "Order.selectPendingIndentOrdersByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel(" + "  fs.warehouseId,fs.id,i.catalogItemId,sum(case when li.quantity is null then 0 else  li.quantity end))" + "	 from FofoStore fs  join  Order o on fs.id = o.retailerId" + "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on i.id = tl.itemId  where " + "	 fs.active = true and fs.internal = false and o.status in (3,4) and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId group by i.catalogItemId, fs.id"),
28474 tejbeer 60
 
31860 tejbeer 61
        @NamedQuery(name = "Order.selectFirstBilling", query = "select new com.spice.profitmandi.dao.model.FofoFirstBillingModel(fs.id, min(o.billingTimestamp) )" + "	from FofoStore fs  join  Order o on fs.id = o.retailerId  group by fs.id"),
30673 amit.gupta 62
 
36327 amit 63
        @NamedQuery(name = "Order.selectFirstBillingByRetailer",
64
                query = "select min(o.billingTimestamp) from Order o " +
65
                        "where o.retailerId = :retailerId and o.billingTimestamp >= :minDate"),
66
 
31860 tejbeer 67
        @NamedQuery(name = "Order.selectAllGrnPendingOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel(" + "  fs.warehouseId,fs.id,sum(li.quantity ),i.brand,i.modelName,i.modelNumber,i.catalogItemId) from FofoStore fs join  Order o on fs.id = o.retailerId " + "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on (i.id = tl.itemId ) where fs.active = true and fs.internal = false and" + "  o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null" + "  and tl.mop between :startPrice and :endPrice and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
28004 tejbeer 68
 
34813 aman 69
//        query = "select o.*,tl.sellingPrice as tlSellingPrice" +
70
//        "from FofoStore fs " +
71
        @NamedQuery(
72
                name = "Order.selectGrnPendingByFofoIdForAllMobile",
73
                query = "select o " +
74
                        "from FofoStore fs " +
75
                        "join Order o on fs.id = o.retailerId " +
76
                        "join LineItem li on o.id = li.orderId " +
77
                        "join TagListing tl on tl.itemId = li.itemId " +
78
                        "join Item i on i.id = tl.itemId " +
79
                        "where fs.active = true and fs.internal = false " +
80
                        "and fs.id = :fofoId " +
81
                        "and o.billingTimestamp is not null " +
82
                        "and o.refundTimestamp is null " +
83
                        "and o.partnerGrnTimestamp is null " +
84
                        "and i.categoryId = 10006 " +
85
                        "group by o.id"
86
        ),
31860 tejbeer 87
        @NamedQuery(name = "Order.selectAllPendingIndentOrderByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel(" + "  fs.warehouseId, fs.id,sum(case when li.quantity is null then 0 else  li.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)" + "	 from FofoStore fs  join  Order o on fs.id = o.retailerId" + "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on i.id = tl.itemId  where " + "	 fs.active = true and fs.internal = false and o.status in (3,4) and tl.mop between :startPrice and :endPrice  and i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
28004 tejbeer 88
 
31860 tejbeer 89
        @NamedQuery(name = "Order.selectAllGrnPendingOrderItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel(" + "  fs.warehouseId, fs.id, sum(li.quantity), i.brand, i.modelName, i.modelNumber, i.catalogItemId) from FofoStore fs join  Order o on fs.id = o.retailerId " + "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on (i.id = tl.itemId ) where " + "	 fs.active = true and fs.internal = false and" + "  o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null" + "  and i.catalogItemId in :catalogItemId and  i.categoryId=10006 and fs.id = :fofoId group by i.catalogItemId, i.brand,i.modelName,i.modelNumber"),
28032 tejbeer 90
 
31860 tejbeer 91
        @NamedQuery(name = "Order.selectAllPendingIndentOrderItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel(" + "   fs.warehouseId, fs.id, sum(li.quantity), i.brand, i.modelName, i.modelNumber, i.catalogItemId)" + "	 from FofoStore fs  join  Order o on fs.id = o.retailerId" + "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on i.id = tl.itemId  where " + "	 fs.active = true and fs.internal = false and o.status in (3,4) and i.catalogItemId in :catalogItemId and  i.categoryId=10006 and fs.id = :fofoId group by i.catalogItemId, i.brand,i.modelName,i.modelNumber"),
28032 tejbeer 92
 
31860 tejbeer 93
        @NamedQuery(name = "Order.selectGroupByBrandLmp", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(li.brand," + " DATE_FORMAT(o.billingTimestamp,:groupParameter ),sum(cast(o.totalAmount AS integer)))" + "	 from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId where o.status in (7,9,10,12)" + "	and (o.billingTimestamp between :lmsStartDate and :endDate) and fs.id in :fofoId and fs.warehouseId in :warehouseId and fs.internal = false group by li.brand,DATE_FORMAT(o.billingTimestamp, :groupParameter)"),
28461 tejbeer 94
 
31860 tejbeer 95
        @NamedQuery(name = "Order.selectGrnPendingOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)" + "  from FofoStore fs join  Order o on fs.id = o.retailerId " + "  join LineItem li on o.id = li.orderId  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on (i.id = tl.itemId ) where  fs.active = true and fs.internal = false and" + "  o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null" + "  and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
28486 tejbeer 96
 
31860 tejbeer 97
        @NamedQuery(name = "Order.selectPendingIndentOrderQtyByCatalogId", query = "select sum(case when li.quantity is null then 0 else  li.quantity end)" + "	 from FofoStore fs  join  Order o on fs.id = o.retailerId" + "  join LineItem li on o.id = li.orderId " + "  join TagListing tl on tl.itemId = li.itemId " + "  join Item i on i.id = tl.itemId  where " + "	 fs.active = true and fs.internal = false and o.status in (3,4)and i.catalogItemId = :catalogItemId and fs.id = :fofoId group by i.catalogItemId, fs.id"),
28486 tejbeer 98
 
33947 ranu 99
        @NamedQuery(name = "Order.selectTodayOrders", query = "select new com.spice.profitmandi.dao.model.BrandRegionPOModel(" + " case when (pr.regionId is not null) then pr.regionId else fs.warehouseId end  , li.brand, " + " sum(case when (o.createTimestamp between :startDate and :endDate and o.refundTimestamp is null) then cast(o.totalAmount AS integer ) else 0 end)," + " sum(case when (o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)) then cast(o.totalAmount AS integer) else 0 end)," + " sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end))" + "	from Order o join LineItem li on o.id = li.orderId join FofoStore fs on fs.id = o.retailerId" + " left join PartnerRegion pr on pr.fofoId=o.retailerId and pr.regionId=18" + " where o.refundTimestamp is null and ((o.createTimestamp between :startDate and :endDate) or (o.billingTimestamp between :startDate and :endDate)) and fs.internal = false and li.brand not in ('Smartdukaan','Dummy')" + " group by case when (pr.regionId is not null) then pr.regionId else fs.warehouseId end, li.brand"),
35155 ranu 100
       /* @NamedQuery(name = "Order.selectTodayOrdersRBM", query = "select new  com.spice.profitmandi.dao.model.BrandAuthUserPOModel( p.authUserId," +
101
                "       li.brand," +
102
                "       sum(case" +
103
                "               when (o.createTimestamp between :startDate and :endDate and o.refundTimestamp is null) then cast(o.totalAmount AS integer )" +
104
                "               else 0 end)," +
105
                "       sum(case" +
106
                "               when o.billingTimestamp is not null and (o.createTimestamp between :startDate and :endDate)" +
107
                "                   then cast(o.totalAmount AS integer )" +
108
                "               else 0 end)," +
33801 amit.gupta 109
                "       sum(case when o.billingTimestamp is not null then cast(o.totalAmount AS integer ) else 0 end)," +
35155 ranu 110
                " cast (count(distinct o.retailerId) as int))" +
111
                "from Order o" +
112
                "         join LineItem li" +
113
                "              on o.id = li.orderId" +
114
                "         join FofoStore fs on fs.id = o.retailerId" +
115
                "         join PartnerPosition pp on pp.fofoId = o.retailerId" +
116
                "         join Position p on p.id = pp.positionId" +
117
                "where o.refundTimestamp is null" +
118
                "  and ((o.createTimestamp between :startDate and :endDate) or (o.billingTimestamp between :startDate and :endDate))" +
119
                "  and fs.internal = false" +
120
                "  and p.categoryId = :categoryId" +
121
                "  and p.escalationType = :escalationType" +
122
                "  and li.brand not in ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')" +
35154 ranu 123
                "group by p.authUserId, li.brand"),
35155 ranu 124
*/
125
        @NamedQuery(name = "Order.selectTodayPartnersBilledRBM", query = "select new  com.spice.profitmandi.dao.model.AuthIdPartnerCountModel( p.authUserId," +
126
                "       cast (count(distinct o.retailerId) as int))" +
127
                "from Order o" +
128
                "         join LineItem li" +
129
                "              on o.id = li.orderId" +
130
                "         join FofoStore fs on fs.id = o.retailerId" +
131
                "         join PartnerPosition pp on pp.fofoId = o.retailerId" +
132
                "         join Position p on p.id = pp.positionId" +
133
                " where o.refundTimestamp is null" +
134
                "  and (o.createTimestamp between :startDate and :endDate)" +
135
                "  and fs.internal = false" +
136
                "  and p.categoryId = 18" +
137
                "  and p.escalationType = 'L1'" +
138
                "  and li.brand not in ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')" +
33805 amit.gupta 139
                "group by p.authUserId"),
140
 
31860 tejbeer 141
        @NamedQuery(name = "Order.selectAllPendingIndentAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.status in (3,4) and i.categoryId != 10006 group by o.retailerId"),
30003 tejbeer 142
 
35490 ranu 143
        @NamedQuery(name = "Order.selectAllQtyPendingIndentAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvQtyFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(li.quantity  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(li.quantity  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.status in (3,4) and i.categoryId != 10006 group by o.retailerId"),
144
 
31860 tejbeer 145
        @NamedQuery(name = "Order.selectAllGrnPendingAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(o.totalAmount  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(o.totalAmount  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null and i.categoryId != 10006 group by o.retailerId"),
30003 tejbeer 146
 
35490 ranu 147
        @NamedQuery(name = "Order.selectAllQtyGrnPendingAccessoriesTvGroupByFofoId", query = "select new com.spice.profitmandi.dao.model.InStockAccessoriesTvQtyFofoIdModel(" + "  o.retailerId, SUM(case when c.parentCategoryId  = 10011 then CAST(li.quantity  AS integer) else 0 end), SUM(case when c.parentCategoryId  = 14200 then  CAST(li.quantity  AS integer) else 0 end))" + "	 from  Order o join LineItem li on o.id = li.orderId join Item i on i.id = li.itemId  join Category c on c.id = i.categoryId " + "  where o.retailerId in :fofoIds and o.billingTimestamp is not null and o.refundTimestamp is null and o.partnerGrnTimestamp is null and i.categoryId != 10006 group by o.retailerId"),
148
 
31860 tejbeer 149
        @NamedQuery(name = "Order.selectPartnersBilledBetweenDates", query = "select new com.spice.profitmandi.dao.model.PartnerSecondaryModel(fs.warehouseId, fs.id, count(o.id), sum(o.totalAmount) )" + " from FofoStore fs left join Order o on (fs.id=o.retailerId and o.billingTimestamp between :startDate and :endDate " + " and o.refundTimestamp is null) where" + " fs.internal = false and (fs.active= true or o.retailerId is not null)  group by fs.warehouseId, fs.id"),
31539 amit.gupta 150
 
31860 tejbeer 151
        @NamedQuery(name = "Order.selectCollectionSummary", query = "select new com.spice.profitmandi.dao.model.CollectionSummary(pot.createTimestamp, " + "  pot.referenceType,sum(case when po.name = 'CASH' then cast(pot.amount As int) else 0 end)," + "  sum(case when po.name = 'PINELABS' then cast(pot.amount As int) else 0 end)," + "  sum(case when po.name = 'BAJAJ FINSERV' then cast(pot.amount As int) else 0 end)," + "  sum(case when po.name = 'HOME CREDIT' then cast(pot.amount As int) else 0 end)," + "  sum(case when po.name = 'PAYTM' then cast(pot.amount As int) else 0 end)," + "  sum(case when po.name = 'CAPITAL FIRST' then cast(pot.amount As int) else 0 end)," + "  sum(case when po.name = 'ZEST MONEY' then cast(pot.amount As int) else 0 end)," + "  sum(case when po.name = 'SAMSUNG SURE' then cast(pot.amount As int) else 0 end),sum(cast(pot.amount As int)))" + "	 from PaymentOptionTransaction pot join PaymentOption po on pot.paymentOptionId=po.id join com.spice.profitmandi.dao.entity.user.User u on u.id=pot.fofoId" + "	 join Address a on a.id=u.addressId where 1=1 and  pot.fofoId = :fofoId and pot.createTimestamp between :startDate and :endDate " + "  group by (pot.createTimestamp), pot.referenceType "),
30279 tejbeer 152
 
31860 tejbeer 153
 
34641 ranu 154
        @NamedQuery(name = "Order.getLastOrderByFofoId", query = "select COALESCE(Max(o.id),0) from  Order o where  o.retailerId = :fofoId and o.status in (7,9,10,12)"),
31860 tejbeer 155
 
32478 amit.gupta 156
        @NamedQuery(name = "Order.selectOrderValueByCreateDateGroupByFofoId", query = "select new com.spice.profitmandi.common.model.IdAmountModel(o.retailerId, sum(o.totalAmount)) from  Order o where  o.retailerId in :retailerIds and o.status in :status and o.createTimestamp between :startDate and :endDate group by o.retailerId"),
34715 ranu 157
 
158
        @NamedQuery(name = "Order.selectOrderValueByBillingDateGroupByFofoId", query = "select new com.spice.profitmandi.common.model.IdAmountModel(o.retailerId, sum(o.totalAmount)) from  Order o where  o.retailerId in :retailerIds and o.billingTimestamp between :startDate and :endDate group by o.retailerId"),
159
 
33189 amit.gupta 160
        @NamedQuery(name = "Order.selectOrdersByBilledDateCatalogId",
161
                query = "select new com.spice.profitmandi.common.model.GrnPendingDataModel(" +
162
                        "o.retailerId, fs.code, o.retailerName, o.invoiceNumber, o.billingTimestamp, l.itemId, l.brand, l.modelName, l.modelNumber, l.color, " +
163
                        "l.unitPrice, lii.serialNumber, v.name, wi.created, ai.activationTimestamp, ai.createTimestamp)" +
31860 tejbeer 164
 
33189 amit.gupta 165
                        "from Order o join FofoStore fs on fs.id = o.retailerId" +
166
                        "         join LineItem l on l.orderId = o.id" +
167
                        "         join LineItemImei lii on lii.lineItemId = l.id" +
168
                        "         join Warehouse w on w.id = o.fulfilmentWarehouseId" +
169
                        "         join Vendor v on v.id = w.vendor" +
170
                        "         join WarehouseInventoryItem wi on wi.serialNumber = lii.serialNumber" +
171
                        "         join WarehouseScan  ws on (ws.orderId = o.id and ws.type = 'SALE' and wi.id = ws.inventoryItemId)" +
33202 amit.gupta 172
                        "         join Item i on i.id=l.itemId " +
173
                        "  left join ActivatedImei ai on ai.serialNumber = lii.serialNumber " +
174
                        "where fs.internal=false and i.catalogItemId=:catalogId and o.billingTimestamp >= :startDate " +
175
                        "and (:endDate is null or o.billingTimestamp < :endDate) and (o.refundTimestamp is null or o.refundTimestamp <= :endDate)"),
33443 ranu 176
        @NamedQuery(
177
                name = "Order.selectAllLiveDemoBrandItemsByBillingDate",
178
                query = "select new com.spice.profitmandi.dao.model.LiveDemoOrderLineItemModel (" +
179
                        "o.id, " +
180
                        "o.invoiceNumber, " +
181
                        "o.billingTimestamp, " +
182
                        "o.retailerName, " +
183
                        "o.retailerCity, " +
184
                        "o.retailerPinCode, " +
185
                        "o.retailerState, " +
186
                        "lii.serialNumber, " +
187
                        "li.modelNumber, " +
188
                        "li.modelName, " +
189
                        "li.brand," +
190
                        "li.itemId )" +
191
                        "FROM Order o JOIN LineItem li on o.id = li.orderId " +
192
                        "JOIN LineItemImei lii on li.id = lii.lineItemId " +
193
                        "WHERE li.brand = 'Live Demo' " +
194
                        "AND o.billingTimestamp between  :startDate and :endDate"
33464 ranu 195
        ),
196
 
197
        @NamedQuery(
198
                name = "Order.selectTodayPocoBilling",
199
                query = "select new com.spice.profitmandi.dao.model.LiveDemoOrderLineItemModel (" +
200
                        "o.id, " +
201
                        "o.invoiceNumber, " +
202
                        "o.billingTimestamp, " +
203
                        "o.retailerName, " +
204
                        "o.retailerCity, " +
205
                        "o.retailerPinCode, " +
206
                        "o.retailerState, " +
207
                        "lii.serialNumber, " +
208
                        "li.modelNumber, " +
209
                        "li.modelName, " +
210
                        "li.brand," +
211
                        "li.itemId )" +
212
                        "FROM Order o JOIN LineItem li on o.id = li.orderId " +
213
                        "JOIN LineItemImei lii on li.id = lii.lineItemId " +
214
                        "JOIN FofoStore fs on fs.id=o.retailerId "+
215
                        "WHERE li.brand = 'POCO' " +
216
                        "AND fs.internal = false " +
217
                        "AND o.billingTimestamp between  :startDate and :endDate"
33443 ranu 218
        )
32478 amit.gupta 219
 
33189 amit.gupta 220
 
33443 ranu 221
 
21545 ashik.ali 222
})
30110 tejbeer 223
//@NamedNativeQuery(name = "Order.findByEmailAddress", query = "select * from transaction.`order` o where  o.id = '1694173'", resultClass = Order.class)
224
 
30161 manish 225
@NamedNativeQueries({
30110 tejbeer 226
 
31860 tejbeer 227
        @NamedNativeQuery(name = "Order.selectAllOrderWeight", query = "select i.catalog_item_id from transaction.`order` o join transaction.lineitem li on o.id = li.order_id " + "join catalog.item i on i.id = li.item_id   " + "where date(o.created_timestamp) between :startDate and :endDate  and o.status = 12 and i.hsnCode = '85171300' and i.brand != 'Live Demo'" + " group by i.catalog_item_id order by  sum((datediff(now(),o.created_timestamp)/30)*li.quantity) desc"),
31604 tejbeer 228
 
35631 ranu 229
        @NamedNativeQuery(name = "selectPartnerSecondaryGroupByBrand", query = "select ifnull(a.customer_id,fs.id) as id,ifnull(a.sb,brand) as brand,a.secondary_plan,sum(a.total_price) as total_price,a.auth_id, a.commited_timestamp from " + "fofo.fofo_store fs left join (select o.customer_id , li.brand as sb, li.total_price, psp.fofo_id , psp.brand, psp.secondary_plan,psp.auth_id,psp.commited_timestamp from transaction.`order` o join transaction.lineitem li on " + "(o.id = li.order_id) left join  auth.partner_secondary_plan psp on (psp.fofo_id = o.customer_id  and psp.commited_timestamp >= :startDate and " + "psp.active = 1 and psp.brand = li.brand ) where o.customer_id in :fofoIds and  o.status in (7,9,10,12) and o.billing_timestamp >= :startDate and o.billing_timestamp < :nextDate" + " union select if(li.brand is null, null, o.customer_id) as customer_id, li.brand as sb, li.total_price, psp.fofo_id , psp.brand, psp.secondary_plan,psp.auth_id, psp.commited_timestamp " + " from auth.partner_secondary_plan psp  left join transaction.`order` o on (psp.fofo_id = o.customer_id and o.status in (7,9,10,12) and o.billing_timestamp >= :startDate and o.billing_timestamp < :nextDate) " + "left join transaction.lineitem li on  (o.id = li.order_id and psp.brand=li.brand) where psp.fofo_id in :fofoIds and psp.commited_timestamp >= :startDate " + "and psp.active = 1) a on fs.id = a.customer_id or fs.id = a.fofo_id where fs.id in :fofoIds group by id,brand;", resultSetMapping = "partnerSecondaryPlanModel"),
30161 manish 230
 
33145 tejus.loha 231
        @NamedNativeQuery(name = "selectPriceDropReport", query = "select fs.code, pd.id, ci.brand,ci.model_name,"
232
                + " ci.model_number,pd.affected_on, pd.amount, pd.partner_payout, pdi.imei, pdi.status, pdi.update_timestamp, pdi.rejection_reason,pdi.credit_timestamp,pdi.reject_timestamp"
233
                + " from transaction.price_drop pd join transaction.price_drop_imei pdi on pdi.price_drop_id = pd.id "
234
                + " join (select catalog_item_id, brand, model_name, model_number from catalog.item group by catalog_item_id )"
235
                + " ci on ci.catalog_item_id=pd.catalog_id join fofo.fofo_store fs on fs.id=pdi.retailer_id where  pdi.retailer_id = :fofoId and pd.affected_on between :startDate and :endDate and pd.amount > 0;",
236
                resultSetMapping = "PriceDropReportModel"),
30279 tejbeer 237
 
32044 tejbeer 238
        @NamedNativeQuery(name = "Order.selectCreateToBillingAvg", query = "select o.customer_id, avg(DATEDIFF(o.billing_timestamp,o.created_timestamp)) as average from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and fs.internal = 0  group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
31860 tejbeer 239
 
32044 tejbeer 240
        @NamedNativeQuery(name = "Order.selectBillingToDeliverAvg", query = "select o.customer_id, avg(DATEDIFF(o.delivery_timestamp,o.billing_timestamp)) as average  from transaction.`order` o join fofo.fofo_store fs on o.customer_id = fs.id where date(o.created_timestamp) between :startDate and :endDate  and  o.billing_timestamp is not null and o.delivery_timestamp is not null and fs.internal = 0 group by o.customer_id", resultSetMapping = "BillingDaysAvg"),
241
 
242
 
243
        @NamedNativeQuery(name = "Order.getLastOrders", query = "select o.customer_id, Max(o.created_timestamp) as maxdate  from transaction.`order` o join fofo.fofo_store fs on  fs.id = o.customer_id where o.status in (7,9,10,12) and o.delivery_timestamp is not null and fs.internal = 0 group by o.customer_id", resultSetMapping = "LastSaleDays"),
244
 
33396 amit.gupta 245
        @NamedNativeQuery(name = "Order.itemAvailability", query = "select grouped.item_id, " +
246
                "       grouped.vendor_warehouse_id, " +
247
                "       sum(grouped.availability)                    as availability, " +
248
                "       sum(grouped.reserved)                        as reserved, " +
249
                "       sum(grouped.availability - grouped.reserved) as net_availability " +
250
                "from (select l.item_id, " +
251
                "             o.fulfilmentWarehouseId as vendor_warehouse_id, " +
252
                "             0                       as availability, " +
253
                "             sum(l.quantity)         as reserved " +
254
                "      from fofo.fofo_store fs " +
255
                "               join transaction.order o on o.customer_id = fs.id " +
256
                "               join transaction.lineitem l on l.order_id = o.id " +
257
                "               join catalog.item i on i.id = l.item_id " +
258
                "      where o.status in (3, 4) " +
259
                "        and l.item_id in :itemIds " +
260
                "        and o.warehouse_id = :warehouseId " +
261
                "      group by l.item_id, o.warehouse_id, o.fulfilmentWarehouseId " +
262
                "      union " +
263
                "      select ii.itemId                                                                                 AS item_id, " +
264
                "             ii.currentWarehouseId, " +
265
                "             sum((case " +
266
                "                      when (s2.type in ('SALE', 'LOST_IN_WAREHOUSE', 'PURCHASE_RETURN', 'MARKED_USED', 'MARKED_BAD')) " +
267
                "                          then -(s2.quantity) " +
268
                "                      when (s2.type in ('PURCHASE', 'SALE_RET', 'MARKED_GOOD')) then s2.quantity end)) AS availability, " +
269
                "             0                                                                                         as reserved " +
270
                "      from ((warehouse.scanNew s1 join warehouse.scanNew s2 " +
271
                "          on ((s1.inventoryItemId = s2.inventoryItemId))) join warehouse.inventoryItem ii " +
272
                "          on ((ii.id = s2.inventoryItemId)) join catalog.item i on i.id = ii.itemId) " +
273
                "      where ((s1.type = 'PURCHASE') and (s1.scannedAt >= '2017-07-01')) " +
274
                "        and ii.itemId in :itemIds " +
275
                "        and ii.physicalWarehouseId = :warehouseId " +
276
                "      group by ii.itemId, ii.currentWarehouseId) as grouped " +
277
                "group by item_id, vendor_warehouse_id", resultSetMapping = "itemAvailabilityReservationMapping"),
32044 tejbeer 278
 
35155 ranu 279
        @NamedNativeQuery(
35153 ranu 280
                name = "Order.selectTodayOrdersRBM",
35473 amit 281
                query = "SELECT auth_user_id, brand, " +
282
                        "       SUM(today_po_value) AS today_po_value, " +
283
                        "       SUM(today_billed_value) AS today_billed_value, " +
284
                        "       SUM(total_billed_value) AS total_billed_value, " +
285
                        "       COUNT(DISTINCT customer_id) AS partner_count " +
286
                        "FROM ( " +
35475 amit 287
                        "    SELECT p.auth_user_id, li.brand, o.customer_id, " +
35473 amit 288
                        "           CASE WHEN o.refund_timestamp IS NULL THEN o.total_amount ELSE 0 END AS today_po_value, " +
289
                        "           CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END AS today_billed_value, " +
290
                        "           CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END AS total_billed_value " +
291
                        "    FROM transaction.`order` o " +
292
                        "    JOIN transaction.lineitem li ON o.id = li.order_id " +
293
                        "    JOIN fofo.fofo_store fs ON fs.id = o.customer_id " +
35475 amit 294
                        "    JOIN cs.partner_position ps ON ps.partner_id = fs.id " +
295
                        "    JOIN cs.position p ON p.id = ps.position_id AND p.category_id = :categoryId AND p.escalation_type = :escalationType " +
296
                        "    WHERE o.refund_timestamp IS NULL AND o.created_timestamp BETWEEN :startDate AND :endDate " +
297
                        "      AND fs.internal = FALSE AND li.brand NOT IN ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo') " +
35473 amit 298
                        "    UNION ALL " +
35475 amit 299
                        "    SELECT p.auth_user_id, li.brand, o.customer_id, 0, 0, " +
300
                        "           CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END " +
35473 amit 301
                        "    FROM transaction.`order` o " +
302
                        "    JOIN transaction.lineitem li ON o.id = li.order_id " +
303
                        "    JOIN fofo.fofo_store fs ON fs.id = o.customer_id " +
35475 amit 304
                        "    JOIN cs.partner_position ps ON ps.partner_id = fs.id " +
305
                        "    JOIN cs.position p ON p.id = ps.position_id AND p.category_id = :categoryId AND p.escalation_type = :escalationType " +
306
                        "    WHERE o.refund_timestamp IS NULL AND o.billing_timestamp BETWEEN :startDate AND :endDate " +
35473 amit 307
                        "      AND o.created_timestamp NOT BETWEEN :startDate AND :endDate " +
35475 amit 308
                        "      AND fs.internal = FALSE AND li.brand NOT IN ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo') " +
309
                        "    UNION ALL " +
310
                        "    SELECT p.auth_user_id, li.brand, o.customer_id, " +
311
                        "           CASE WHEN o.refund_timestamp IS NULL THEN o.total_amount ELSE 0 END, " +
312
                        "           CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END, " +
313
                        "           CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END " +
314
                        "    FROM transaction.`order` o " +
315
                        "    JOIN transaction.lineitem li ON o.id = li.order_id " +
316
                        "    JOIN fofo.fofo_store fs ON fs.id = o.customer_id " +
317
                        "    JOIN cs.partner_region pr ON pr.fofo_id = fs.id " +
318
                        "    JOIN cs.partner_position ps ON ps.partner_id = 0 AND ps.region_id = pr.region_id " +
319
                        "    JOIN cs.position p ON p.id = ps.position_id AND p.category_id = :categoryId AND p.escalation_type = :escalationType " +
320
                        "    WHERE o.refund_timestamp IS NULL AND o.created_timestamp BETWEEN :startDate AND :endDate " +
321
                        "      AND fs.internal = FALSE AND li.brand NOT IN ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo') " +
322
                        "    UNION ALL " +
323
                        "    SELECT p.auth_user_id, li.brand, o.customer_id, 0, 0, " +
324
                        "           CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END " +
325
                        "    FROM transaction.`order` o " +
326
                        "    JOIN transaction.lineitem li ON o.id = li.order_id " +
327
                        "    JOIN fofo.fofo_store fs ON fs.id = o.customer_id " +
328
                        "    JOIN cs.partner_region pr ON pr.fofo_id = fs.id " +
329
                        "    JOIN cs.partner_position ps ON ps.partner_id = 0 AND ps.region_id = pr.region_id " +
330
                        "    JOIN cs.position p ON p.id = ps.position_id AND p.category_id = :categoryId AND p.escalation_type = :escalationType " +
331
                        "    WHERE o.refund_timestamp IS NULL AND o.billing_timestamp BETWEEN :startDate AND :endDate " +
332
                        "      AND o.created_timestamp NOT BETWEEN :startDate AND :endDate " +
333
                        "      AND fs.internal = FALSE AND li.brand NOT IN ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo') " +
35473 amit 334
                        ") AS combined " +
335
                        "GROUP BY auth_user_id, brand " +
336
                        "ORDER BY auth_user_id, brand",
35153 ranu 337
                resultSetMapping = "TodayPoByAuthUsers"
35172 ranu 338
        ),
339
 
340
        @NamedNativeQuery(
341
                name = "Order.selectTodayOrdersModelWise",
342
                query = "SELECT o.created_timestamp,o.customer_name,fs.code,fs.warehouse_id, li.brand,concat(i.model_name, ' ', i.model_number) as modal,i.catalog_item_id ,coalesce(cc.status, '-') as status,sum(li.quantity) as quantity," +
343
                        "       SUM(" +
344
                        "               CASE" +
345
                        "                   WHEN (o.created_timestamp BETWEEN :startDate AND :endDate and o.refund_timestamp is null)" +
346
                        "                       AND o.refund_timestamp IS NULL" +
347
                        "                       THEN o.total_amount" +
348
                        "                   ELSE 0" +
349
                        "                   END" +
350
                        "           )    AS today_po_value," +
351
                        "       SUM(" +
352
                        "               CASE" +
353
                        "                   WHEN o.billing_timestamp IS NOT NULL" +
354
                        "                       AND (o.created_timestamp BETWEEN :startDate AND :endDate)" +
355
                        "                       THEN o.total_amount" +
356
                        "                   ELSE 0" +
357
                        "                   END" +
358
                        "           ) AS today_billed_value" +
359
                        " FROM transaction.`order` o" +
360
                        "         JOIN transaction.lineitem li" +
361
                        "              ON o.id = li.order_id" +
362
                        "         JOIN fofo.fofo_store fs ON fs.id = o.customer_id" +
363
                        " join catalog.item i on i.id = li.item_id" +
364
                        " join catalog.catagoriesd_catalog cc on i.catalog_item_id = cc.catalog_id AND cc.end_date IS NULL" +
365
                        " WHERE o.refund_timestamp IS NULL" +
366
                        "  AND (" +
367
                        "        (o.created_timestamp BETWEEN :startDate AND :endDate)" +
368
                        "        OR (o.billing_timestamp BETWEEN :startDate AND :endDate)" +
369
                        "    )" +
370
                        "  AND fs.internal = FALSE" +
371
                        "  AND fs.active = TRUE" +
372
                        "  AND li.brand NOT IN ('Smartdukaan', 'Dummy', 'FOC', 'Live Demo')" +
373
                        "GROUP BY o.customer_id, i.catalog_item_id",
374
                resultSetMapping = "TodayPoByCatalog"
35474 amit 375
        ),
376
 
377
        @NamedNativeQuery(
378
                name = "Order.selectTodayOrdersNative",
379
                query = "SELECT " +
380
                        "    COALESCE(pr.region_id, fs.warehouse_id) AS warehouse_id, " +
381
                        "    combined.brand, " +
382
                        "    SUM(combined.today_po_value) AS today_po_value, " +
383
                        "    SUM(combined.today_billed_value) AS today_billed_value, " +
384
                        "    SUM(combined.total_billed_value) AS total_billed_value " +
385
                        "FROM ( " +
386
                        "    SELECT " +
387
                        "        o.customer_id, " +
388
                        "        li.brand, " +
389
                        "        CASE WHEN o.refund_timestamp IS NULL THEN o.total_amount ELSE 0 END AS today_po_value, " +
390
                        "        CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END AS today_billed_value, " +
391
                        "        CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END AS total_billed_value " +
392
                        "    FROM transaction.`order` o " +
393
                        "    JOIN transaction.lineitem li ON o.id = li.order_id " +
394
                        "    JOIN fofo.fofo_store fs2 ON fs2.id = o.customer_id " +
395
                        "    WHERE o.refund_timestamp IS NULL " +
396
                        "      AND o.created_timestamp BETWEEN :startDate AND :endDate " +
397
                        "      AND fs2.internal = FALSE " +
398
                        "      AND li.brand NOT IN ('Smartdukaan', 'Dummy') " +
399
                        "    UNION ALL " +
400
                        "    SELECT " +
401
                        "        o.customer_id, " +
402
                        "        li.brand, " +
403
                        "        0 AS today_po_value, " +
404
                        "        0 AS today_billed_value, " +
405
                        "        CASE WHEN o.billing_timestamp IS NOT NULL THEN o.total_amount ELSE 0 END AS total_billed_value " +
406
                        "    FROM transaction.`order` o " +
407
                        "    JOIN transaction.lineitem li ON o.id = li.order_id " +
408
                        "    JOIN fofo.fofo_store fs2 ON fs2.id = o.customer_id " +
409
                        "    WHERE o.refund_timestamp IS NULL " +
410
                        "      AND o.billing_timestamp BETWEEN :startDate AND :endDate " +
411
                        "      AND o.created_timestamp NOT BETWEEN :startDate AND :endDate " +
412
                        "      AND fs2.internal = FALSE " +
413
                        "      AND li.brand NOT IN ('Smartdukaan', 'Dummy') " +
414
                        ") AS combined " +
415
                        "JOIN fofo.fofo_store fs ON fs.id = combined.customer_id " +
416
                        "LEFT JOIN cs.partner_region pr ON pr.fofo_id = combined.customer_id AND pr.region_id = 18 " +
417
                        "GROUP BY COALESCE(pr.region_id, fs.warehouse_id), combined.brand " +
418
                        "ORDER BY warehouse_id, combined.brand",
419
                resultSetMapping = "TodayPoByRegion"
35155 ranu 420
        )
33396 amit.gupta 421
 
30161 manish 422
})
423
 
30279 tejbeer 424
@SqlResultSetMappings({
33396 amit.gupta 425
        @SqlResultSetMapping(name = "itemAvailabilityReservationMapping", classes = {@ConstructorResult(targetClass = WarehouseItemQtyModel.class,
426
                columns = {@ColumnResult(name = "item_id", type = Integer.class), @ColumnResult(name = "vendor_warehouse_id", type = Integer.class), 
427
                        @ColumnResult(name = "availability", type = Integer.class),
428
                        @ColumnResult(name = "reserved", type = Integer.class), @ColumnResult(name = "net_availability", type = Integer.class)})}),
30161 manish 429
 
31860 tejbeer 430
        @SqlResultSetMapping(name = "partnerSecondaryPlanModel", classes = {@ConstructorResult(targetClass = PartnerSecondaryPlanModel.class, columns = {@ColumnResult(name = "id", type = Integer.class), @ColumnResult(name = "brand", type = String.class), @ColumnResult(name = "secondary_plan", type = Long.class), @ColumnResult(name = "total_price", type = Long.class), @ColumnResult(name = "auth_id", type = Integer.class), @ColumnResult(name = "commited_timestamp", type = LocalDateTime.class)})}),
30279 tejbeer 431
 
33145 tejus.loha 432
        @SqlResultSetMapping(name = "PriceDropReportModel", classes = {@ConstructorResult(targetClass = PriceDropReportModel.class, columns = {@ColumnResult(name = "code", type = String.class), @ColumnResult(name = "id", type = Integer.class), @ColumnResult(name = "brand", type = String.class), @ColumnResult(name = "model_name", type = String.class), @ColumnResult(name = "model_number", type = String.class), @ColumnResult(name = "affected_on", type = LocalDateTime.class), @ColumnResult(name = "amount", type = Float.class), @ColumnResult(name = "partner_payout", type = Float.class), @ColumnResult(name = "imei", type = String.class), @ColumnResult(name = "status", type = String.class), @ColumnResult(name = "update_timestamp", type = LocalDateTime.class), @ColumnResult(name = "rejection_reason", type = String.class), @ColumnResult(name = "credit_timestamp", type = LocalDateTime.class), @ColumnResult(name = "reject_timestamp", type = LocalDateTime.class)})}),
30279 tejbeer 433
 
32044 tejbeer 434
        @SqlResultSetMapping(name = "BillingDaysAvg", classes = {@ConstructorResult(targetClass = BillingDaysAvg.class, columns = {@ColumnResult(name = "customer_id", type = Integer.class), @ColumnResult(name = "average", type = Long.class)})}),
435
 
35153 ranu 436
        @SqlResultSetMapping(name = "LastSaleDays", classes = {@ConstructorResult(targetClass = LastSaleDateModel.class, columns = {@ColumnResult(name = "customer_id", type = Integer.class), @ColumnResult(name = "maxdate", type = LocalDateTime.class)})}),
437
        @SqlResultSetMapping(name = "TodayPoByAuthUsers",
35155 ranu 438
                classes = @ConstructorResult(
439
                        targetClass = BrandAuthUserPOModel.class,
35153 ranu 440
                        columns = {
35155 ranu 441
                                @ColumnResult(name = "auth_user_id", type = Integer.class),
35153 ranu 442
                                @ColumnResult(name = "brand", type = String.class),
35155 ranu 443
                                @ColumnResult(name = "today_po_value", type = Long.class),
444
                                @ColumnResult(name = "today_billed_value", type = Long.class),
445
                                @ColumnResult(name = "total_billed_value", type = Long.class),
446
                                @ColumnResult(name = "partner_count", type = Integer.class)
447
                        }
448
                )
35172 ranu 449
        ),
450
 
451
        @SqlResultSetMapping(name = "TodayPoByCatalog",
452
                classes = @ConstructorResult(
453
                        targetClass = ModelWisePartnerPoModel.class,
454
                        columns = {
455
                                @ColumnResult(name = "created_timestamp", type = LocalDateTime.class),
456
                                @ColumnResult(name = "customer_name", type = String.class),
457
                                @ColumnResult(name = "code", type = String.class),
458
                                @ColumnResult(name = "warehouse_id", type = Integer.class),
459
                                @ColumnResult(name = "brand", type = String.class),
460
                                @ColumnResult(name = "modal", type = String.class),
461
                                @ColumnResult(name = "catalog_item_id", type = Integer.class),
462
                                @ColumnResult(name = "status", type = String.class),
463
                                @ColumnResult(name = "quantity", type = Long.class),
464
                                @ColumnResult(name = "today_po_value", type = Long.class),
465
                                @ColumnResult(name = "today_billed_value", type = Long.class)
466
                        }
467
                )
35474 amit 468
        ),
469
 
470
        @SqlResultSetMapping(name = "TodayPoByRegion",
471
                classes = @ConstructorResult(
472
                        targetClass = BrandRegionPOModel.class,
473
                        columns = {
474
                                @ColumnResult(name = "warehouse_id", type = Integer.class),
475
                                @ColumnResult(name = "brand", type = String.class),
476
                                @ColumnResult(name = "today_po_value", type = Long.class),
477
                                @ColumnResult(name = "today_billed_value", type = Long.class),
478
                                @ColumnResult(name = "total_billed_value", type = Long.class)
479
                        }
480
                )
35155 ranu 481
        )
35154 ranu 482
 
30161 manish 483
})
484
 
35155 ranu 485
 
27723 tejbeer 486
public class Order implements Serializable {
487
 
31860 tejbeer 488
    private static final long serialVersionUID = 1L;
489
    @Id
490
    @Column(name = "id", unique = true, updatable = false)
491
    @GeneratedValue(strategy = GenerationType.IDENTITY)
492
    private Integer id;
493
    @Column(name = "warehouse_id")
494
    private Integer warehouseId;
495
    @Column(name = "seller_id")
496
    private Integer sellerId;
497
    @Column(name = "warehouse_address_id")
498
    private Integer warehouseAddressId;
499
    @Column(name = "logistics_provider_id")
500
    private Integer logisticsProviderId;
501
    @Column(name = "airwaybill_no", length = 50)
502
    private String airwayBillNumber;
503
    @Column(name = "tracking_id", length = 50)
504
    private String trackingId;
505
    @Convert(converter = LocalDateTimeAttributeConverter.class)
506
    @Column(name = "expected_delivery_time")
507
    private LocalDateTime expectedDeliveryTime;
508
    @Convert(converter = LocalDateTimeAttributeConverter.class)
509
    @Column(name = "promised_delivery_time")
510
    private LocalDateTime promisedDeliveryTime;
511
    @Convert(converter = LocalDateTimeAttributeConverter.class)
512
    @Column(name = "expected_shipping_time")
513
    private LocalDateTime expectedShippingTime;
514
    @Convert(converter = LocalDateTimeAttributeConverter.class)
515
    @Column(name = "promised_shipping_time")
516
    private LocalDateTime promisedShippingTime;
517
    @Convert(converter = LocalDateTimeAttributeConverter.class)
518
    @Column(name = "partner_grn_timestamp")
519
    private LocalDateTime partnerGrnTimestamp;
520
    @Transient
521
    private List<String> returnedImeis;
522
    @Column(name = "customer_id")
523
    private Integer retailerId;
524
    @Column(name = "customer_name", length = 50)
525
    private String retailerName;
526
    @Column(name = "customer_mobilenumber", length = 20)
527
    private String retailerMobileNumber;
528
    @Column(name = "customer_pincode", length = 10)
529
    private String retailerPinCode;
530
    @Column(name = "customer_address1", length = 100)
531
    private String retailerAddress1;
532
    @Column(name = "customer_address2", length = 100)
533
    private String retailerAddress2;
534
    @Column(name = "customer_city", length = 100)
535
    private String retailerCity;
536
    @Column(name = "customer_state", length = 100)
537
    private String retailerState;
538
    @Column(name = "customer_email", length = 50)
539
    private String retailerEmailId;
540
    @Column(name = "status")
541
    @Enumerated(EnumType.ORDINAL)
542
    private OrderStatus status;
543
    @Column(name = "statusDescription", length = 50)
544
    private String statusDescription;
545
    @Column(name = "total_amount")
546
    private Float totalAmount;
547
    @Column(name = "gvAmount")
548
    private Float gvAmount;
549
    @Column(name = "total_weight")
550
    private Float totalWeight;
551
    @Column(name = "invoice_number", length = 30)
552
    private String invoiceNumber;
553
    @Column(name = "billed_by", length = 30)
554
    private String billedBy;
555
    @Convert(converter = LocalDateTimeAttributeConverter.class)
556
    @Column(name = "created_timestamp")
557
    private LocalDateTime createTimestamp;
558
    @Convert(converter = LocalDateTimeAttributeConverter.class)
559
    @Column(name = "accepted_timestamp")
560
    private LocalDateTime acceptedTimestamp;
561
    @Convert(converter = LocalDateTimeAttributeConverter.class)
562
    @Column(name = "billing_timestamp")
563
    private LocalDateTime billingTimestamp;
564
    @Convert(converter = LocalDateTimeAttributeConverter.class)
565
    @Column(name = "shipping_timestamp")
566
    private LocalDateTime shippingTimestamp;
567
    @Convert(converter = LocalDateTimeAttributeConverter.class)
568
    @Column(name = "pickup_timestamp")
569
    private LocalDateTime pickupTimestamp;
570
    @Convert(converter = LocalDateTimeAttributeConverter.class)
571
    @Column(name = "delivery_timestamp")
572
    private LocalDateTime deliveryTimestamp;
573
    @Convert(converter = LocalDateTimeAttributeConverter.class)
574
    @Column(name = "outofstock_timestamp")
575
    private LocalDateTime outOfStockTimestamp;
576
    @Column(name = "transaction_id")
577
    private Integer transactionId;
578
    @Column(name = "receiver", length = 50)
579
    private String receiver;
580
    @Column(name = "batchNo")
581
    private Integer batchNumber;
582
    @Column(name = "serialNo")
583
    private Integer serialNumber;
584
    @Column(name = "doaFlag", columnDefinition = "tinyInteger(1) default 0")
585
    private Boolean doaFlag;
586
    @Column(name = "pickupRequestNo")
587
    private Integer pickupRequestNumber;
27723 tejbeer 588
 
33052 amit.gupta 589
    @Column(name = "jacket_number", length = 10)
34754 ranu 590
    private Long jacketNumber;
33052 amit.gupta 591
 
592
    public Boolean getDoaFlag() {
593
        return doaFlag;
594
    }
595
 
34754 ranu 596
    public Long getJacketNumber() {
33052 amit.gupta 597
        return jacketNumber;
598
    }
599
 
34754 ranu 600
    public void setJacketNumber(Long jacketNumber) {
33052 amit.gupta 601
        this.jacketNumber = jacketNumber;
602
    }
603
 
604
    public Boolean getCod() {
605
        return cod;
606
    }
607
 
608
    public Boolean getVendorPaid() {
609
        return vendorPaid;
610
    }
611
 
612
    public Boolean getOtg() {
613
        return otg;
614
    }
615
 
616
    public Boolean getIrnGenerated() {
617
        return irnGenerated;
618
    }
619
 
620
    public void setIrnGenerated(Boolean irnGenerated) {
621
        this.irnGenerated = irnGenerated;
622
    }
623
 
31860 tejbeer 624
    @Column(name = "new_order_id")
625
    private Integer newOrderId;
626
    @Column(name = "doa_auth_timestamp")
627
    private LocalDateTime doaAuthTimestamp;
628
    @Convert(converter = LocalDateTimeAttributeConverter.class)
629
    @Column(name = "doa_pickup_timestamp")
630
    private LocalDateTime doaPickupTimestamp;
631
    @Convert(converter = LocalDateTimeAttributeConverter.class)
632
    @Column(name = "received_return_timestamp")
633
    private LocalDateTime receiverReturnTimestamp;
634
    @Convert(converter = LocalDateTimeAttributeConverter.class)
635
    @Column(name = "reship_timestamp")
636
    private LocalDateTime reShipTimestamp;
637
    @Convert(converter = LocalDateTimeAttributeConverter.class)
638
    @Column(name = "refund_timestamp")
639
    private LocalDateTime refundTimestamp;
640
    @Column(name = "purchase_order_id")
641
    private Integer purchaseOrderId;
642
    @Column(name = "cod", columnDefinition = "tinyInteger(1) default 0")
643
    private Boolean cod;
644
    @Convert(converter = LocalDateTimeAttributeConverter.class)
645
    @Column(name = "verification_timestamp")
646
    private LocalDateTime verificationTimestamp;
647
    @Column(name = "refunded_by", length = 30)
648
    private String refundBy;
649
    @Column(name = "refund_reason", length = 256)
650
    private String refundReason;
651
    @Convert(converter = LocalDateTimeAttributeConverter.class)
652
    @Column(name = "cod_reconciliation_timestamp")
653
    private LocalDateTime codReconciliationTimestamp;
654
    private Integer previousStatus;
655
    @Column(name = "vendorId")
656
    private Integer vendorId;
657
    @Column(name = "delayReasonText", length = 250)
658
    private String delayReasonText;
659
    @Column(name = "doa_logistics_provider_id")
660
    private Integer doaLogisticsProviderId;
27723 tejbeer 661
 
31860 tejbeer 662
    /*
663
     * @Column(name = "delay_reason") private DelayReason delayReason;
664
     */
665
    @Column(name = "vendor_paid", columnDefinition = "tinyInteger(1) default 0")
666
    private Boolean vendorPaid;
667
    @Convert(converter = LocalDateTimeAttributeConverter.class)
668
    @Column(name = "local_connected_timestamp")
669
    private LocalDateTime localConnectedTimestamp;
670
    @Convert(converter = LocalDateTimeAttributeConverter.class)
671
    @Column(name = "reached_destination_timestamp")
672
    private LocalDateTime reachedDestinationTimestamp;
673
    @Convert(converter = LocalDateTimeAttributeConverter.class)
674
    @Column(name = "first_dlvyatmp_timestamp")
675
    private LocalDateTime firstDlvyatmpTimestamp;
676
    @Column(name = "originalOrderId")
677
    private Integer originalOrderId;
678
    @Column(name = "fulfilmentWarehouseId")
679
    private Integer fulfilmentWarehouseId;
680
    @Column(name = "orderType")
681
    private Integer orderType;
682
    @Column(name = "pickupStoreId")
683
    private Integer pickupStoreId;
684
    @Column(name = "otg", columnDefinition = "tinyInteger(1) default 0")
685
    private Boolean otg;
686
    @Convert(converter = LocalDateTimeAttributeConverter.class)
687
    @Column(name = "courier_delivery_time")
688
    private LocalDateTime courierDeliveryTimestamp;
689
    @Column(name = "insurer")
690
    private Integer insurer;
691
    @Column(name = "insuranceAmount")
692
    private Float insuranceAmount;
693
    @Column(name = "freebieItemId")
694
    private Integer freebieItemId;
695
    @Column(name = "source")
696
    private Integer source;
697
    @Column(name = "advanceAmount")
698
    private Float advanceAmount;
699
    @Column(name = "storeId")
700
    private Integer storeId;
701
    @Column(name = "productCondition")
702
    private Integer productCondition;
703
    @Column(name = "dataProtectionInsurer")
704
    private Integer dataProtectionInsurer;
705
    @Column(name = "dataProtectionAmount")
706
    private Integer dataProtectionAmount;
707
    @Column(name = "taxType")
708
    @Enumerated(EnumType.ORDINAL)
709
    private TaxType taxType;
710
    @Column(name = "logisticsTransactionId", length = 100)
711
    private String logisticsTransactionId;
712
    @Column(name = "shippingCost")
713
    private Float shippingCost;
714
    @Column(name = "codCharges")
715
    private Float codCharges;
716
    @Column(name = "wallet_amount")
717
    private Float walletAmount;
718
    @Column(name = "net_payable_amount")
719
    private Float netPayableAmount;
720
    @Column(name = "shippingRefund")
721
    private Float shippingRefund;
722
    @Column(name = "irn_generated")
723
    private Boolean irnGenerated;
724
    @Column(name = "shipment_hold")
725
    private Boolean shipmentHold;
726
    @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
727
    @JoinColumn(name = "id", insertable = false, updatable = false, nullable = false, referencedColumnName = "order_id")
728
    private LineItem lineItem;
27723 tejbeer 729
 
31860 tejbeer 730
    public Order() {
731
    }
31539 amit.gupta 732
 
31860 tejbeer 733
    public LocalDateTime getPartnerGrnTimestamp() {
734
        return partnerGrnTimestamp;
735
    }
31539 amit.gupta 736
 
31860 tejbeer 737
    public void setPartnerGrnTimestamp(LocalDateTime partnerGrnTimestamp) {
738
        this.partnerGrnTimestamp = partnerGrnTimestamp;
739
    }
31539 amit.gupta 740
 
31860 tejbeer 741
    public List<String> getReturnedImeis() {
742
        return returnedImeis;
743
    }
31539 amit.gupta 744
 
31860 tejbeer 745
    public void setReturnedImeis(List<String> returnedImeis) {
746
        this.returnedImeis = returnedImeis;
747
    }
31539 amit.gupta 748
 
31860 tejbeer 749
    public Integer getId() {
750
        return id;
751
    }
27723 tejbeer 752
 
31860 tejbeer 753
    public void setId(Integer id) {
754
        this.id = id;
755
    }
27723 tejbeer 756
 
31860 tejbeer 757
    public Integer getWarehouseId() {
758
        return warehouseId;
759
    }
27723 tejbeer 760
 
31860 tejbeer 761
    public void setWarehouseId(Integer warehouseId) {
762
        this.warehouseId = warehouseId;
763
    }
27723 tejbeer 764
 
31860 tejbeer 765
    public Integer getSellerId() {
766
        return sellerId;
767
    }
27723 tejbeer 768
 
31860 tejbeer 769
    public void setSellerId(Integer sellerId) {
770
        this.sellerId = sellerId;
771
    }
27723 tejbeer 772
 
31860 tejbeer 773
    public Integer getWarehouseAddressId() {
774
        return warehouseAddressId;
775
    }
27723 tejbeer 776
 
31860 tejbeer 777
    public void setWarehouseAddressId(Integer warehouseAddressId) {
778
        this.warehouseAddressId = warehouseAddressId;
779
    }
27723 tejbeer 780
 
31860 tejbeer 781
    public Integer getLogisticsProviderId() {
782
        return logisticsProviderId;
783
    }
27723 tejbeer 784
 
31860 tejbeer 785
    public void setLogisticsProviderId(Integer logisticsProviderId) {
786
        this.logisticsProviderId = logisticsProviderId;
787
    }
27723 tejbeer 788
 
31860 tejbeer 789
    public String getAirwayBillNumber() {
790
        return airwayBillNumber;
791
    }
27723 tejbeer 792
 
31860 tejbeer 793
    public void setAirwayBillNumber(String airwayBillNumber) {
794
        this.airwayBillNumber = airwayBillNumber;
795
    }
27723 tejbeer 796
 
31860 tejbeer 797
    public String getTrackingId() {
798
        return trackingId;
799
    }
27723 tejbeer 800
 
31860 tejbeer 801
    public void setTrackingId(String trackingId) {
802
        this.trackingId = trackingId;
803
    }
27723 tejbeer 804
 
31860 tejbeer 805
    public LocalDateTime getExpectedDeliveryTime() {
806
        return expectedDeliveryTime;
807
    }
27723 tejbeer 808
 
31860 tejbeer 809
    public void setExpectedDeliveryTime(LocalDateTime expectedDeliveryTime) {
810
        this.expectedDeliveryTime = expectedDeliveryTime;
811
    }
27723 tejbeer 812
 
31860 tejbeer 813
    public LocalDateTime getPromisedDeliveryTime() {
814
        return promisedDeliveryTime;
815
    }
27723 tejbeer 816
 
31860 tejbeer 817
    public void setPromisedDeliveryTime(LocalDateTime promisedDeliveryTime) {
818
        this.promisedDeliveryTime = promisedDeliveryTime;
819
    }
27723 tejbeer 820
 
31860 tejbeer 821
    public LocalDateTime getExpectedShippingTime() {
822
        return expectedShippingTime;
823
    }
27723 tejbeer 824
 
31860 tejbeer 825
    public void setExpectedShippingTime(LocalDateTime expectedShippingTime) {
826
        this.expectedShippingTime = expectedShippingTime;
827
    }
27723 tejbeer 828
 
31860 tejbeer 829
    public LocalDateTime getPromisedShippingTime() {
830
        return promisedShippingTime;
831
    }
27723 tejbeer 832
 
31860 tejbeer 833
    public void setPromisedShippingTime(LocalDateTime promisedShippingTime) {
834
        this.promisedShippingTime = promisedShippingTime;
835
    }
27723 tejbeer 836
 
31860 tejbeer 837
    public Integer getRetailerId() {
838
        return retailerId;
839
    }
27723 tejbeer 840
 
31860 tejbeer 841
    public void setRetailerId(Integer retailerId) {
842
        this.retailerId = retailerId;
843
    }
27723 tejbeer 844
 
31860 tejbeer 845
    public String getRetailerName() {
846
        return retailerName;
847
    }
27723 tejbeer 848
 
31860 tejbeer 849
    public void setRetailerName(String retailerName) {
850
        this.retailerName = retailerName;
851
    }
27723 tejbeer 852
 
31860 tejbeer 853
    public String getRetailerMobileNumber() {
854
        return retailerMobileNumber;
855
    }
27723 tejbeer 856
 
31860 tejbeer 857
    public void setRetailerMobileNumber(String retailerMobileNumber) {
858
        this.retailerMobileNumber = retailerMobileNumber;
859
    }
27723 tejbeer 860
 
31860 tejbeer 861
    public String getRetailerPinCode() {
862
        return retailerPinCode;
863
    }
27723 tejbeer 864
 
31860 tejbeer 865
    public void setRetailerPinCode(String retailerPinCode) {
866
        this.retailerPinCode = retailerPinCode;
867
    }
27723 tejbeer 868
 
31860 tejbeer 869
    public String getRetailerAddress1() {
870
        return retailerAddress1;
871
    }
27723 tejbeer 872
 
31860 tejbeer 873
    public void setRetailerAddress1(String retailerAddress1) {
874
        this.retailerAddress1 = retailerAddress1;
875
    }
27723 tejbeer 876
 
31860 tejbeer 877
    public String getRetailerAddress2() {
878
        return retailerAddress2;
879
    }
27723 tejbeer 880
 
31860 tejbeer 881
    public void setRetailerAddress2(String retailerAddress2) {
882
        this.retailerAddress2 = retailerAddress2;
883
    }
27723 tejbeer 884
 
31860 tejbeer 885
    public String getRetailerCity() {
886
        return retailerCity;
887
    }
27723 tejbeer 888
 
31860 tejbeer 889
    public void setRetailerCity(String retailerCity) {
890
        this.retailerCity = retailerCity;
891
    }
27723 tejbeer 892
 
31860 tejbeer 893
    public String getRetailerState() {
894
        return retailerState;
895
    }
27723 tejbeer 896
 
31860 tejbeer 897
    public void setRetailerState(String retailerState) {
898
        this.retailerState = retailerState;
899
    }
27723 tejbeer 900
 
31860 tejbeer 901
    public String getRetailerEmailId() {
902
        return retailerEmailId;
903
    }
27723 tejbeer 904
 
31860 tejbeer 905
    public void setRetailerEmailId(String retailerEmailId) {
906
        this.retailerEmailId = retailerEmailId;
907
    }
27723 tejbeer 908
 
31860 tejbeer 909
    public OrderStatus getStatus() {
910
        return status;
911
    }
27723 tejbeer 912
 
31860 tejbeer 913
    public void setStatus(OrderStatus status) {
914
        this.status = status;
915
    }
27723 tejbeer 916
 
31860 tejbeer 917
    public String getStatusDescription() {
918
        return statusDescription;
919
    }
27723 tejbeer 920
 
31860 tejbeer 921
    public void setStatusDescription(String statusDescription) {
922
        this.statusDescription = statusDescription;
923
    }
27723 tejbeer 924
 
31860 tejbeer 925
    public Float getTotalAmount() {
926
        return totalAmount;
927
    }
27723 tejbeer 928
 
31860 tejbeer 929
    public void setTotalAmount(Float totalAmount) {
930
        this.totalAmount = totalAmount;
931
    }
27723 tejbeer 932
 
31860 tejbeer 933
    public Float getGvAmount() {
934
        return gvAmount;
935
    }
27723 tejbeer 936
 
31860 tejbeer 937
    public void setGvAmount(Float gvAmount) {
938
        this.gvAmount = gvAmount;
939
    }
27723 tejbeer 940
 
31860 tejbeer 941
    public Float getTotalWeight() {
942
        return totalWeight;
943
    }
27723 tejbeer 944
 
31860 tejbeer 945
    public void setTotalWeight(Float totalWeight) {
946
        this.totalWeight = totalWeight;
947
    }
27723 tejbeer 948
 
31860 tejbeer 949
    public String getInvoiceNumber() {
950
        return invoiceNumber;
951
    }
27723 tejbeer 952
 
31860 tejbeer 953
    public void setInvoiceNumber(String invoiceNumber) {
954
        this.invoiceNumber = invoiceNumber;
955
    }
27723 tejbeer 956
 
31860 tejbeer 957
    public String getBilledBy() {
958
        return billedBy;
959
    }
27723 tejbeer 960
 
31860 tejbeer 961
    public void setBilledBy(String billedBy) {
962
        this.billedBy = billedBy;
963
    }
27723 tejbeer 964
 
31860 tejbeer 965
    public LocalDateTime getCreateTimestamp() {
966
        return createTimestamp;
967
    }
27723 tejbeer 968
 
31860 tejbeer 969
    public void setCreateTimestamp(LocalDateTime createTimestamp) {
970
        this.createTimestamp = createTimestamp;
971
    }
27723 tejbeer 972
 
31860 tejbeer 973
    public LocalDateTime getAcceptedTimestamp() {
974
        return acceptedTimestamp;
975
    }
27723 tejbeer 976
 
31860 tejbeer 977
    public void setAcceptedTimestamp(LocalDateTime acceptedTimestamp) {
978
        this.acceptedTimestamp = acceptedTimestamp;
979
    }
27723 tejbeer 980
 
31860 tejbeer 981
    public LocalDateTime getBillingTimestamp() {
982
        return billingTimestamp;
983
    }
27723 tejbeer 984
 
31860 tejbeer 985
    public void setBillingTimestamp(LocalDateTime billingTimestamp) {
986
        this.billingTimestamp = billingTimestamp;
987
    }
27723 tejbeer 988
 
31860 tejbeer 989
    public LocalDateTime getShippingTimestamp() {
990
        return shippingTimestamp;
991
    }
27723 tejbeer 992
 
31860 tejbeer 993
    public void setShippingTimestamp(LocalDateTime shippingTimestamp) {
994
        this.shippingTimestamp = shippingTimestamp;
995
    }
27723 tejbeer 996
 
31860 tejbeer 997
    public LocalDateTime getPickupTimestamp() {
998
        return pickupTimestamp;
999
    }
27723 tejbeer 1000
 
31860 tejbeer 1001
    public void setPickupTimestamp(LocalDateTime pickupTimestamp) {
1002
        this.pickupTimestamp = pickupTimestamp;
1003
    }
27723 tejbeer 1004
 
31860 tejbeer 1005
    public LocalDateTime getDeliveryTimestamp() {
1006
        return deliveryTimestamp;
1007
    }
27723 tejbeer 1008
 
31860 tejbeer 1009
    public void setDeliveryTimestamp(LocalDateTime deliveryTimestamp) {
1010
        this.deliveryTimestamp = deliveryTimestamp;
1011
    }
27723 tejbeer 1012
 
31860 tejbeer 1013
    public LocalDateTime getOutOfStockTimestamp() {
1014
        return outOfStockTimestamp;
1015
    }
27723 tejbeer 1016
 
31860 tejbeer 1017
    public void setOutOfStockTimestamp(LocalDateTime outOfStockTimestamp) {
1018
        this.outOfStockTimestamp = outOfStockTimestamp;
1019
    }
27723 tejbeer 1020
 
31860 tejbeer 1021
    public Integer getTransactionId() {
1022
        return transactionId;
1023
    }
27723 tejbeer 1024
 
31860 tejbeer 1025
    public void setTransactionId(Integer transactionId) {
1026
        this.transactionId = transactionId;
1027
    }
27723 tejbeer 1028
 
31860 tejbeer 1029
    /*
1030
     * public Integer getJacketNumber() { return jacketNumber; } public void
1031
     * setJacketNumber(Integer jacketNumber) { this.jacketNumber = jacketNumber; }
1032
     */
1033
    public String getReceiver() {
1034
        return receiver;
1035
    }
27723 tejbeer 1036
 
31860 tejbeer 1037
    public void setReceiver(String receiver) {
1038
        this.receiver = receiver;
1039
    }
27723 tejbeer 1040
 
31860 tejbeer 1041
    public Integer getBatchNumber() {
1042
        return batchNumber;
1043
    }
27723 tejbeer 1044
 
31860 tejbeer 1045
    public void setBatchNumber(Integer batchNumber) {
1046
        this.batchNumber = batchNumber;
1047
    }
27723 tejbeer 1048
 
31860 tejbeer 1049
    public Integer getSerialNumber() {
1050
        return serialNumber;
1051
    }
27723 tejbeer 1052
 
31860 tejbeer 1053
    public void setSerialNumber(Integer serialNumber) {
1054
        this.serialNumber = serialNumber;
1055
    }
27723 tejbeer 1056
 
31860 tejbeer 1057
    public Boolean getShipmentHold() {
1058
        return shipmentHold;
1059
    }
31020 tejbeer 1060
 
31860 tejbeer 1061
    public void setShipmentHold(Boolean shipmentHold) {
1062
        this.shipmentHold = shipmentHold;
1063
    }
31020 tejbeer 1064
 
31860 tejbeer 1065
    public Boolean isDoaFlag() {
1066
        return doaFlag;
1067
    }
27723 tejbeer 1068
 
31860 tejbeer 1069
    public void setDoaFlag(Boolean doaFlag) {
1070
        this.doaFlag = doaFlag;
1071
    }
27723 tejbeer 1072
 
31860 tejbeer 1073
    public Integer getPickupRequestNumber() {
1074
        return pickupRequestNumber;
1075
    }
27723 tejbeer 1076
 
31860 tejbeer 1077
    public void setPickupRequestNumber(Integer pickupRequestNumber) {
1078
        this.pickupRequestNumber = pickupRequestNumber;
1079
    }
27723 tejbeer 1080
 
31860 tejbeer 1081
    public Integer getNewOrderId() {
1082
        return newOrderId;
1083
    }
27723 tejbeer 1084
 
31860 tejbeer 1085
    public void setNewOrderId(Integer newOrderId) {
1086
        this.newOrderId = newOrderId;
1087
    }
27723 tejbeer 1088
 
31860 tejbeer 1089
    public LocalDateTime getDoaAuthTimestamp() {
1090
        return doaAuthTimestamp;
1091
    }
27723 tejbeer 1092
 
31860 tejbeer 1093
    public void setDoaAuthTimestamp(LocalDateTime doaAuthTimestamp) {
1094
        this.doaAuthTimestamp = doaAuthTimestamp;
1095
    }
27723 tejbeer 1096
 
31860 tejbeer 1097
    public LocalDateTime getDoaPickupTimestamp() {
1098
        return doaPickupTimestamp;
1099
    }
27723 tejbeer 1100
 
31860 tejbeer 1101
    public void setDoaPickupTimestamp(LocalDateTime doaPickupTimestamp) {
1102
        this.doaPickupTimestamp = doaPickupTimestamp;
1103
    }
27723 tejbeer 1104
 
31860 tejbeer 1105
    public LocalDateTime getReceiverReturnTimestamp() {
1106
        return receiverReturnTimestamp;
1107
    }
27723 tejbeer 1108
 
31860 tejbeer 1109
    public void setReceiverReturnTimestamp(LocalDateTime receiverReturnTimestamp) {
1110
        this.receiverReturnTimestamp = receiverReturnTimestamp;
1111
    }
27723 tejbeer 1112
 
31860 tejbeer 1113
    public LocalDateTime getReShipTimestamp() {
1114
        return reShipTimestamp;
1115
    }
27723 tejbeer 1116
 
31860 tejbeer 1117
    public void setReShipTimestamp(LocalDateTime reShipTimestamp) {
1118
        this.reShipTimestamp = reShipTimestamp;
1119
    }
27723 tejbeer 1120
 
31860 tejbeer 1121
    public LocalDateTime getRefundTimestamp() {
1122
        return refundTimestamp;
1123
    }
27723 tejbeer 1124
 
31860 tejbeer 1125
    public void setRefundTimestamp(LocalDateTime refundTimestamp) {
1126
        this.refundTimestamp = refundTimestamp;
1127
    }
27723 tejbeer 1128
 
31860 tejbeer 1129
    public Integer getPurchaseOrderId() {
1130
        return purchaseOrderId;
1131
    }
27723 tejbeer 1132
 
31860 tejbeer 1133
    public void setPurchaseOrderId(Integer purchaseOrderId) {
1134
        this.purchaseOrderId = purchaseOrderId;
1135
    }
27723 tejbeer 1136
 
31860 tejbeer 1137
    public Boolean isCod() {
1138
        return cod;
1139
    }
27723 tejbeer 1140
 
31860 tejbeer 1141
    public void setCod(Boolean cod) {
1142
        this.cod = cod;
1143
    }
27723 tejbeer 1144
 
31860 tejbeer 1145
    public LocalDateTime getVerificationTimestamp() {
1146
        return verificationTimestamp;
1147
    }
27723 tejbeer 1148
 
31860 tejbeer 1149
    public void setVerificationTimestamp(LocalDateTime verificationTimestamp) {
1150
        this.verificationTimestamp = verificationTimestamp;
1151
    }
27723 tejbeer 1152
 
31860 tejbeer 1153
    public String getRefundBy() {
1154
        return refundBy;
1155
    }
27723 tejbeer 1156
 
31860 tejbeer 1157
    public void setRefundBy(String refundBy) {
1158
        this.refundBy = refundBy;
1159
    }
27723 tejbeer 1160
 
31860 tejbeer 1161
    public String getRefundReason() {
1162
        return refundReason;
1163
    }
27723 tejbeer 1164
 
31860 tejbeer 1165
    public void setRefundReason(String refundReason) {
1166
        this.refundReason = refundReason;
1167
    }
27723 tejbeer 1168
 
31860 tejbeer 1169
    /*
1170
     * public DelayReason getDelayReason() { return delayReason; } public void
1171
     * setDelayReason(DelayReason delayReason) { this.delayReason = delayReason; }
1172
     */
1173
    public LocalDateTime getCodReconciliationTimestamp() {
1174
        return codReconciliationTimestamp;
1175
    }
27723 tejbeer 1176
 
31860 tejbeer 1177
    public void setCodReconciliationTimestamp(LocalDateTime codReconciliationTimestamp) {
1178
        this.codReconciliationTimestamp = codReconciliationTimestamp;
1179
    }
27723 tejbeer 1180
 
31860 tejbeer 1181
    public Integer getPreviousStatus() {
1182
        return previousStatus;
1183
    }
27723 tejbeer 1184
 
31860 tejbeer 1185
    public void setPreviousStatus(Integer previousStatus) {
1186
        this.previousStatus = previousStatus;
1187
    }
27723 tejbeer 1188
 
31860 tejbeer 1189
    public Integer getVendorId() {
1190
        return vendorId;
1191
    }
27723 tejbeer 1192
 
31860 tejbeer 1193
    public void setVendorId(Integer vendorId) {
1194
        this.vendorId = vendorId;
1195
    }
27723 tejbeer 1196
 
31860 tejbeer 1197
    public String getDelayReasonText() {
1198
        return delayReasonText;
1199
    }
27723 tejbeer 1200
 
31860 tejbeer 1201
    public void setDelayReasonText(String delayReasonText) {
1202
        this.delayReasonText = delayReasonText;
1203
    }
27723 tejbeer 1204
 
31860 tejbeer 1205
    public Integer getDoaLogisticsProviderId() {
1206
        return doaLogisticsProviderId;
1207
    }
27723 tejbeer 1208
 
31860 tejbeer 1209
    public void setDoaLogisticsProviderId(Integer doaLogisticsProviderId) {
1210
        this.doaLogisticsProviderId = doaLogisticsProviderId;
1211
    }
27723 tejbeer 1212
 
31860 tejbeer 1213
    public Boolean isVendorPaid() {
1214
        return vendorPaid;
1215
    }
27723 tejbeer 1216
 
31860 tejbeer 1217
    public void setVendorPaid(Boolean vendorPaid) {
1218
        this.vendorPaid = vendorPaid;
1219
    }
27723 tejbeer 1220
 
31860 tejbeer 1221
    public LocalDateTime getLocalConnectedTimestamp() {
1222
        return localConnectedTimestamp;
1223
    }
27723 tejbeer 1224
 
31860 tejbeer 1225
    public void setLocalConnectedTimestamp(LocalDateTime localConnectedTimestamp) {
1226
        this.localConnectedTimestamp = localConnectedTimestamp;
1227
    }
27723 tejbeer 1228
 
31860 tejbeer 1229
    public LocalDateTime getReachedDestinationTimestamp() {
1230
        return reachedDestinationTimestamp;
1231
    }
27723 tejbeer 1232
 
31860 tejbeer 1233
    public void setReachedDestinationTimestamp(LocalDateTime reachedDestinationTimestamp) {
1234
        this.reachedDestinationTimestamp = reachedDestinationTimestamp;
1235
    }
27723 tejbeer 1236
 
31860 tejbeer 1237
    public LocalDateTime getFirstDlvyatmpTimestamp() {
1238
        return firstDlvyatmpTimestamp;
1239
    }
27723 tejbeer 1240
 
31860 tejbeer 1241
    public void setFirstDlvyatmpTimestamp(LocalDateTime firstDlvyatmpTimestamp) {
1242
        this.firstDlvyatmpTimestamp = firstDlvyatmpTimestamp;
1243
    }
27723 tejbeer 1244
 
31860 tejbeer 1245
    public Integer getOriginalOrderId() {
1246
        return originalOrderId;
1247
    }
27723 tejbeer 1248
 
31860 tejbeer 1249
    public void setOriginalOrderId(Integer originalOrderId) {
1250
        this.originalOrderId = originalOrderId;
1251
    }
27723 tejbeer 1252
 
31860 tejbeer 1253
    public Integer getFulfilmentWarehouseId() {
1254
        return fulfilmentWarehouseId;
1255
    }
27723 tejbeer 1256
 
31860 tejbeer 1257
    public void setFulfilmentWarehouseId(Integer fulfilmentWarehouseId) {
1258
        this.fulfilmentWarehouseId = fulfilmentWarehouseId;
1259
    }
27723 tejbeer 1260
 
31860 tejbeer 1261
    public Integer getOrderType() {
1262
        return orderType;
1263
    }
27723 tejbeer 1264
 
31860 tejbeer 1265
    public void setOrderType(Integer orderType) {
1266
        this.orderType = orderType;
1267
    }
27723 tejbeer 1268
 
31860 tejbeer 1269
    public Integer getPickupStoreId() {
1270
        return pickupStoreId;
1271
    }
27723 tejbeer 1272
 
31860 tejbeer 1273
    public void setPickupStoreId(Integer pickupStoreId) {
1274
        this.pickupStoreId = pickupStoreId;
1275
    }
27723 tejbeer 1276
 
31860 tejbeer 1277
    public Boolean isOtg() {
1278
        return otg;
1279
    }
27723 tejbeer 1280
 
31860 tejbeer 1281
    public void setOtg(Boolean otg) {
1282
        this.otg = otg;
1283
    }
27723 tejbeer 1284
 
31860 tejbeer 1285
    public LocalDateTime getCourierDeliveryTimestamp() {
1286
        return courierDeliveryTimestamp;
1287
    }
27723 tejbeer 1288
 
31860 tejbeer 1289
    public void setCourierDeliveryTimestamp(LocalDateTime courierDeliveryTimestamp) {
1290
        this.courierDeliveryTimestamp = courierDeliveryTimestamp;
1291
    }
27723 tejbeer 1292
 
31860 tejbeer 1293
    public Integer getInsurer() {
1294
        return insurer;
1295
    }
27723 tejbeer 1296
 
31860 tejbeer 1297
    public void setInsurer(Integer insurer) {
1298
        this.insurer = insurer;
1299
    }
27723 tejbeer 1300
 
31860 tejbeer 1301
    public Float getInsuranceAmount() {
1302
        return insuranceAmount;
1303
    }
27723 tejbeer 1304
 
31860 tejbeer 1305
    public void setInsuranceAmount(Float insuranceAmount) {
1306
        this.insuranceAmount = insuranceAmount;
1307
    }
27723 tejbeer 1308
 
31860 tejbeer 1309
    public Integer getFreebieItemId() {
1310
        return freebieItemId;
1311
    }
27723 tejbeer 1312
 
31860 tejbeer 1313
    public void setFreebieItemId(Integer freebieItemId) {
1314
        this.freebieItemId = freebieItemId;
1315
    }
27723 tejbeer 1316
 
31860 tejbeer 1317
    public Integer getSource() {
1318
        return source;
1319
    }
27723 tejbeer 1320
 
31860 tejbeer 1321
    public void setSource(Integer source) {
1322
        this.source = source;
1323
    }
27723 tejbeer 1324
 
31860 tejbeer 1325
    public Float getAdvanceAmount() {
1326
        return advanceAmount;
1327
    }
27723 tejbeer 1328
 
31860 tejbeer 1329
    public void setAdvanceAmount(Float advanceAmount) {
1330
        this.advanceAmount = advanceAmount;
1331
    }
27723 tejbeer 1332
 
31860 tejbeer 1333
    public Integer getStoreId() {
1334
        return storeId;
1335
    }
27723 tejbeer 1336
 
31860 tejbeer 1337
    public void setStoreId(Integer storeId) {
1338
        this.storeId = storeId;
1339
    }
27723 tejbeer 1340
 
31860 tejbeer 1341
    public Integer getProductCondition() {
1342
        return productCondition;
1343
    }
27723 tejbeer 1344
 
31860 tejbeer 1345
    public void setProductCondition(Integer productCondition) {
1346
        this.productCondition = productCondition;
1347
    }
27723 tejbeer 1348
 
31860 tejbeer 1349
    public Integer getDataProtectionInsurer() {
1350
        return dataProtectionInsurer;
1351
    }
27723 tejbeer 1352
 
31860 tejbeer 1353
    public void setDataProtectionInsurer(Integer dataProtectionInsurer) {
1354
        this.dataProtectionInsurer = dataProtectionInsurer;
1355
    }
27723 tejbeer 1356
 
31860 tejbeer 1357
    public Integer getDataProtectionAmount() {
1358
        return dataProtectionAmount;
1359
    }
27723 tejbeer 1360
 
31860 tejbeer 1361
    public void setDataProtectionAmount(Integer dataProtectionAmount) {
1362
        this.dataProtectionAmount = dataProtectionAmount;
1363
    }
27723 tejbeer 1364
 
31860 tejbeer 1365
    public TaxType getTaxType() {
1366
        return taxType;
1367
    }
27723 tejbeer 1368
 
31860 tejbeer 1369
    public void setTaxType(TaxType taxType) {
1370
        this.taxType = taxType;
1371
    }
27723 tejbeer 1372
 
31860 tejbeer 1373
    public String getLogisticsTransactionId() {
1374
        return logisticsTransactionId;
1375
    }
27723 tejbeer 1376
 
31860 tejbeer 1377
    public void setLogisticsTransactionId(String logisticsTransactionId) {
1378
        this.logisticsTransactionId = logisticsTransactionId;
1379
    }
27723 tejbeer 1380
 
31860 tejbeer 1381
    public Float getShippingCost() {
1382
        return shippingCost;
1383
    }
27723 tejbeer 1384
 
31860 tejbeer 1385
    public void setShippingCost(Float shippingCost) {
1386
        this.shippingCost = shippingCost;
1387
    }
27723 tejbeer 1388
 
31860 tejbeer 1389
    public Float getCodCharges() {
1390
        return codCharges;
1391
    }
27723 tejbeer 1392
 
31860 tejbeer 1393
    public void setCodCharges(Float codCharges) {
1394
        this.codCharges = codCharges;
1395
    }
27723 tejbeer 1396
 
31860 tejbeer 1397
    public Float getWalletAmount() {
1398
        return walletAmount;
1399
    }
27723 tejbeer 1400
 
31860 tejbeer 1401
    public void setWalletAmount(Float walletAmount) {
1402
        this.walletAmount = walletAmount;
1403
    }
27723 tejbeer 1404
 
31860 tejbeer 1405
    public Float getNetPayableAmount() {
1406
        return netPayableAmount;
1407
    }
27723 tejbeer 1408
 
31860 tejbeer 1409
    public void setNetPayableAmount(Float netPayableAmount) {
1410
        this.netPayableAmount = netPayableAmount;
1411
    }
27723 tejbeer 1412
 
31860 tejbeer 1413
    public Float getShippingRefund() {
1414
        return shippingRefund;
1415
    }
27723 tejbeer 1416
 
31860 tejbeer 1417
    public void setShippingRefund(Float shippingRefund) {
1418
        this.shippingRefund = shippingRefund;
1419
    }
27723 tejbeer 1420
 
31860 tejbeer 1421
    public LineItem getLineItem() {
1422
        return lineItem;
1423
    }
27723 tejbeer 1424
 
31860 tejbeer 1425
    public void setLineItem(LineItem lineItem) {
1426
        this.lineItem = lineItem;
1427
    }
27723 tejbeer 1428
 
31860 tejbeer 1429
    public String getFormattedDate() {
1430
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
1431
        return this.createTimestamp.format(formatter);
1432
    }
27723 tejbeer 1433
 
31860 tejbeer 1434
    @Override
1435
    public int hashCode() {
1436
        final int prime = 31;
1437
        int result = 1;
1438
        result = prime * result + ((id == null) ? 0 : id.hashCode());
1439
        return result;
1440
    }
27723 tejbeer 1441
 
31860 tejbeer 1442
    @Override
1443
    public boolean equals(Object obj) {
1444
        if (this == obj)
1445
            return true;
1446
        if (obj == null)
1447
            return false;
1448
        if (getClass() != obj.getClass())
1449
            return false;
1450
        Order other = (Order) obj;
1451
        if (id == null) {
1452
            if (other.id != null)
1453
                return false;
1454
        } else if (!id.equals(other.id))
1455
            return false;
1456
        return true;
1457
    }
27723 tejbeer 1458
 
31860 tejbeer 1459
    public Boolean isIrnGenerated() {
1460
        return irnGenerated;
1461
    }
30289 amit.gupta 1462
 
31860 tejbeer 1463
    public void setIrnGenerated(boolean irnGenerated) {
1464
        this.irnGenerated = irnGenerated;
1465
    }
30289 amit.gupta 1466
 
31860 tejbeer 1467
    @Override
1468
    public String toString() {
1469
        return "Order [id=" + id + "]";
1470
    }
27723 tejbeer 1471
 
21545 ashik.ali 1472
}