Subversion Repositories SmartDukaan

Rev

Rev 25084 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25084 Rev 25555
Line 45... Line 45...
45
	      header.createCell(1).setCellValue("Transact Type");
45
	      header.createCell(1).setCellValue("Transact Type");
46
	      header.createCell(2).setCellValue("Transact Reference");
46
	      header.createCell(2).setCellValue("Transact Reference");
47
	      header.createCell(3).setCellValue("Transact Description");
47
	      header.createCell(3).setCellValue("Transact Description");
48
	      header.createCell(4).setCellValue("Amount Dr");
48
	      header.createCell(4).setCellValue("Amount Dr");
49
	      header.createCell(5).setCellValue("Amount Cr");
49
	      header.createCell(5).setCellValue("Amount Cr");
50
	      //header.createCell(6).setCellValue("Balance");
50
	      header.createCell(6).setCellValue("Balance");
51
	      int calculatedClosing = 0;
51
	      int calculatedClosing = 0;
52
	      for (UserWalletHistory walletEntry : history) {
52
	      for (UserWalletHistory walletEntry : history) {
53
	          Row walletEntryRow = sheet.createRow(rowCount++);
53
	          Row walletEntryRow = sheet.createRow(rowCount++);
54
	          walletEntryRow.createCell(0).setCellValue(walletEntry.getFormattedDate());
54
	          walletEntryRow.createCell(0).setCellValue(walletEntry.getFormattedDate());
55
	          if(walletEntry.getReferenceType()==null) {
55
	          if(walletEntry.getReferenceType()==null) {
Line 67... Line 67...
67
	          } else if (walletEntry.getAmount() > 0) {
67
	          } else if (walletEntry.getAmount() > 0) {
68
	        	  walletEntryRow.createCell(4).setCellValue("");
68
	        	  walletEntryRow.createCell(4).setCellValue("");
69
	        	  walletEntryRow.createCell(5).setCellValue(walletEntry.getAmount());
69
	        	  walletEntryRow.createCell(5).setCellValue(walletEntry.getAmount());
70
	          }
70
	          }
71
	          calculatedClosing = calculatedClosing + walletEntry.getAmount();
71
	          calculatedClosing = calculatedClosing + walletEntry.getAmount();
72
	          //walletEntryRow.createCell(6).setCellValue(calculatedClosing);
72
	          walletEntryRow.createCell(6).setCellValue(calculatedClosing);
73
	      }
73
	      }
74
	      String fileName = "wallet-" + FormattingUtils.formatDate(startDate) + " " + FormattingUtils.formatDate(endDate) + ".xlsx";
74
	      String fileName = "wallet-" + FormattingUtils.formatDate(startDate) + " " + FormattingUtils.formatDate(endDate) + ".xlsx";
75
	      response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
75
	      response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
76
 
76
 
77
	}
77
	}