| Line 758... |
Line 758... |
| 758 |
|
758 |
|
| 759 |
SXSSFSheet sheet = workbook.createSheet("DailySaleReports");
|
759 |
SXSSFSheet sheet = workbook.createSheet("DailySaleReports");
|
| 760 |
sheet.trackAllColumnsForAutoSizing();
|
760 |
sheet.trackAllColumnsForAutoSizing();
|
| 761 |
|
761 |
|
| 762 |
Row rowHeader = sheet.createRow(0);
|
762 |
Row rowHeader = sheet.createRow(0);
|
| 763 |
Cell cellsaleHead = rowHeader.createCell(0);
|
763 |
Cell cellBusiness = rowHeader.createCell(0);
|
| 764 |
cellsaleHead.setCellValue("SalesHead");
|
764 |
cellBusiness.setCellValue("Business Manager");
|
| - |
|
765 |
Cell cellAssistant = rowHeader.createCell(1);
|
| - |
|
766 |
cellAssistant.setCellValue("Assistant Manager");
|
| 765 |
Cell cellFOfoId = rowHeader.createCell(1);
|
767 |
Cell cellFOfoId = rowHeader.createCell(2);
|
| 766 |
cellFOfoId.setCellValue("FoFoId");
|
768 |
cellFOfoId.setCellValue("FoFoId");
|
| 767 |
Cell cellStoreName = rowHeader.createCell(2);
|
769 |
Cell cellStoreName = rowHeader.createCell(3);
|
| 768 |
cellStoreName.setCellValue("Store Name");
|
770 |
cellStoreName.setCellValue("Store Name");
|
| 769 |
Cell cellTargetValue = rowHeader.createCell(3);
|
771 |
Cell cellTargetValue = rowHeader.createCell(4);
|
| 770 |
cellTargetValue.setCellValue("MTD Target Value");
|
772 |
cellTargetValue.setCellValue("MTD Target Value");
|
| 771 |
Cell cellDailyTarget = rowHeader.createCell(4);
|
773 |
Cell cellDailyTarget = rowHeader.createCell(5);
|
| 772 |
cellDailyTarget.setCellValue("Daily Target");
|
774 |
cellDailyTarget.setCellValue("Daily Target");
|
| 773 |
Cell cellTodayAchievement = rowHeader.createCell(5);
|
775 |
Cell cellTodayAchievement = rowHeader.createCell(6);
|
| 774 |
cellTodayAchievement.setCellValue("Today Achievement");
|
776 |
cellTodayAchievement.setCellValue("Today Achievement");
|
| 775 |
Cell cellTodayAchievementPercentage = rowHeader.createCell(6);
|
777 |
Cell cellTodayAchievementPercentage = rowHeader.createCell(7);
|
| 776 |
cellTodayAchievementPercentage.setCellValue("Today Achievement %");
|
778 |
cellTodayAchievementPercentage.setCellValue("Today Achievement %");
|
| 777 |
Cell cellMonthlySaleValue = rowHeader.createCell(7);
|
779 |
Cell cellMonthlySaleValue = rowHeader.createCell(8);
|
| 778 |
cellMonthlySaleValue.setCellValue("MTD Achievement");
|
780 |
cellMonthlySaleValue.setCellValue("MTD Achievement");
|
| 779 |
Cell cellMonthlySaleValuePercentage = rowHeader.createCell(8);
|
781 |
Cell cellMonthlySaleValuePercentage = rowHeader.createCell(9);
|
| 780 |
cellMonthlySaleValuePercentage.setCellValue("MTD Achievement%");
|
782 |
cellMonthlySaleValuePercentage.setCellValue("MTD Achievement%");
|
| 781 |
Cell cellRemainingTarget = rowHeader.createCell(9);
|
783 |
Cell cellRemainingTarget = rowHeader.createCell(10);
|
| 782 |
cellRemainingTarget.setCellValue("Remaining");
|
784 |
cellRemainingTarget.setCellValue("Remaining");
|
| 783 |
Cell cellEligibility = rowHeader.createCell(10);
|
785 |
Cell cellEligibility = rowHeader.createCell(11);
|
| 784 |
cellEligibility.setCellValue("Eligibility");
|
786 |
cellEligibility.setCellValue("Eligibility");
|
| 785 |
Font font = workbook.createFont();
|
787 |
Font font = workbook.createFont();
|
| 786 |
CellStyle cellStyle = workbook.createCellStyle();
|
788 |
CellStyle cellStyle = workbook.createCellStyle();
|
| 787 |
font.setBold(true);
|
789 |
font.setBold(true);
|
| 788 |
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
790 |
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
| Line 795... |
Line 797... |
| 795 |
}
|
797 |
}
|
| 796 |
int rownum = 1;
|
798 |
int rownum = 1;
|
| 797 |
for (Integer fofoId : fofoIds) {
|
799 |
for (Integer fofoId : fofoIds) {
|
| 798 |
Row row = sheet.createRow(rownum++);
|
800 |
Row row = sheet.createRow(rownum++);
|
| 799 |
int cellnum = 0;
|
801 |
int cellnum = 0;
|
| 800 |
Cell cellSaleName = row.createCell(cellnum++);
|
802 |
Cell cellBusinessManager = row.createCell(cellnum++);
|
| 801 |
if (salesHeadNameAndFofoIdMap.get(fofoId) != null) {
|
803 |
if (salesHeadNameAndFofoIdMap.get(fofoId) != null) {
|
| - |
|
804 |
if (salesHeadNameAndFofoIdMap.get(fofoId).equals("Kamal")) {
|
| - |
|
805 |
cellBusinessManager.setCellValue("Mohinder");
|
| - |
|
806 |
} else {
|
| - |
|
807 |
cellBusinessManager.setCellValue(salesHeadNameAndFofoIdMap.get(fofoId));
|
| - |
|
808 |
}
|
| - |
|
809 |
} else {
|
| - |
|
810 |
cellBusinessManager.setCellValue("-");
|
| 802 |
|
811 |
}
|
| - |
|
812 |
Cell cellAssistantManager = row.createCell(cellnum++);
|
| - |
|
813 |
if (salesHeadNameAndFofoIdMap.get(fofoId) != null) {
|
| - |
|
814 |
if (salesHeadNameAndFofoIdMap.get(fofoId).equals("Kamal")) {
|
| 803 |
cellSaleName.setCellValue(salesHeadNameAndFofoIdMap.get(fofoId));
|
815 |
cellAssistantManager.setCellValue(salesHeadNameAndFofoIdMap.get(fofoId));
|
| - |
|
816 |
} else {
|
| - |
|
817 |
cellAssistantManager.setCellValue("");
|
| - |
|
818 |
}
|
| 804 |
} else {
|
819 |
} else {
|
| 805 |
cellSaleName.setCellValue("No SalesHead");
|
820 |
cellAssistantManager.setCellValue("");
|
| 806 |
}
|
821 |
}
|
| 807 |
Cell cellFofoId = row.createCell(cellnum++);
|
822 |
Cell cellFofoId = row.createCell(cellnum++);
|
| 808 |
cellFofoId.setCellValue(fofoId);
|
823 |
cellFofoId.setCellValue(fofoId);
|
| 809 |
Cell cellPartner = row.createCell(cellnum++);
|
824 |
Cell cellPartner = row.createCell(cellnum++);
|
| 810 |
if (fofoIdsAndCustomRetailer.get(fofoId) != null) {
|
825 |
if (fofoIdsAndCustomRetailer.get(fofoId) != null) {
|
| 811 |
cellPartner.setCellValue(fofoIdsAndCustomRetailer.get(fofoId).getBusinessName());
|
826 |
cellPartner.setCellValue(fofoIdsAndCustomRetailer.get(fofoId).getBusinessName());
|
| 812 |
} else {
|
827 |
} else {
|
| 813 |
cellPartner.setCellValue("Name Not Associated");
|
828 |
cellPartner.setCellValue("-");
|
| 814 |
}
|
829 |
}
|
| 815 |
|
830 |
|
| 816 |
Cell cellMTDTargetValue = row.createCell(cellnum++);
|
831 |
Cell cellMTDTargetValue = row.createCell(cellnum++);
|
| 817 |
if (targetValues.get(fofoId) != null) {
|
832 |
if (targetValues.get(fofoId) != null) {
|
| 818 |
cellMTDTargetValue.setCellValue(targetValues.get(fofoId));
|
833 |
cellMTDTargetValue.setCellValue(targetValues.get(fofoId));
|
| 819 |
} else {
|
834 |
} else {
|
| 820 |
cellMTDTargetValue.setCellValue("Target not defined");
|
835 |
cellMTDTargetValue.setCellValue("-");
|
| 821 |
}
|
836 |
}
|
| 822 |
|
837 |
|
| 823 |
Cell cellDailyTargetValue = row.createCell(cellnum++);
|
838 |
Cell cellDailyTargetValue = row.createCell(cellnum++);
|
| 824 |
if (dailyAverageSale.get(fofoId) != null) {
|
839 |
if (dailyAverageSale.get(fofoId) != null) {
|
| 825 |
String formatting = FormattingUtils.formatDecimalTwoDigits(dailyAverageSale.get(fofoId));
|
840 |
String formatting = FormattingUtils.formatDecimalTwoDigits(dailyAverageSale.get(fofoId));
|
| Line 842... |
Line 857... |
| 842 |
}
|
857 |
}
|
| 843 |
Cell cellMTDAchievement = row.createCell(cellnum++);
|
858 |
Cell cellMTDAchievement = row.createCell(cellnum++);
|
| 844 |
if (saleValues.get(fofoId) != null) {
|
859 |
if (saleValues.get(fofoId) != null) {
|
| 845 |
cellMTDAchievement.setCellValue(saleValues.get(fofoId));
|
860 |
cellMTDAchievement.setCellValue(saleValues.get(fofoId));
|
| 846 |
} else {
|
861 |
} else {
|
| 847 |
cellMTDAchievement.setCellValue("No sale");
|
862 |
cellMTDAchievement.setCellValue(0);
|
| 848 |
}
|
863 |
}
|
| 849 |
Cell cellMTDAchievementPercentage = row.createCell(cellnum++);
|
864 |
Cell cellMTDAchievementPercentage = row.createCell(cellnum++);
|
| 850 |
if (monthlyTargetAchievementPercentage.get(fofoId) != null) {
|
865 |
if (monthlyTargetAchievementPercentage.get(fofoId) != null) {
|
| 851 |
cellMTDAchievementPercentage.setCellValue(monthlyTargetAchievementPercentage.get(fofoId) + "%");
|
866 |
cellMTDAchievementPercentage.setCellValue(monthlyTargetAchievementPercentage.get(fofoId) + "%");
|
| 852 |
} else {
|
867 |
} else {
|
| Line 855... |
Line 870... |
| 855 |
|
870 |
|
| 856 |
Cell cellRemaining = row.createCell(cellnum++);
|
871 |
Cell cellRemaining = row.createCell(cellnum++);
|
| 857 |
if (remainingMonthlyTargets.get(fofoId) != null) {
|
872 |
if (remainingMonthlyTargets.get(fofoId) != null) {
|
| 858 |
cellRemaining.setCellValue(remainingMonthlyTargets.get(fofoId));
|
873 |
cellRemaining.setCellValue(remainingMonthlyTargets.get(fofoId));
|
| 859 |
} else {
|
874 |
} else {
|
| 860 |
cellRemaining.setCellValue("no target define");
|
875 |
cellRemaining.setCellValue(0);
|
| 861 |
}
|
876 |
}
|
| 862 |
|
877 |
|
| 863 |
Cell cellEligible = row.createCell(cellnum++);
|
878 |
Cell cellEligible = row.createCell(cellnum++);
|
| 864 |
if (fofoIdsAndSlabNames.get(fofoId) != null) {
|
879 |
if (fofoIdsAndSlabNames.get(fofoId) != null) {
|
| 865 |
cellEligible.setCellValue(fofoIdsAndSlabNames.get(fofoId));
|
880 |
cellEligible.setCellValue(fofoIdsAndSlabNames.get(fofoId));
|
| 866 |
} else {
|
881 |
} else {
|
| 867 |
cellEligible.setCellValue("No slab");
|
882 |
cellEligible.setCellValue("-");
|
| 868 |
}
|
883 |
}
|
| 869 |
}
|
884 |
}
|
| 870 |
|
885 |
|
| 871 |
for (int index = 0; index < saleValues.size(); index++) {
|
886 |
for (int index = 0; index < saleValues.size(); index++) {
|
| 872 |
sheet.autoSizeColumn(index);
|
887 |
sheet.autoSizeColumn(index);
|