Subversion Repositories SmartDukaan

Rev

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

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