op listen summenbildung

This commit is contained in:
Ralph Soika 2024-11-24 15:14:32 +01:00
parent aabb7ab04d
commit 2e66c68e40
2 changed files with 16 additions and 5 deletions

View file

@ -201,13 +201,20 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
private void addCurrencyColumns(XSSFWorkbook doc, XSSFSheet sheet, List<String> currencyList,
List<ItemCollection> spaces) {
// zusaetzliche spalten einfuegen...
int newColumns = (currencyList.size() * spaces.size()) - 0;
// zusaetzliche Abteilungs spalten einfuegen...
int newColumns = (currencyList.size() * (spaces.size())) - 1;
for (int i = 0; i < newColumns; i++) {
logger.fine(".. add currency column...");
POIUtil.insertColumn(sheet, 1, 2 + i);
}
// Total spalten einfuegen
for (int i = 0; i < currencyList.size() - 1; i++) {
logger.fine(".. add total column...");
POIUtil.insertColumn(sheet, 2 + newColumns, 3 + newColumns + i);
}
newColumns = newColumns + currencyList.size();
// Beschriftungen eintragen
int col = 1;
XSSFCell cell = null;
@ -226,6 +233,11 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
}
// Add the total column
spaceRow.getCell(col).setCellValue("Total");
for (String currency : currencyList) {
cell = currencyRow.getCell(col);
cell.setCellValue(currency);
col++;
}
}
/**
@ -533,11 +545,10 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
// totalCell.setCellValue(totalsUeberfaelligCurrency2.get("TOTAL") +
// totalsFaelligCurrency2.get("TOTAL"));
// delete placeholder row
// delete placeholder rows
sheet.shiftRows(_rowNo, _rowNo + 3, -1);
sheet.shiftRows(_rowNo - 1, _rowNo - 1 + 3, -1);
logger.finest("......invoices added");
}
/**

Binary file not shown.