| Line 246... |
Line 246... |
| 246 |
if (order.getSource() == 2) {
|
246 |
if (order.getSource() == 2) {
|
| 247 |
String plainTextbody = "";
|
247 |
String plainTextbody = "";
|
| 248 |
if(body!=null && !body.isEmpty()){
|
248 |
if(body!=null && !body.isEmpty()){
|
| 249 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
249 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
| 250 |
}
|
250 |
}
|
| - |
|
251 |
|
| - |
|
252 |
if(cashAmount + cardAmount > order.getAdvanceAmount()) {
|
| - |
|
253 |
log.error("Could not mark order for Cancellation, OrderId : " + orderId);
|
| - |
|
254 |
return "index";
|
| - |
|
255 |
}
|
| - |
|
256 |
|
| - |
|
257 |
transactionServiceClient.getClient().saveRefundAmountsForStoreOrder(orderId, order.getStoreId(), cashAmount, cardAmount);
|
| 251 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
258 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
| 252 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
259 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
| 253 |
transactionServiceClient.getClient().markOrderCancellationRequestConfirmed(orderId);
|
260 |
transactionServiceClient.getClient().markOrderCancellationRequestConfirmed(orderId);
|
| 254 |
}
|
261 |
}
|
| 255 |
transactionServiceClient.getClient().saveRefundAmountsForStoreOrder(orderId, order.getStoreId(), cashAmount, cardAmount);
|
- |
|
| 256 |
transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
|
262 |
transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
|
| 257 |
} else {
|
263 |
} else {
|
| 258 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
264 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
| 259 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
265 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
| 260 |
long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
|
266 |
long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
|