Subversion Repositories SmartDukaan

Rev

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