| Line 342... |
Line 342... |
| 342 |
}
|
342 |
}
|
| 343 |
} catch (Exception e) {
|
343 |
} catch (Exception e) {
|
| 344 |
System.out.println(e.getMessage());
|
344 |
System.out.println(e.getMessage());
|
| 345 |
}
|
345 |
}
|
| 346 |
response.setContentType("application/pdf");
|
346 |
response.setContentType("application/pdf");
|
| 347 |
response.setHeader("Content-disposition", "attachment; filename=advance-invoice-" + number.toString() + ".pdf");
|
347 |
response.setHeader("Content-disposition", "attachment; filename=receipt-" + number.toString() + ".pdf");
|
| 348 |
|
348 |
|
| 349 |
ServletOutputStream sos;
|
349 |
ServletOutputStream sos;
|
| 350 |
try {
|
350 |
try {
|
| 351 |
sos = response.getOutputStream();
|
351 |
sos = response.getOutputStream();
|
| 352 |
sos.write(buffer.array());
|
352 |
sos.write(buffer.array());
|
| Line 408... |
Line 408... |
| 408 |
try{
|
408 |
try{
|
| 409 |
TransactionClient tcl = new TransactionClient();
|
409 |
TransactionClient tcl = new TransactionClient();
|
| 410 |
long storeId = Long.parseLong((String) request.getSession().getAttribute("STORE_ID"));
|
410 |
long storeId = Long.parseLong((String) request.getSession().getAttribute("STORE_ID"));
|
| 411 |
StoreOrderDetail sod = tcl.getClient().getStoreOrderDetail(orderId, storeId);
|
411 |
StoreOrderDetail sod = tcl.getClient().getStoreOrderDetail(orderId, storeId);
|
| 412 |
tcl.getClient().saveRefundAmountsForStoreOrder(orderId, storeId, sod.getCashAmount(), sod.getCardAmount());
|
412 |
tcl.getClient().saveRefundAmountsForStoreOrder(orderId, storeId, sod.getCashAmount(), sod.getCardAmount());
|
| - |
|
413 |
tcl.getClient().markOrderCancellationRequestReceived(orderId);
|
| - |
|
414 |
tcl.getClient().markOrderCancellationRequestConfirmed(orderId);
|
| 413 |
tcl.getClient().refundOrder(orderId, "Store", "User requested for cancellation");
|
415 |
tcl.getClient().refundOrder(orderId, "Store", "User requested for cancellation");
|
| 414 |
} catch (Exception e) {
|
416 |
} catch (Exception e) {
|
| 415 |
logger.error("Could not mark order as cancellation requested for id : " + orderId.toString(), e);
|
417 |
logger.error("Could not mark order as cancellation requested for id : " + orderId.toString(), e);
|
| 416 |
setSearchError("Request failed. Try again or call customer care.");
|
418 |
setSearchError("Request failed. Try again or call customer care.");
|
| 417 |
}
|
419 |
}
|