Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
2674 vikas 1
package in.shop2020.serving.controllers;
2
 
7065 kshitij.so 3
import in.shop2020.config.ConfigException;
4689 anupam.sin 4
import in.shop2020.crm.Activity;
5
import in.shop2020.crm.ActivityType;
3578 mandeep.dh 6
import in.shop2020.crm.SearchFilter;
7
import in.shop2020.crm.Ticket;
8
import in.shop2020.crm.TicketCategory;
4689 anupam.sin 9
import in.shop2020.crm.TicketPriority;
3578 mandeep.dh 10
import in.shop2020.crm.TicketStatus;
7826 manish.sha 11
import in.shop2020.logistics.LogisticsServiceException;
5845 mandeep.dh 12
import in.shop2020.logistics.PickupStore;
7826 manish.sha 13
import in.shop2020.logistics.Provider;
7190 amar.kumar 14
import in.shop2020.model.v1.catalog.CatalogService;
15
import in.shop2020.model.v1.catalog.CatalogServiceException;
16
import in.shop2020.model.v1.catalog.Item;
7826 manish.sha 17
import in.shop2020.model.v1.order.AmazonOrder;
7399 anupam.sin 18
import in.shop2020.model.v1.order.HotspotStore;
2674 vikas 19
import in.shop2020.model.v1.order.LineItem;
20
import in.shop2020.model.v1.order.Order;
8606 amar.kumar 21
import in.shop2020.model.v1.order.OrderSource;
3578 mandeep.dh 22
import in.shop2020.model.v1.order.OrderStatus;
7393 anupam.sin 23
import in.shop2020.model.v1.order.StoreOrderDetail;
4689 anupam.sin 24
import in.shop2020.model.v1.order.TransactionServiceException;
4142 mandeep.dh 25
import in.shop2020.model.v1.user.Address;
4689 anupam.sin 26
import in.shop2020.model.v1.user.UserContextException;
2728 vikas 27
import in.shop2020.payments.Attribute;
28
import in.shop2020.payments.Constants;
2674 vikas 29
import in.shop2020.payments.Payment;
2728 vikas 30
import in.shop2020.payments.PaymentException;
4142 mandeep.dh 31
import in.shop2020.payments.PaymentService.Client;
4689 anupam.sin 32
import in.shop2020.serving.auth.CRMAuthorizingRealm;
3090 mandeep.dh 33
import in.shop2020.serving.model.ShipmentUpdate;
5845 mandeep.dh 34
import in.shop2020.serving.services.AramexTrackingService;
3090 mandeep.dh 35
import in.shop2020.serving.services.BlueDartTrackingService;
5303 phani.kuma 36
import in.shop2020.serving.services.DelhiveryTrackingService;
7942 manish.sha 37
import in.shop2020.serving.services.FedExTrackingService;
7200 kshitij.so 38
import in.shop2020.serving.services.RedExpressTrackingService;
3578 mandeep.dh 39
import in.shop2020.thrift.clients.CRMClient;
7190 amar.kumar 40
import in.shop2020.thrift.clients.CatalogClient;
6322 amar.kumar 41
import in.shop2020.thrift.clients.HelperClient;
5845 mandeep.dh 42
import in.shop2020.thrift.clients.LogisticsClient;
3128 rajveer 43
import in.shop2020.thrift.clients.PaymentClient;
44
import in.shop2020.thrift.clients.TransactionClient;
4142 mandeep.dh 45
import in.shop2020.thrift.clients.UserClient;
7065 kshitij.so 46
import in.shop2020.thrift.clients.config.ConfigClient;
7942 manish.sha 47
import in.shop2020.utils.FedExShipAccountInfo;
3546 mandeep.dh 48
import in.shop2020.utils.ModelUtils;
6322 amar.kumar 49
import in.shop2020.warehouse.WarehouseService;
2674 vikas 50
 
6322 amar.kumar 51
import java.io.BufferedInputStream;
52
import java.io.File;
53
import java.io.FileInputStream;
54
import java.io.FileWriter;
55
import java.io.IOException;
56
import java.io.InputStream;
6912 anupam.sin 57
import java.text.SimpleDateFormat;
2674 vikas 58
import java.util.ArrayList;
8824 manish.sha 59
import java.util.Arrays;
6912 anupam.sin 60
import java.util.Calendar;
4416 mandeep.dh 61
import java.util.Collections;
6912 anupam.sin 62
import java.util.Date;
7836 anupam.sin 63
import java.util.HashMap;
4689 anupam.sin 64
import java.util.HashSet;
2674 vikas 65
import java.util.List;
7836 anupam.sin 66
import java.util.Map;
4689 anupam.sin 67
import java.util.Set;
4416 mandeep.dh 68
import java.util.concurrent.Callable;
69
import java.util.concurrent.Executors;
70
import java.util.concurrent.TimeUnit;
2674 vikas 71
 
6322 amar.kumar 72
import javax.servlet.ServletOutputStream;
73
 
4689 anupam.sin 74
import net.htmlparser.jericho.Source;
75
 
5845 mandeep.dh 76
import org.apache.commons.lang.StringUtils;
2674 vikas 77
import org.apache.log4j.Logger;
8824 manish.sha 78
import org.apache.shiro.SecurityUtils;
79
import org.apache.struts2.convention.annotation.Result;
80
import org.apache.struts2.convention.annotation.Results;
2728 vikas 81
import org.apache.thrift.TException;
4142 mandeep.dh 82
import org.apache.thrift.transport.TTransportException;
2674 vikas 83
 
7942 manish.sha 84
import com.ShipWebServiceClient;
85
import com.fedex.ship.stub.CompletedPackageDetail;
86
import com.fedex.ship.stub.CompletedShipmentDetail;
87
import com.fedex.ship.stub.ProcessShipmentReply;
88
import com.fedex.ship.stub.TrackingId;
89
 
2674 vikas 90
/**
91
 * @author vikas
3578 mandeep.dh 92
 * 
2674 vikas 93
 */
94
@SuppressWarnings("serial")
95
public class UserOrderInfoController extends BaseController {
7372 kshitij.so 96
	private static Logger                  log                     = Logger.getLogger(Class.class);
97
	private static BlueDartTrackingService blueDartTrackingService = new BlueDartTrackingService();
98
	private static AramexTrackingService aramexTrackingService     = new AramexTrackingService();
99
	private static DelhiveryTrackingService delhiveryTrackingService     = new DelhiveryTrackingService();
100
	private static RedExpressTrackingService redexpressTrackingService = new RedExpressTrackingService();
7942 manish.sha 101
	//Start:- Added by Manish Sharma for fedex Integration- Shipment Tracking on 31-Jul-2013
102
	private static FedExTrackingService fedexTrackingService = new FedExTrackingService();
103
	//End:- Added by Manish Sharma for fedex Integration- Shipment Tracking on 31-Jul-2013
104
 
7372 kshitij.so 105
	private long                 orderId;
106
	private Order                order;
107
	private List<Payment>        payments;
108
	private List<ShipmentUpdate> shipmentUpdates = new ArrayList<ShipmentUpdate>();
109
	private Long                 codTicketId;
110
	private List<Address>        addresses;
111
	private Set<OrderStatus>     setOfcancellableStates;
8824 manish.sha 112
	//Start:- Added by Manish Sharma for Physical Refunds 
113
	private Set<OrderStatus>	 setOfrefundableStates;
8848 manish.sha 114
	private Set<OrderStatus>	 setOfprepaidrefundableStates;
8824 manish.sha 115
	//End:- Added by Manish Sharma for Physical Refunds
7372 kshitij.so 116
	private String               cancellationInitiator;
117
	private String               cancelReason;
118
	private String               body;
119
	private String               line1;
120
	private String               line2;
121
	private String               city;
122
	private String               state;
123
	private String               pin;
124
	private String				 freebieItem;
125
	private String				 dealText;
126
	private String 				 parentOrderIdForFreebieOrder;
127
	private String				 freebieOrderId;
7393 anupam.sin 128
	private double               cashAmount;
129
	private double               cardAmount;
130
    private StoreOrderDetail     storeOrderDetail;
7826 manish.sha 131
    //Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
7830 anupam.sin 132
    private AmazonOrder          amazonOrder = null;
7836 anupam.sin 133
    private String               providerName = "N/A";
7826 manish.sha 134
    //End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
8296 kshitij.so 135
    private long				 gvAmount;
8824 manish.sha 136
    //Start:- Added by Manish Sharma for Physical Refunds 
137
    private String               rfdRadio;
138
    private String         	     couponDetails;
139
    private String               refundAmountCoupon;
140
    private String               chequeDetails;
141
    private String               refundAmountCheque;
142
    private String 			     refundAmountGateway;
143
    private String			     comments;
144
 
145
    private String 				 errorMsg = "";
146
	private String 				 successmsg = "";
147
	//End:- Added by Manish Sharma for Physical Refunds 
2674 vikas 148
 
7372 kshitij.so 149
	public UserOrderInfoController() {
150
		super();
151
		setOfcancellableStates = new HashSet<OrderStatus>();
152
		setOfcancellableStates.add(OrderStatus.SUBMITTED_FOR_PROCESSING);
153
		setOfcancellableStates.add(OrderStatus.INVENTORY_LOW);
154
		setOfcancellableStates.add(OrderStatus.LOW_INV_PO_RAISED);
155
		setOfcancellableStates.add(OrderStatus.LOW_INV_REVERSAL_IN_PROCESS);
156
		setOfcancellableStates.add(OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT);
157
		setOfcancellableStates.add(OrderStatus.ACCEPTED);
158
		setOfcancellableStates.add(OrderStatus.BILLED);
8824 manish.sha 159
 
160
		//Start:- Added by Manish Sharma for Physical Refunds 
161
		setOfrefundableStates = new HashSet<OrderStatus>();
162
		setOfrefundableStates.add(OrderStatus.DOA_VALID_REFUNDED);
163
		setOfrefundableStates.add(OrderStatus.DOA_INVALID_REFUNDED);
164
		setOfrefundableStates.add(OrderStatus.DOA_REFUNDED_RCVD_DAMAGED);
165
		setOfrefundableStates.add(OrderStatus.DOA_REFUNDED_LOST_IN_TRANSIT);
166
		setOfrefundableStates.add(OrderStatus.RTO_DAMAGED_REFUNDED);
167
		setOfrefundableStates.add(OrderStatus.RET_PRODUCT_USABLE_REFUNDED);
168
		setOfrefundableStates.add(OrderStatus.RET_PRODUCT_UNUSABLE_REFUNDED);
169
		setOfrefundableStates.add(OrderStatus.RET_REFUNDED_RCVD_DAMAGED);
170
		setOfrefundableStates.add(OrderStatus.RET_REFUNDED_LOST_IN_TRANSIT);
171
		//End:- Added by Manish Sharma for Physical Refunds 
172
 
8848 manish.sha 173
		setOfprepaidrefundableStates = new HashSet<OrderStatus>();
174
		setOfprepaidrefundableStates.add(OrderStatus.RTO_REFUNDED);
175
		setOfprepaidrefundableStates.add(OrderStatus.RTO_LOST_IN_TRANSIT_REFUNDED);
176
		setOfprepaidrefundableStates.add(OrderStatus.LOST_IN_TRANSIT_REFUNDED);
177
		setOfprepaidrefundableStates.add(OrderStatus.CANCELLED_ON_CUSTOMER_REQUEST);
178
		setOfprepaidrefundableStates.add(OrderStatus.CANCELLED_DUE_TO_LOW_INVENTORY);
8824 manish.sha 179
 
8848 manish.sha 180
 
7372 kshitij.so 181
	}
7836 anupam.sin 182
 
183
	public static final Map<Long, String> providerNameMap = new HashMap<Long, String>() {
184
        {
185
            put(1l, "BlueDart");
186
            put(2l, "Aramex");
187
            put(3l, "Delhivery");
188
            put(4l, "SelfPickup");
189
            put(5l, "Runner");
190
            put(6l, "RedExpress");
8356 manish.sha 191
            put(7l, "FedEx");
7836 anupam.sin 192
        }
193
	};
194
 
7372 kshitij.so 195
	public String index() {
196
		try {
197
			PaymentClient paymentServiceClient = new PaymentClient();
198
			TransactionClient transactionServiceClient = new TransactionClient();
7826 manish.sha 199
			LogisticsClient logisticsServiceClient = new LogisticsClient();
200
 
8824 manish.sha 201
			/*List<Provider> providerList = logisticsServiceClient.getClient().getAllProviders();
202
			Map<Long, String> providerNameMap = new HashMap<Long, String>();
203
			for(Provider provider : providerList){
204
				providerNameMap.put(provider.getId(), provider.getName());
205
			}*/
7372 kshitij.so 206
			order = transactionServiceClient.getClient().getOrder(orderId);
7826 manish.sha 207
			//Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
7830 anupam.sin 208
			try {
209
			    amazonOrder = transactionServiceClient.getClient().getAmazonOrder(orderId);
210
			} catch (Exception e) {
7959 anupam.sin 211
			    log.error("Exception : No Amazon order found with orderId " + orderId);
7830 anupam.sin 212
			}
7836 anupam.sin 213
			if (order.getLogistics_provider_id() > 0) {
214
			    setProviderName(providerNameMap.get(order.getLogistics_provider_id()));
215
			}
7826 manish.sha 216
			//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
7393 anupam.sin 217
			if(order.getSource() == 2) {
218
    			storeOrderDetail = transactionServiceClient.getClient().getStoreOrderDetail(order.getId(),order.getStoreId());
7399 anupam.sin 219
    			if(order.getStatus().getValue() == 15 || order.getStatus().getValue() == 34) {
220
    			    setCashAmount(storeOrderDetail.getCashRefundAmount());
221
                    setCardAmount(storeOrderDetail.getCardRefundAmount()); 
222
    			} else {
223
        			setCashAmount(storeOrderDetail.getCashAmount());
224
        			setCardAmount(storeOrderDetail.getCardAmount());
225
    			}
7393 anupam.sin 226
			}
7372 kshitij.so 227
			if(order.getFreebieItemId()>0) {
228
				CatalogService.Client catalogClient = new CatalogClient().getClient();
229
				Item item = catalogClient.getItem(order.getFreebieItemId());
230
				freebieItem = item.getBrand() + " " + item.getModelName() + " " + item.getModelNumber() + " " + item.getColor();
231
			}
3090 mandeep.dh 232
 
7372 kshitij.so 233
			if(order.getLineitems().get(0).getDealText()!=null && !order.getLineitems().get(0).getDealText().isEmpty()) {
234
				dealText = order.getLineitems().get(0).getDealText();
235
			}
236
			List<in.shop2020.model.v1.order.Attribute> attributes = 
237
				transactionServiceClient.getClient().getAllAttributesForOrderId(orderId);
3578 mandeep.dh 238
 
7372 kshitij.so 239
			for(in.shop2020.model.v1.order.Attribute attribute: attributes){
240
				if(attribute.getName().equals("parentOrderIdForFreebie")){
241
					parentOrderIdForFreebieOrder = attribute.getValue();
242
				} else if (attribute.getName().equals("freebieOrderId")){
243
					freebieOrderId = attribute.getValue();
244
				}
245
			}
4689 anupam.sin 246
 
7372 kshitij.so 247
			payments = paymentServiceClient.getClient()
248
			.getPaymentForTxnId(order.getTransactionId());
8296 kshitij.so 249
 
250
			gvAmount = order.getGvAmount();
4689 anupam.sin 251
 
4416 mandeep.dh 252
 
3578 mandeep.dh 253
 
7372 kshitij.so 254
			// Spawning a thread to capture shipment updates from Bluedart
255
			// This is done to ensure that response from Crm web app is sent
256
			// within given time limits. Also, we wont be affected in the cases 
257
			// where bluedart site is down or slow
258
			Executors.newSingleThreadExecutor().invokeAll(Collections.singletonList(new Callable<Boolean>() {
259
				public Boolean call() throws Exception {
260
					if (order.getLogistics_provider_id() == 1)
261
						shipmentUpdates = blueDartTrackingService.getUpdates(order.getAirwaybill_no());
262
					else if (order.getLogistics_provider_id() == 2) {
263
						shipmentUpdates = aramexTrackingService.getUpdates(order.getAirwaybill_no());
264
					}
265
					else if (order.getLogistics_provider_id() == 3) {
266
						shipmentUpdates = delhiveryTrackingService.getUpdates(order.getAirwaybill_no());
267
					}
268
					else if (order.getLogistics_provider_id() == 6) {
269
						shipmentUpdates = redexpressTrackingService.getUpdates(order.getAirwaybill_no());
270
					}
7942 manish.sha 271
					//Start:- Added by Manish Sharma for fedex Integration- Shipment Tracking on 31-Jul-2013
272
					else if (order.getLogistics_provider_id() == 7) {
273
						shipmentUpdates = fedexTrackingService.getUpdates(order.getAirwaybill_no());
274
					}
275
					//End:- Added by Manish Sharma for fedex Integration- Shipment Tracking on 31-Jul-2013
7372 kshitij.so 276
					else {
277
						shipmentUpdates = new ArrayList<ShipmentUpdate>();
278
						log.error("Error : providerId = " + order.getLogistics_provider_id() + "for orderId : " + order.getId());
279
					}
280
					return true;
281
				}
282
			}), 60, TimeUnit.SECONDS);
2674 vikas 283
 
7372 kshitij.so 284
			if (order.isCod() && OrderStatus.COD_VERIFICATION_PENDING.equals(order.getStatus())) {
285
				populateCODTicketId(order.getCustomer_id());
286
			}
4142 mandeep.dh 287
 
7372 kshitij.so 288
			if (canEditOrderAddress()) {
289
				userContextServiceClient = new UserClient().getClient();
290
				addresses = userContextServiceClient.getAllAddressesForUser(order.getCustomer_id());
291
			}
3578 mandeep.dh 292
 
7372 kshitij.so 293
		} catch (TTransportException e) {
294
			log.error("Unable to create thrift Client", e);
295
		} catch (TransactionServiceException e) {
296
			addActionError("Invalid order id or no order selected.");
297
		} catch (TException e) {
298
			log.error("Unable to get thrift Client", e);
299
		} catch (PaymentException e) {
300
			log.error("Unable to get payments for transctionId : " + order.getTransactionId(), e);
301
		} catch (InterruptedException e) {
302
			log.error("Thread was interrupted", e);
303
		} catch (UserContextException e) {
304
			log.error("Unable to get addresses for user : " + order.getCustomer_id(), e);
305
		} catch(CatalogServiceException csex) {
306
			log.error("Unable to get item details for itemId: " + order.getFreebieItemId(), csex);
8824 manish.sha 307
		} /*catch (LogisticsServiceException lsex) {
308
			log.error("Unable to get providers infromation: " , lsex);
309
		}*/
7372 kshitij.so 310
		return INDEX;
311
	}
4689 anupam.sin 312
 
7372 kshitij.so 313
	private boolean canEditOrderAddress() {
314
		return false;
315
	}
4689 anupam.sin 316
 
7372 kshitij.so 317
	private void populateCODTicketId(long customerId) {
318
		try {
319
			SearchFilter searchFilter = new SearchFilter();
320
			searchFilter.setTicketCategory(TicketCategory.COD_VERIFICATION);
321
			searchFilter.setTicketStatuses(new ArrayList<TicketStatus>());
322
			searchFilter.getTicketStatuses().add(TicketStatus.OPEN);
323
			searchFilter.getTicketStatuses().add(TicketStatus.REOPEN);
324
			searchFilter.setCustomerId(customerId);
325
			crmServiceClient = new CRMClient().getClient();
326
			List<Ticket> tickets = crmServiceClient.getTickets(searchFilter);
327
			if (tickets != null && !tickets.isEmpty()) {
328
				codTicketId = tickets.get(0).getId();
329
			}
330
		} catch (TException e) {
331
			log.error("Error fetching tickets for customerId: " + customerId, e);
332
		}
333
	}
4689 anupam.sin 334
 
7372 kshitij.so 335
	public String markOrderForCancellation() {
336
		try{
337
			TransactionClient transactionServiceClient = new TransactionClient();
338
			log.info("URL = " + request.getRequestURI());
339
			log.info("Initiator = " + request.getParameter("cancellationInitiator"));
340
			log.info("orderId = " + request.getParameter("orderId"));
7393 anupam.sin 341
 
342
			order = transactionServiceClient.getClient().getOrder(orderId);
343
 
7499 anupam.sin 344
			/**
345
			 * If the order is from store then refund the order directly.
346
			 */
7393 anupam.sin 347
			if (order.getSource() == 2) {
348
			    String plainTextbody = "";
349
			    if(body!=null && !body.isEmpty()){
350
                    plainTextbody = new Source(body).getTextExtractor().toString();
351
                }
7612 anupam.sin 352
 
353
			    if(cashAmount + cardAmount > order.getAdvanceAmount()) {
354
			        log.error("Could not mark order for Cancellation, OrderId : " + orderId);
355
			        return "index";
356
			    }
357
 
358
			    transactionServiceClient.getClient().saveRefundAmountsForStoreOrder(orderId, order.getStoreId(), cashAmount, cardAmount);
7399 anupam.sin 359
			    if (cancellationInitiator.equals("CUSTOMER")) {
360
			        transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
361
			        transactionServiceClient.getClient().markOrderCancellationRequestConfirmed(orderId);
362
			    }
7393 anupam.sin 363
			    transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
7499 anupam.sin 364
			} else {
365
		         if (cancellationInitiator.equals("CUSTOMER")) {
366
	                transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
367
	                long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
368
	                Ticket ticket = new Ticket();
369
	                String plainTextbody = "";
370
	                if(body!=null && !body.isEmpty()){
371
	                    plainTextbody = new Source(body).getTextExtractor().toString();
372
	                }
373
	                ticket.setDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
374
	                ticket.setCreatorId(creatorId);
375
	                ticket.setStatus(TicketStatus.OPEN);
376
	                ticket.setPriority(TicketPriority.HIGH);
377
	                ticket.setCategory(TicketCategory.ORDER_CANCELLATION);
378
	                ticket.setOrderId(orderId);
4689 anupam.sin 379
 
7499 anupam.sin 380
	                Activity activity = new Activity();
381
	                activity.setDescription("Creating Ticket");
382
	                activity.setType(ActivityType.OTHER);
383
	                activity.setTicketPriority(TicketPriority.HIGH);
384
	                activity.setTicketStatus(TicketStatus.OPEN);
385
	                activity.setCreatorId(creatorId);
386
	                activity.setTicketDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
387
	                activity.setTicketCategory(TicketCategory.ORDER_CANCELLATION);
4689 anupam.sin 388
 
7499 anupam.sin 389
	                ticket.setCustomerId(order.getCustomer_id());
390
	                activity.setCustomerId(order.getCustomer_id());
391
	                ticket.setCustomerName(order.getCustomer_name());
392
	                activity.setCustomerName(order.getCustomer_name());
393
	                ticket.setCustomerEmailId(order.getCustomer_email());
394
	                activity.setCustomerEmailId(order.getCustomer_email());
395
	                ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
396
	                activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
4689 anupam.sin 397
 
7499 anupam.sin 398
	                crmServiceClient = new CRMClient().getClient();
399
	                crmServiceClient.insertTicket(ticket, activity);
400
	            } 
401
	            else if (cancellationInitiator.equals("INTERNAL")) {
402
	                String plainTextbody = "";
403
	                if(body!=null && !body.isEmpty()){
404
	                    plainTextbody = new Source(body).getTextExtractor().toString();
405
	                }
406
	                boolean status_returned = transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
407
	                if (status_returned) {
408
	                    order = transactionServiceClient.getClient().getOrder(orderId);
409
	                    long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
410
	                    Ticket ticket = new Ticket();
411
	                    ticket.setDescription("Creating ticket for Order Cancellation due to Low inventory");
412
	                    ticket.setCreatorId(creatorId);
413
	                    ticket.setAssigneeId(36);
414
	                    ticket.setStatus(TicketStatus.OPEN);
415
	                    ticket.setPriority(TicketPriority.MEDIUM);
416
	                    ticket.setCategory(TicketCategory.LOW_INVENTORY_CANCELLED_ORDERS);
417
	                    ticket.setOrderId(orderId);
418
	                    ticket.setCustomerId(order.getCustomer_id());
419
	                    ticket.setCustomerName(order.getCustomer_name());
420
	                    ticket.setCustomerEmailId(order.getCustomer_email());
421
	                    ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
6322 amar.kumar 422
 
7499 anupam.sin 423
	                    Activity activity = new Activity();
424
	                    activity.setDescription("Creating Ticket");
425
	                    activity.setType(ActivityType.OTHER);
426
	                    activity.setTicketPriority(TicketPriority.MEDIUM);
427
	                    activity.setTicketStatus(TicketStatus.OPEN);
428
	                    activity.setCreatorId(creatorId);
429
	                    activity.setTicketAssigneeId(36);
430
	                    activity.setTicketCategory(TicketCategory.LOW_INVENTORY_CANCELLED_ORDERS);
431
	                    activity.setTicketDescription("Creating ticket for Order Cancellation due to Low inventory");
432
	                    activity.setCustomerId(order.getCustomer_id());
433
	                    activity.setCustomerName(order.getCustomer_name());
434
	                    activity.setCustomerEmailId(order.getCustomer_email());
435
	                    activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
6322 amar.kumar 436
 
7499 anupam.sin 437
	                    crmServiceClient = new CRMClient().getClient();
438
	                    crmServiceClient.insertTicket(ticket, activity);
439
	                }
440
	            }
7372 kshitij.so 441
			}
442
		} catch(Exception e) {
443
			log.error("Could not mark order for Cancellation, OrderId : " + orderId, e);
444
		}
445
		return index();
446
	}
7221 kshitij.so 447
 
7372 kshitij.so 448
	public void getOrderConfirmationMail() throws IOException, TException, ConfigException, TransactionServiceException {
449
		TransactionClient transactionServiceClient = new TransactionClient();
450
		order = transactionServiceClient.getClient().getOrder(orderId);
451
		long source = order.getTransactionId();
452
		HelperClient helperClient = new HelperClient("helper_service_server","helper_service_server_port");
453
		String mail = helperClient.getClient().getOrderConfirmationMail(source);
454
		File file = new File("/tmp/temp");
7643 manish.sha 455
		//Start:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
456
		if(mail.isEmpty() || mail==null || mail=="")
457
			mail="<html><body><p>Sorry, Required e-mail for mentioned order does not exist in the system !!!</p></body></html>";
458
		//End:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
7221 kshitij.so 459
 
7372 kshitij.so 460
		FileWriter writer = new FileWriter(file);
461
		writer.append(mail);
462
		writer.close();
4689 anupam.sin 463
 
7372 kshitij.so 464
		byte[] buffer = new byte[(int)file.length()];
465
		InputStream input = null;
466
		try {
467
			int totalBytesRead = 0;
468
			input = new BufferedInputStream(new FileInputStream(file));
469
			while(totalBytesRead < buffer.length){
470
				int bytesRemaining = buffer.length - totalBytesRead;
471
				int bytesRead = input.read(buffer, totalBytesRead, bytesRemaining); 
472
				if (bytesRead > 0){
473
					totalBytesRead = totalBytesRead + bytesRead;
474
				}
475
			}
476
		}
477
		finally {
478
			input.close();
479
			file.delete();
480
		}
3578 mandeep.dh 481
 
4142 mandeep.dh 482
 
7372 kshitij.so 483
		response.setHeader("Content-disposition", "inline; filename=" + "OrderDetail_"+orderId );
2674 vikas 484
 
7372 kshitij.so 485
		ServletOutputStream sos;
486
		try {
487
			sos = response.getOutputStream();
488
			sos.write(buffer);
489
			sos.flush();
490
		} catch (IOException e) {
491
			System.out.println("Unable to stream the manifest file");
492
		}   
493
	}
4142 mandeep.dh 494
 
7372 kshitij.so 495
	public void getOrderDeliveryMail() throws IOException, TException, ConfigException, TransactionServiceException {
496
		HelperClient helperClient = new HelperClient("helper_service_server","helper_service_server_port");
497
		String mail = helperClient.getClient().getOrderDeliveryMail(orderId);
498
		File file = new File("/tmp/temp");
7643 manish.sha 499
		//Start:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
500
		if(mail.isEmpty() || mail==null || mail=="")
501
			mail="<html><body><p>Sorry, Required e-mail for mentioned order does not exist in the system anymore !!!</p></body></html>";
502
		//End:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
7372 kshitij.so 503
		FileWriter writer = new FileWriter(file);
504
		writer.append(mail);
505
		writer.close();
2674 vikas 506
 
7372 kshitij.so 507
		byte[] buffer = new byte[(int)file.length()];
508
		InputStream input = null;
509
		try {
510
			int totalBytesRead = 0;
511
			input = new BufferedInputStream(new FileInputStream(file));
512
			while(totalBytesRead < buffer.length){
513
				int bytesRemaining = buffer.length - totalBytesRead;
514
				int bytesRead = input.read(buffer, totalBytesRead, bytesRemaining); 
515
				if (bytesRead > 0){
516
					totalBytesRead = totalBytesRead + bytesRead;
517
				}
518
			}
519
		}
520
		finally {
521
			input.close();
522
			file.delete();
523
		}
3578 mandeep.dh 524
 
5845 mandeep.dh 525
 
7372 kshitij.so 526
		response.setHeader("Content-disposition", "inline; filename=" + "OrderDetail_"+orderId );
4142 mandeep.dh 527
 
7372 kshitij.so 528
		ServletOutputStream sos;
529
		try {
530
			sos = response.getOutputStream();
531
			sos.write(buffer);
532
			sos.flush();
533
		} catch (IOException e) {
534
			System.out.println("Unable to stream the manifest file");
535
		}   
536
	}
2674 vikas 537
 
7372 kshitij.so 538
	public boolean canOrderBeCancelled() {
539
		if (setOfcancellableStates.contains(order.getStatus())) {
540
			return true;
541
		}
542
		return false;
543
	}
2674 vikas 544
 
7372 kshitij.so 545
	public String getPaymentGateway(Payment payment) {
546
		String gatewayName = "";
2674 vikas 547
 
7372 kshitij.so 548
		try {
549
			Client paymentServiceClient = new PaymentClient().getClient();
550
			gatewayName = paymentServiceClient.getPaymentGateway(payment.getGatewayId()).getName();
551
		} catch (TTransportException e) {
552
		} catch (PaymentException e) {
553
		} catch (TException e) {
554
		}
3090 mandeep.dh 555
 
7372 kshitij.so 556
		return gatewayName;
557
	}
3499 mandeep.dh 558
 
7372 kshitij.so 559
	public int convertDouble(double value) {
560
		return (int)value;
561
	}
4142 mandeep.dh 562
 
7372 kshitij.so 563
	public String getInsuranceExpiryDate(long DeliveryDate) {
564
		if (DeliveryDate == 0) {
565
			return "N/A";
566
		}
567
		Calendar cal = Calendar.getInstance();
568
		cal.setTimeInMillis(DeliveryDate);
569
		cal.add(Calendar.YEAR, 1);
570
		SimpleDateFormat sdf = new SimpleDateFormat("dd MMM, yyyy");
571
		return sdf.format(cal.getTime());
572
	}
4142 mandeep.dh 573
 
7372 kshitij.so 574
	public String getShippingAddressOfStore(long storeId) {
575
		try {
576
			in.shop2020.logistics.LogisticsService.Client client = new LogisticsClient().getClient();
577
			PickupStore store = client.getPickupStore(storeId);
578
			return StringUtils.join(new String[] {
579
					store.getName(),
580
					store.getLine1(),
581
					store.getLine2(),
582
					store.getPin(),
583
					store.getCity(),
584
					store.getState(),
585
					store.getPhone()}, ",");
586
		} catch (Exception e) {
587
			return "";
588
		}
589
	}
4241 anupam.sin 590
 
7372 kshitij.so 591
	public String getAddress(Order order) {
592
		return ModelUtils.extractAddressFromOrder(order);
593
	}
4241 anupam.sin 594
 
7372 kshitij.so 595
	public String changeShippingAddress() {
596
		try {
597
			TransactionClient transactionServiceClient = new TransactionClient();
7942 manish.sha 598
			in.shop2020.model.v1.order.TransactionService.Client transactionClient
599
		    = transactionServiceClient.getClient();
600
			transactionClient.changeShippingAddress(orderId, line1, line2, city, state, pin);
601
			in.shop2020.model.v1.order.Order t_order = transactionClient.getOrder(orderId);
602
			if(t_order.getLogistics_provider_id()==7L){
603
				FedExShipAccountInfo fedexAccountInfo = FedExShipAccountInfo.getFedExInfo();
604
				ProcessShipmentReply  processShipmentReply = ShipWebServiceClient.getShipmentCreationReply(t_order,fedexAccountInfo.getClientDetail(),fedexAccountInfo.getWad(),fedexAccountInfo.getEndPointAddress());
605
				CompletedShipmentDetail completedShipmentDetails = processShipmentReply.getCompletedShipmentDetail();
606
				CompletedPackageDetail completedPackageDetails =  completedShipmentDetails.getCompletedPackageDetails(0);
607
				TrackingId  trackId= completedPackageDetails.getTrackingIds(0);
608
				t_order = transactionClient.updateOrderAWB(t_order.getId(), trackId.getTrackingNumber());
609
			}
7372 kshitij.so 610
		} catch(Exception e) {
611
			log.error("Unable to update address for orderId : " + orderId + "and address : " + 
612
					line1 + ", " + line2+ ", " + city + ", " + state + ", " + pin, e);
613
		}
614
		return null;
615
	}
7399 anupam.sin 616
 
7730 anupam.sin 617
	public String convertStoreToNormal() {
618
	    try{
619
	        TransactionClient transactionServiceClient = new TransactionClient();
620
	        transactionServiceClient.getClient().convertStoreToNormal(orderId);
621
	    } catch(Exception e) {
622
	        log.error("Unable to convert to normal order", e);
623
	    }
624
	    return null;
625
	}
626
 
7399 anupam.sin 627
	public String getStoreDetails(long storeId) {
628
	    try {
629
	        TransactionClient tcl = new TransactionClient();
630
	        HotspotStore store = tcl.getClient().getHotspotStore(storeId, "");
631
	        return store.getHotspotId() + " - " + store.getCity(); 
632
	    } catch (Exception e) {
633
	        log.error("Unable to get hostspotStore for id : " + storeId, e);
634
	    }
635
	    return "N/A";
636
	}
4689 anupam.sin 637
 
7372 kshitij.so 638
	public Address getShippingAddress(Order order) {
639
		Address address = new Address();
640
		address.setLine1(order.getCustomer_address1());
641
		address.setLine2(order.getCustomer_address2());
642
		address.setCity(order.getCustomer_city());
643
		address.setState(order.getCustomer_state());
644
		address.setPin(order.getCustomer_pincode());
645
		return address;
646
	}
8606 amar.kumar 647
 
648
	public String getOrderSource(Order order) {
649
		return OrderSource.findByValue((int)(order.getSource())).toString();
650
	}
4689 anupam.sin 651
 
7372 kshitij.so 652
	public String getPaymentMethod(List<Attribute> paymentAttributes) {
653
		String paymentMethod = null;
654
		if (paymentAttributes == null || paymentAttributes.isEmpty()) {
655
			return "N/A";
656
		}
657
		for (Attribute a : paymentAttributes) {
658
			if ("payMethod".equals(a.getName())) {
659
				paymentMethod = Constants.PAYMENT_METHOD.get(a.getValue());
660
				break;
661
			}
662
		}
663
		return paymentMethod != null ? paymentMethod : "N/A";
664
	}
8824 manish.sha 665
	//Start:- Added by Manish Sharma for Physical Refunds 
666
	public String refundOrderPayment(){
667
		try{
668
			TransactionClient transactionServiceClient = new TransactionClient();
669
			in.shop2020.model.v1.order.TransactionService.Client transactionClient
670
		    = transactionServiceClient.getClient();
671
 
672
			in.shop2020.model.v1.order.Order t_order = transactionClient.getOrder(orderId);
673
			List<in.shop2020.model.v1.order.Attribute> attrList = new ArrayList<in.shop2020.model.v1.order.Attribute>();
674
			in.shop2020.model.v1.order.Attribute attr1 = new in.shop2020.model.v1.order.Attribute();
675
			attr1.setName("Refund_Option");
676
			in.shop2020.model.v1.order.Attribute attr2 = new in.shop2020.model.v1.order.Attribute();
677
			attr2.setName("Refund_Amount");
678
			PaymentClient paymentServiceClient = new PaymentClient();
679
			List<Payment> orderPayments =null; 
680
			if(!t_order.isCod()){
681
				orderPayments =paymentServiceClient.getClient()
682
					.getPaymentForTxnId(t_order.getTransactionId());
683
			}
684
 
685
			if(rfdRadio.equalsIgnoreCase("rfdCoupon")){
686
				if((couponDetails!=null && !("").equalsIgnoreCase(couponDetails)) || (refundAmountCoupon!=null &&!("").equalsIgnoreCase(refundAmountCoupon))){
687
					if(Double.parseDouble(refundAmountCoupon) <= t_order.getTotal_amount()){
688
						log.info(Double.parseDouble(refundAmountCoupon));
689
						log.info(t_order.getTotal_amount());
690
						attr1.setValue("Refund By Coupon: "+couponDetails);
691
						attrList.add(attr1);
692
						attr2.setValue(refundAmountCoupon);
693
						attrList.add(attr2);
694
						transactionClient.setOrderAttributes(t_order.getId(), attrList);
695
						successmsg = "Refund Marked Successful: Through Coupon";
696
						return "physical-refund-result";
697
					}
698
				}
699
				else{
700
					errorMsg ="Refund Unsuccessful: Due to either coupon details or refund amount is blank ";
701
					return "physical-refund-result";
702
				}
703
				errorMsg ="Refund Unsuccessful: Due to coupon amount greater than order total amount ";
704
			}
705
			if(rfdRadio.equalsIgnoreCase("rfdCheque")){
706
				if((chequeDetails!=null && !("").equalsIgnoreCase(chequeDetails)) || (refundAmountCheque!=null &&!("").equalsIgnoreCase(refundAmountCheque))){
707
					if(Double.parseDouble(refundAmountCheque) <= t_order.getTotal_amount()){
708
						attr1.setValue("Refund By Cheque: "+chequeDetails);
709
						attrList.add(attr1);
710
						attr2.setValue(refundAmountCheque);
711
						attrList.add(attr2);
712
						transactionClient.setOrderAttributes(t_order.getId(), attrList);
713
						successmsg = "Refund Marked Successful: Through Cheque";
714
						return "physical-refund-result";
715
					}
716
				}
717
				else{
718
					errorMsg ="Refund Unsuccessful: Due to either cheque details or refund amount is blank ";
719
					return "physical-refund-result";
720
				}
721
				errorMsg ="Refund Unsuccessful: Due to cheque amount greater than order total amount ";
722
			}
723
			if(rfdRadio.equalsIgnoreCase("rfdGateway")){
724
				if((comments!=null && !("").equalsIgnoreCase(comments)) || (refundAmountGateway!=null &&!("").equalsIgnoreCase(refundAmountGateway))){
725
					if(Double.parseDouble(refundAmountGateway) <= t_order.getTotal_amount()){
726
						boolean refundResult = paymentServiceClient.getClient().refundPayment(t_order.getTransactionId(), Double.parseDouble(refundAmountGateway), false);
727
						if(refundResult){
728
							attr1.setValue("Refund By Payment Gatway: "+comments);
729
							attrList.add(attr1);
730
							attr2.setValue(refundAmountGateway);
731
							attrList.add(attr2);
732
							transactionClient.setOrderAttributes(t_order.getId(), attrList);
733
							successmsg = "Refund Marked Successful: Through Gateway";
734
							return "physical-refund-result";
735
						}
736
						else{
737
							if(orderPayments !=null && !orderPayments.isEmpty()){
738
								Payment payment = orderPayments.get(0);
739
								if(payment.getGatewayId()==13L){
740
									attr1.setValue("Refund By Innoviti Gatway: "+comments);
741
									attrList.add(attr1);
742
									attr2.setValue(refundAmountGateway);
743
									attrList.add(attr2);
744
									transactionClient.setOrderAttributes(t_order.getId(), attrList);
745
									successmsg = "Refund Marked Successful: Through Innoviti Payment Gateway.";
746
									return "physical-refund-result";
747
								}
748
							}
749
							errorMsg ="Refund Unsuccessful: at Payment Gateway ";
750
							return "physical-refund-result";
751
						}
752
 
753
					}
754
				}
755
				else{
756
					errorMsg ="Refund Unsuccessful: Due to either comments or refund amount is blank ";
757
					return "physical-refund-result";
758
				}
759
				errorMsg ="Refund Unsuccessful: Due to refund amount greater than order total amount ";
760
			}
761
 
762
		}
763
		catch(Exception e){
764
			log.error(e);
765
		}
766
		return "physical-refund-result";
767
	}
768
 
769
	public int getRefundEnabledStatus(){
770
		try{
771
			TransactionClient transactionServiceClient = new TransactionClient();
772
			in.shop2020.model.v1.order.TransactionService.Client transactionClient
773
		    = transactionServiceClient.getClient();
774
			in.shop2020.model.v1.order.Order t_order = transactionClient.getOrder(orderId);
775
			String refundOption=transactionClient.getOrderAttributeValue(orderId, "Refund_Option");
776
			String refundAmount=transactionClient.getOrderAttributeValue(orderId, "Refund_Amount");
777
			if((refundOption!=null && refundAmount!=null) && (!("").equalsIgnoreCase(refundOption)) && !("").equalsIgnoreCase(refundAmount) && SecurityUtils.getSubject().hasRole("TeamLead")){
778
				System.out.println("Into the Refund Condition");
779
				return 0;
780
			}
8848 manish.sha 781
			else if(t_order.isCod()){
782
				if(setOfrefundableStates.contains(t_order.getStatus()) && SecurityUtils.getSubject().hasRole("TeamLead")){
783
					System.out.println("Into the COD Status Condition");
784
					return 2;
785
				}
8824 manish.sha 786
			}
8848 manish.sha 787
			else{
788
				if(( setOfprepaidrefundableStates.contains(t_order.getStatus()) || setOfrefundableStates.contains(t_order.getStatus()) ) && SecurityUtils.getSubject().hasRole("TeamLead")){
789
					System.out.println("Into the Prepaid Status Condition");
790
					return 2;
791
				}
792
			}
8824 manish.sha 793
		}
794
		catch(Exception e){
795
			log.error(e);
796
		}
797
		return 1;
798
	}
799
	//End:- Added by Manish Sharma for Physical Refunds 	
4689 anupam.sin 800
 
7372 kshitij.so 801
	public void setOrderId(String orderId) {
802
		try {
803
			this.orderId = Long.parseLong(orderId);
804
		} catch (NumberFormatException e) {
805
			log.error(e);
806
		}
807
	}
4689 anupam.sin 808
 
7372 kshitij.so 809
	public List<Payment> getPayments() {
810
		return payments;
811
	}
4689 anupam.sin 812
 
7372 kshitij.so 813
	public List<ShipmentUpdate> getShipmentUpdates() {
814
		return shipmentUpdates;
815
	}
4689 anupam.sin 816
 
7372 kshitij.so 817
	public void setShipmentUpdates(List<ShipmentUpdate> shipmentUpdates) {
818
		this.shipmentUpdates = shipmentUpdates;
819
	}
6985 anupam.sin 820
 
7372 kshitij.so 821
	public Order getOrder() {
822
		return order;
823
	}
6985 anupam.sin 824
 
7372 kshitij.so 825
	public void setOrder(Order order) {
826
		this.order = order;
827
	}
6985 anupam.sin 828
 
7372 kshitij.so 829
	public Long getCodTicketId() {
830
		return codTicketId;
831
	}
6985 anupam.sin 832
 
7372 kshitij.so 833
	public void setCodTicketId(Long codTicketId) {
834
		this.codTicketId = codTicketId;
835
	}
6985 anupam.sin 836
 
7372 kshitij.so 837
	public List<Address> getAddresses() {
838
		return addresses;
839
	}
6985 anupam.sin 840
 
7372 kshitij.so 841
	public void setAddresses(List<Address> addresses) {
842
		this.addresses = addresses;
843
	}
6985 anupam.sin 844
 
7372 kshitij.so 845
	public String getOrderStatusDescription(Order order) {
846
		String status = order.getStatus().getDescription();
6985 anupam.sin 847
 
7372 kshitij.so 848
		if (order.getStatus() == OrderStatus.DELIVERY_SUCCESS) {
849
			status = "Completed";
850
		}
6985 anupam.sin 851
 
7372 kshitij.so 852
		return status;
853
	}
6985 anupam.sin 854
 
7372 kshitij.so 855
	public String getCancellationInitiator() {
856
		return cancellationInitiator;
857
	}
7190 amar.kumar 858
 
7372 kshitij.so 859
	public void setCancellationInitiator(String cancellationInitiator) {
860
		this.cancellationInitiator = cancellationInitiator;
861
	}
862
 
863
	public String getCancelReason() {
864
		return cancelReason;
865
	}
866
 
867
	public void setCancelReason(String cancelReason) {
868
		this.cancelReason = cancelReason;
869
	}
870
 
871
	public String getBody() {
872
		return body;
873
	}
874
 
875
	public void setBody(String body) {
876
		this.body = body;
877
	}
878
 
879
	public String getLine1() {
880
		return line1;
881
	}
882
 
883
	public void setLine1(String line1) {
884
		this.line1 = line1;
885
	}
886
 
887
	public String getLine2() {
888
		return line2;
889
	}
890
 
891
	public void setLine2(String line2) {
892
		this.line2 = line2;
893
	}
894
 
895
	public String getCity() {
896
		return city;
897
	}
898
 
899
	public void setCity(String city) {
900
		this.city = city;
901
	}
902
 
903
	public String getState() {
904
		return state;
905
	}
906
 
907
	public void setState(String state) {
908
		this.state = state;
909
	}
910
 
911
	public String getPin() {
912
		return pin;
913
	}
914
 
915
	public void setPin(String pin) {
916
		this.pin = pin;
917
	}
918
 
7190 amar.kumar 919
	public String getFreebieItem() {
920
		return freebieItem;
921
	}
922
 
923
	public void setFreebieItem(String freebieItem) {
924
		this.freebieItem = freebieItem;
925
	}
926
 
927
	public String getDealText() {
928
		return dealText;
929
	}
930
 
931
	public void setDealText(String dealText) {
932
		this.dealText = dealText;
933
	}
934
 
935
	public String getParentOrderIdForFreebieOrder() {
936
		return parentOrderIdForFreebieOrder;
937
	}
938
 
939
	public void setParentOrderIdForFreebieOrder(String parentOrderIdForFreebieOrder) {
940
		this.parentOrderIdForFreebieOrder = parentOrderIdForFreebieOrder;
941
	}
942
 
943
	public String getFreebieOrderId() {
944
		return freebieOrderId;
945
	}
946
 
947
	public void setFreebieOrderId(String freebieOrderId) {
948
		this.freebieOrderId = freebieOrderId;
949
	}
7372 kshitij.so 950
 
7393 anupam.sin 951
    public void setCashAmount(double cashAmount) {
952
        this.cashAmount = cashAmount;
953
    }
954
 
955
    public double getCashAmount() {
956
        return cashAmount;
957
    }
958
 
959
    public void setCardAmount(double cardAmount) {
960
        this.cardAmount = cardAmount;
961
    }
962
 
963
    public double getCardAmount() {
964
        return cardAmount;
965
    }
966
 
967
    public long getOrderId() {
968
        return orderId;
969
    }
970
 
971
    public void setOrderId(long orderId) {
972
        this.orderId = orderId;
973
    }
974
 
975
    public StoreOrderDetail getStoreOrderDetail() {
976
        return storeOrderDetail;
977
    }
978
 
979
    public void setStoreOrderDetail(StoreOrderDetail storeOrderDetail) {
980
        this.storeOrderDetail = storeOrderDetail;
981
    }
7826 manish.sha 982
 
983
  //Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
984
    public AmazonOrder getAmazonOrder() {
985
		return amazonOrder;
986
	}
7393 anupam.sin 987
 
7826 manish.sha 988
	public void setAmazonOrder(AmazonOrder amazonOrder) {
989
		this.amazonOrder = amazonOrder;
990
	}
991
 
992
	//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
993
 
7836 anupam.sin 994
    public void setProviderName(String providerName) {
995
        this.providerName = providerName;
996
    }
997
 
998
    public String getProviderName() {
999
        return providerName;
1000
    }
1001
 
1002
    public static void main(String[] args) {
8824 manish.sha 1003
 
7836 anupam.sin 1004
    }
1005
 
8296 kshitij.so 1006
	public void setGvAmount(long gvAmount) {
1007
		this.gvAmount = gvAmount;
1008
	}
1009
 
1010
	public long getGvAmount() {
1011
		return gvAmount;
1012
	}
8824 manish.sha 1013
	//Start:- Added by Manish Sharma for Physical Refunds 
1014
	public String getRfdRadio() {
1015
		return rfdRadio;
1016
	}
8296 kshitij.so 1017
 
8824 manish.sha 1018
 
1019
	public void setRfdRadio(String rfdRadio) {
1020
		this.rfdRadio = rfdRadio;
1021
	}
1022
 
1023
 
1024
	public String getCouponDetails() {
1025
		return couponDetails;
1026
	}
1027
 
1028
 
1029
	public void setCouponDetails(String couponDetails) {
1030
		this.couponDetails = couponDetails;
1031
	}
1032
 
1033
 
1034
	public String getRefundAmountCoupon() {
1035
		return refundAmountCoupon;
1036
	}
1037
 
1038
 
1039
	public void setRefundAmountCoupon(String refundAmountCoupon) {
1040
		this.refundAmountCoupon = refundAmountCoupon;
1041
	}
1042
 
1043
 
1044
	public String getChequeDetails() {
1045
		return chequeDetails;
1046
	}
1047
 
1048
 
1049
	public void setChequeDetails(String chequeDetails) {
1050
		this.chequeDetails = chequeDetails;
1051
	}
1052
 
1053
 
1054
	public String getRefundAmountCheque() {
1055
		return refundAmountCheque;
1056
	}
1057
 
1058
 
1059
	public void setRefundAmountCheque(String refundAmountCheque) {
1060
		this.refundAmountCheque = refundAmountCheque;
1061
	}
1062
 
1063
 
1064
	public String getRefundAmountGateway() {
1065
		return refundAmountGateway;
1066
	}
1067
 
1068
 
1069
	public void setRefundAmountGateway(String refundAmountGateway) {
1070
		this.refundAmountGateway = refundAmountGateway;
1071
	}
1072
 
1073
 
1074
	public String getComments() {
1075
		return comments;
1076
	}
1077
 
1078
 
1079
	public void setComments(String comments) {
1080
		this.comments = comments;
1081
	}
1082
 
1083
	public String getErrorMsg(){
1084
        return this.errorMsg;
1085
    }
1086
 
1087
	public String getSuccessMessage(){
1088
		return this.successmsg ;
1089
	}
1090
	//End:- Added by Manish Sharma for Physical Refunds 
2674 vikas 1091
}