Subversion Repositories SmartDukaan

Rev

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

Rev 28538 Rev 28540
Line 703... Line 703...
703
		sheet.getRow(2).getCell(2).setCellValue(openingBalance);
703
		sheet.getRow(2).getCell(2).setCellValue(openingBalance);
704
		long grandTotalDebit = 0l;
704
		long grandTotalDebit = 0l;
705
		long grandTotalCredit = 0l;
705
		long grandTotalCredit = 0l;
706
		int row = 4;
706
		int row = 4;
707
		for (UserWalletHistory walletEntry : history) {
707
		for (UserWalletHistory walletEntry : history) {
-
 
708
			Cell dateCell = sheet.getRow(row).createCell(0);
-
 
709
			dateCell.setCellValue(new Date(walletEntry.getTimestamp().atZone( ZoneId.systemDefault()).toInstant().toEpochMilli()));
-
 
710
			dateCell.setCellStyle(style2);
708
			sheet.createRow(row).createCell(0).setCellValue(walletEntry.getReferenceType().toString());
711
			sheet.createRow(row).createCell(1).setCellValue(walletEntry.getReferenceType().toString());
709
			if(walletEntry.getAmount() > 0) {
712
			if(walletEntry.getAmount() > 0) {
710
				sheet.getRow(row).createCell(1).setCellValue(0);
713
				sheet.getRow(row).createCell(2).setCellValue(0);
711
				sheet.getRow(row).createCell(2).setCellValue(walletEntry.getAmount());
714
				sheet.getRow(row).createCell(3).setCellValue(walletEntry.getAmount());
712
				grandTotalCredit += walletEntry.getAmount();
715
				grandTotalCredit += walletEntry.getAmount();
713
			} else {
716
			} else {
714
				sheet.getRow(row).createCell(1).setCellValue(walletEntry.getAmount());
717
				sheet.getRow(row).createCell(2).setCellValue(walletEntry.getAmount());
715
				sheet.getRow(row).createCell(2).setCellValue(0);
718
				sheet.getRow(row).createCell(3).setCellValue(0);
716
				grandTotalDebit += walletEntry.getAmount();
719
				grandTotalDebit += walletEntry.getAmount();
717
			}
720
			}
718
			Cell dateCell = sheet.getRow(row).createCell(3);
-
 
719
			dateCell.setCellValue(new Date(walletEntry.getTimestamp().atZone( ZoneId.systemDefault()).toInstant().toEpochMilli()));
-
 
720
			dateCell.setCellStyle(style2);
-
 
721
			sheet.getRow(row).createCell(3).setCellValue(walletEntry.getDescription());
721
			sheet.getRow(row).createCell(4).setCellValue(walletEntry.getDescription());
722
			sheet.getRow(row).createCell(3).setCellValue(walletEntry.getReference());
722
			sheet.getRow(row).createCell(5).setCellValue(walletEntry.getReference());
723
			row++;
723
			row++;
724
		}
724
		}
725
		for (StatementDetailModel statementDetailModel : invoiceDetails) {
725
		for (StatementDetailModel statementDetailModel : invoiceDetails) {
-
 
726
			Cell dateCell = sheet.getRow(row).createCell(3);
-
 
727
			dateCell.setCellValue(statementDetailModel.getOnDate());
-
 
728
			dateCell.setCellStyle(style2);
726
			sheet.createRow(row).createCell(0).setCellValue("BILLING");
729
			sheet.createRow(row).createCell(1).setCellValue("BILLING");
727
			if (statementDetailModel.getAmount() > 0) {
730
			if (statementDetailModel.getAmount() > 0) {
728
				sheet.getRow(row).createCell(1).setCellValue(statementDetailModel.getAmount());
731
				sheet.getRow(row).createCell(2).setCellValue(statementDetailModel.getAmount());
729
				sheet.getRow(row).createCell(2).setCellValue(0);
732
				sheet.getRow(row).createCell(3).setCellValue(0);
730
				grandTotalDebit += statementDetailModel.getAmount(); 
733
				grandTotalDebit += statementDetailModel.getAmount(); 
731
			} else {
734
			} else {
732
				sheet.getRow(row).createCell(1).setCellValue(0);
735
				sheet.getRow(row).createCell(2).setCellValue(0);
733
				sheet.getRow(row).createCell(2).setCellValue(-statementDetailModel.getAmount());
736
				sheet.getRow(row).createCell(3).setCellValue(-statementDetailModel.getAmount());
734
				grandTotalCredit += -statementDetailModel.getAmount(); 
737
				grandTotalCredit += -statementDetailModel.getAmount(); 
735
			}
738
			}
736
			Cell dateCell = sheet.getRow(row).createCell(3);
-
 
737
			dateCell.setCellValue(statementDetailModel.getOnDate());
-
 
738
			dateCell.setCellStyle(style2);
-
 
739
			
739
			
740
			sheet.getRow(row).createCell(4).setCellValue(statementDetailModel.getReferenceType());
740
			sheet.getRow(row).createCell(4).setCellValue(statementDetailModel.getReferenceType());
741
			sheet.getRow(row).createCell(5).setCellValue(statementDetailModel.getInvoiceNumber());
741
			sheet.getRow(row).createCell(5).setCellValue(statementDetailModel.getInvoiceNumber());
742
			
742
			
743
 
743