op liste completed
This commit is contained in:
parent
20c3410489
commit
ca2e72bc37
1 changed files with 22 additions and 125 deletions
|
|
@ -174,7 +174,6 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally process POI instructions
|
// Finally process POI instructions
|
||||||
processPOIUpdate(document, event, targetName);
|
processPOIUpdate(document, event, targetName);
|
||||||
|
|
||||||
|
|
@ -273,8 +272,6 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
XSSFRow referenceRowValues = sheet.getRow(11);
|
XSSFRow referenceRowValues = sheet.getRow(11);
|
||||||
XSSFRow referenceRowCurrentWeek = sheet.getRow(12);
|
XSSFRow referenceRowCurrentWeek = sheet.getRow(12);
|
||||||
|
|
||||||
XSSFRow referenceRowTotal = sheet.getRow(15);
|
|
||||||
|
|
||||||
// Aktuelle KW berechnen
|
// Aktuelle KW berechnen
|
||||||
Calendar calendar = new GregorianCalendar();
|
Calendar calendar = new GregorianCalendar();
|
||||||
calendar.setTime(new Date());
|
calendar.setTime(new Date());
|
||||||
|
|
@ -310,36 +307,6 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
totalDataMapFaellig.put("TOTAL", new TotalInvoiceData("TOTAL"));
|
totalDataMapFaellig.put("TOTAL", new TotalInvoiceData("TOTAL"));
|
||||||
totalDataMapUeberFaellig.put("TOTAL", new TotalInvoiceData("TOTAL"));
|
totalDataMapUeberFaellig.put("TOTAL", new TotalInvoiceData("TOTAL"));
|
||||||
|
|
||||||
/*
|
|
||||||
* --- Phase 2 -------------------------------------------------------
|
|
||||||
* Nun bilden wir nochmal 2 weitere Spalten am Ende um eine Summenbildung in
|
|
||||||
* EUR/USD pro KW zu ermöglichen
|
|
||||||
*/
|
|
||||||
// XSSFCell cell = null;
|
|
||||||
// column++;
|
|
||||||
// // Space currency EUR
|
|
||||||
// cell = referenceRowSpacesCurrencies.getCell(column,
|
|
||||||
// MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
|
||||||
// cell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// cell.setCellValue(currency1);
|
|
||||||
// cell = rowSpacesLabels.getCell(column,
|
|
||||||
// MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
|
||||||
// cell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// cell.setCellValue("");
|
|
||||||
|
|
||||||
// Space currency USD
|
|
||||||
// column++;
|
|
||||||
// cell = referenceRowSpacesCurrencies.getCell(column,
|
|
||||||
// MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
|
||||||
// cell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// cell.setCellValue(currency2);
|
|
||||||
|
|
||||||
// // Space Label
|
|
||||||
// cell = rowSpacesLabels.getCell(column,
|
|
||||||
// MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
|
||||||
// cell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// cell.setCellValue("Total");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* --- Phase 3 -------------------------------------------------------
|
* --- Phase 3 -------------------------------------------------------
|
||||||
* now build a new row for each week and print out the collected invoice data
|
* now build a new row for each week and print out the collected invoice data
|
||||||
|
|
@ -391,8 +358,6 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
// iterate over all spaceNames and test if we have any data to put it into the
|
// iterate over all spaceNames and test if we have any data to put it into the
|
||||||
// row cells....
|
// row cells....
|
||||||
column = 1;
|
column = 1;
|
||||||
double kwTotalEUR = 0;
|
|
||||||
double kwTotalUSD = 0;
|
|
||||||
WeekInvoiceData weekDataTotal = weekDataMap.get("TOTAL/" + week);
|
WeekInvoiceData weekDataTotal = weekDataMap.get("TOTAL/" + week);
|
||||||
for (String name : spaceNames) {
|
for (String name : spaceNames) {
|
||||||
String key = name + "/" + week;
|
String key = name + "/" + week;
|
||||||
|
|
@ -416,36 +381,9 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
totalDataMapFaellig.get(name).add(betrag, currency);
|
totalDataMapFaellig.get(name).add(betrag, currency);
|
||||||
}
|
}
|
||||||
weekDataTotal.add(betrag, currency);
|
weekDataTotal.add(betrag, currency);
|
||||||
|
|
||||||
column++;
|
column++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// row.getCell(column).setCellValue(weekData.totalCurrency1);
|
|
||||||
// column++;
|
|
||||||
// row.getCell(column).setCellValue(weekData.totalCurrency2);
|
|
||||||
// if (ueberFaellig) {
|
|
||||||
// double eur = totalsUeberfaelligCurrency1.get(name);
|
|
||||||
// eur = InvoiceUtil.round(eur + weekData.totalCurrency1);
|
|
||||||
// totalsUeberfaelligCurrency1.put(name, eur);
|
|
||||||
// double usd = totalsUeberfaelligCurrency2.get(name);
|
|
||||||
// usd = InvoiceUtil.round(usd + weekData.totalCurrency2);
|
|
||||||
// totalsUeberfaelligCurrency2.put(name, usd);
|
|
||||||
// // saldoEUR1 = InvoiceUtil.round(saldoEUR1 + weekData.totalEUR);
|
|
||||||
// // saldoUSD1 = InvoiceUtil.round(saldoUSD1 + weekData.totalUSD);
|
|
||||||
// } else {
|
|
||||||
// double eur = totalsFaelligCurrency1.get(name);
|
|
||||||
// eur = InvoiceUtil.round(eur + weekData.totalCurrency1);
|
|
||||||
// totalsFaelligCurrency1.put(name, eur);
|
|
||||||
// double usd = totalsFaelligCurrency2.get(name);
|
|
||||||
// usd = InvoiceUtil.round(usd + weekData.totalCurrency2);
|
|
||||||
// totalsFaelligCurrency2.put(name, usd);
|
|
||||||
// // saldoEUR2 = InvoiceUtil.round(saldoEUR2 + weekData.totalEUR);
|
|
||||||
// // saldoUSD2 = InvoiceUtil.round(saldoUSD2 + weekData.totalUSD);
|
|
||||||
// }
|
|
||||||
// kwTotalEUR = kwTotalEUR + weekData.totalCurrency1;
|
|
||||||
// kwTotalUSD = kwTotalUSD + weekData.totalCurrency2;
|
|
||||||
// column++;
|
|
||||||
} else {
|
} else {
|
||||||
logger.info("...... NOT FOUND");
|
logger.info("...... NOT FOUND");
|
||||||
// skip columns
|
// skip columns
|
||||||
|
|
@ -455,58 +393,12 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// KW Summe anzeigen
|
// KW Summe anzeigen
|
||||||
|
|
||||||
for (String currency : currencyList) {
|
for (String currency : currencyList) {
|
||||||
row.getCell(column).setCellValue(weekDataTotal.getTotal(currency));
|
row.getCell(column).setCellValue(weekDataTotal.getTotal(currency));
|
||||||
column++;
|
column++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (week.equals(currentWeekCategory)) {
|
|
||||||
// XSSFCell kwTotalCell = row.getCell(column);
|
|
||||||
// // kwTotalCell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// kwTotalCell.setCellValue(kwTotalEUR);
|
|
||||||
|
|
||||||
// column++;
|
|
||||||
// // row.getCell(column).setCellValue(kwTotalUSD);
|
|
||||||
// kwTotalCell = row.getCell(column);
|
|
||||||
// // kwTotalCell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// kwTotalCell.setCellValue(kwTotalUSD);
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// XSSFCell kwTotalCell = row.getCell(column);
|
|
||||||
// kwTotalCell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// kwTotalCell.setCellValue(kwTotalEUR);
|
|
||||||
|
|
||||||
// column++;
|
|
||||||
// // row.getCell(column).setCellValue(kwTotalUSD);
|
|
||||||
// kwTotalCell = row.getCell(column);
|
|
||||||
// kwTotalCell.copyCellFrom(cellKWTotalReference, new CellCopyPolicy());
|
|
||||||
// kwTotalCell.setCellValue(kwTotalUSD);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// store totals
|
|
||||||
// if (ueberFaellig) {
|
|
||||||
// double eur = totalsUeberfaelligCurrency1.get("TOTAL");
|
|
||||||
// eur = InvoiceUtil.round(eur + kwTotalEUR);
|
|
||||||
// totalsUeberfaelligCurrency1.put("TOTAL", eur);
|
|
||||||
// double usd = totalsUeberfaelligCurrency2.get("TOTAL");
|
|
||||||
// usd = InvoiceUtil.round(usd + kwTotalUSD);
|
|
||||||
// totalsUeberfaelligCurrency2.put("TOTAL", usd);
|
|
||||||
// } else {
|
|
||||||
// double eur = totalsFaelligCurrency1.get("TOTAL");
|
|
||||||
// eur = InvoiceUtil.round(eur + kwTotalEUR);
|
|
||||||
// totalsFaelligCurrency1.put("TOTAL", eur);
|
|
||||||
// double usd = totalsFaelligCurrency2.get("TOTAL");
|
|
||||||
// usd = InvoiceUtil.round(usd + kwTotalUSD);
|
|
||||||
// totalsFaelligCurrency2.put("TOTAL", usd);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// delete reference rows
|
|
||||||
// logger.info("..shift 12 to " + rowPos);
|
|
||||||
// sheet.shiftRows(12, rowPos, -1, true, true);
|
|
||||||
// sheet.shiftRows(rowPos + 2, rowPos + 6, -3, true, true);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* --- Phase 6 -------------------------------------------------------
|
* --- Phase 6 -------------------------------------------------------
|
||||||
|
|
@ -519,6 +411,11 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
XSSFRow rowTotal = sheet.getRow(_rowNo + 2);
|
XSSFRow rowTotal = sheet.getRow(_rowNo + 2);
|
||||||
column = 1;
|
column = 1;
|
||||||
XSSFCell totalCell = null;
|
XSSFCell totalCell = null;
|
||||||
|
|
||||||
|
WeekInvoiceData superTotalUeberfaellig = new WeekInvoiceData("SUPERTOTAL", "0");
|
||||||
|
WeekInvoiceData superTotalFaellig = new WeekInvoiceData("SUPERTOTAL", "0");
|
||||||
|
WeekInvoiceData superTotalSuper = new WeekInvoiceData("SUPERTOTAL", "0");
|
||||||
|
|
||||||
for (String name : spaceNames) {
|
for (String name : spaceNames) {
|
||||||
|
|
||||||
TotalInvoiceData totalDataUeberFaellig = totalDataMapUeberFaellig.get(name);
|
TotalInvoiceData totalDataUeberFaellig = totalDataMapUeberFaellig.get(name);
|
||||||
|
|
@ -527,34 +424,34 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
// überfällig
|
// überfällig
|
||||||
totalCell = rowUeberFaellig.getCell(column);
|
totalCell = rowUeberFaellig.getCell(column);
|
||||||
totalCell.setCellValue(totalDataUeberFaellig.getTotal(currency));
|
totalCell.setCellValue(totalDataUeberFaellig.getTotal(currency));
|
||||||
|
superTotalUeberfaellig.add(totalDataUeberFaellig.getTotal(currency), currency);
|
||||||
|
|
||||||
// noch nicht fällig
|
// noch nicht fällig
|
||||||
totalCell = rowFaellig.getCell(column);
|
totalCell = rowFaellig.getCell(column);
|
||||||
totalCell.setCellValue(totalDataFaellig.getTotal(currency));
|
totalCell.setCellValue(totalDataFaellig.getTotal(currency));
|
||||||
|
superTotalFaellig.add(totalDataFaellig.getTotal(currency), currency);
|
||||||
|
|
||||||
// total...
|
// total...
|
||||||
totalCell = rowTotal.getCell(column);
|
totalCell = rowTotal.getCell(column);
|
||||||
totalCell.setCellValue(InvoiceUtil
|
totalCell.setCellValue(InvoiceUtil
|
||||||
.round(totalDataUeberFaellig.getTotal(currency) + totalDataFaellig.getTotal(currency)));
|
.round(totalDataUeberFaellig.getTotal(currency) + totalDataFaellig.getTotal(currency)));
|
||||||
|
superTotalSuper.add(totalDataUeberFaellig.getTotal(currency) + totalDataFaellig.getTotal(currency),
|
||||||
|
currency);
|
||||||
column++;
|
column++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// // totals
|
// Fill Super Totals
|
||||||
// totalCell = rowUeberFaellig.getCell(column);
|
|
||||||
// totalCell.setCellValue(totalsUeberfaellig.get("TOTAL"));
|
for (String currency : currencyList) {
|
||||||
// totalCell = rowFaellig.getCell(column);
|
totalCell = rowUeberFaellig.getCell(column);
|
||||||
// totalCell.setCellValue(totalsFaelligCurrency1.get("TOTAL"));
|
totalCell.setCellValue(superTotalUeberfaellig.getTotal(currency));
|
||||||
// totalCell = rowTotal.getCell(column);
|
totalCell = rowFaellig.getCell(column);
|
||||||
// totalCell.setCellValue(totalsUeberfaelligCurrency1.get("TOTAL") +
|
totalCell.setCellValue(superTotalFaellig.getTotal(currency));
|
||||||
// totalsFaelligCurrency1.get("TOTAL"));
|
totalCell = rowTotal.getCell(column);
|
||||||
// column++;
|
totalCell.setCellValue(superTotalSuper.getTotal(currency));
|
||||||
// totalCell = rowUeberFaellig.getCell(column);
|
column++;
|
||||||
// totalCell.setCellValue(totalsUeberfaelligCurrency2.get("TOTAL"));
|
}
|
||||||
// totalCell = rowFaellig.getCell(column);
|
|
||||||
// totalCell.setCellValue(totalsFaelligCurrency2.get("TOTAL"));
|
|
||||||
// totalCell = rowTotal.getCell(column);
|
|
||||||
// totalCell.setCellValue(totalsUeberfaelligCurrency2.get("TOTAL") +
|
|
||||||
// totalsFaelligCurrency2.get("TOTAL"));
|
|
||||||
|
|
||||||
// delete placeholder rows (Never change these lines)
|
// delete placeholder rows (Never change these lines)
|
||||||
sheet.shiftRows(_rowNo, _rowNo + 3, -1);
|
sheet.shiftRows(_rowNo, _rowNo + 3, -1);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue