diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListExportAdapterByWeek.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListExportAdapterByWeek.java index 729ab18..7d4bf37 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListExportAdapterByWeek.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListExportAdapterByWeek.java @@ -201,13 +201,20 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter { private void addCurrencyColumns(XSSFWorkbook doc, XSSFSheet sheet, List currencyList, List 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"); - } /** diff --git a/templates/op-liste_kw_template.xlsx b/templates/op-liste_kw_template.xlsx index 1d54b99..6ba86b2 100644 Binary files a/templates/op-liste_kw_template.xlsx and b/templates/op-liste_kw_template.xlsx differ