Subversion Repositories SmartDukaan

Rev

Rev 33437 | Rev 33696 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33437 Rev 33687
Line 1552... Line 1552...
1552
        } else {
1552
        } else {
1553
            float totalAmount = 0;
1553
            float totalAmount = 0;
1554
            // referense id = transaction id
1554
            // referense id = transaction id
1555
            // here refund the amount of an order
1555
            // here refund the amount of an order
1556
            List<UserWalletHistory> uwhList = walletService.getAllByReference(retailerId, transactionId, WalletReferenceType.PURCHASE);
1556
            List<UserWalletHistory> uwhList = walletService.getAllByReference(retailerId, transactionId, WalletReferenceType.PURCHASE);
1557
            // Do is negative so that add amount in wallet
1557
            //Refund only if any amount is deducted from wallet for that particular Transaction
-
 
1558
            if(uwhList.size() > 0) {
1558
            totalAmount = -uwhList.get(0).getAmount();
1559
                totalAmount = -uwhList.get(0).getAmount();
1559
            walletService.refundToWallet(retailerId, totalAmount, transactionId, WalletReferenceType.PURCHASE, "Order canceled");
1560
                walletService.refundToWallet(retailerId, totalAmount, transactionId, WalletReferenceType.PURCHASE, "Order canceled");
-
 
1561
            }
1560
        }
1562
        }
1561
    }
1563
    }
1562
 
1564
 
1563
    @RequestMapping(value = "/bulkOrderTemplate", method = RequestMethod.GET)
1565
    @RequestMapping(value = "/bulkOrderTemplate", method = RequestMethod.GET)
1564
    public ResponseEntity<?> bulkOrderTemplate() throws Exception {
1566
    public ResponseEntity<?> bulkOrderTemplate() throws Exception {