Subversion Repositories SmartDukaan

Rev

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