update op liste
This commit is contained in:
parent
566c32c94a
commit
4d2ce3527a
2 changed files with 39 additions and 14 deletions
|
|
@ -272,6 +272,11 @@ public class OPListExportAdapter extends POIFindReplaceAdapter {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sheet.shiftRows(rowPos, lastRow, totalRowCount, true, true);
|
sheet.shiftRows(rowPos, lastRow, totalRowCount, true, true);
|
||||||
|
|
||||||
|
Map<String, Double> currencyTotalSum = new HashMap();
|
||||||
|
for (String cur : currencyList) {
|
||||||
|
currencyTotalSum.put(cur, Double.valueOf(0));
|
||||||
|
}
|
||||||
// Build a category for each debitor...
|
// Build a category for each debitor...
|
||||||
for (Map.Entry<String, List<ItemCollection>> entry : invoiceMap.entrySet()) {
|
for (Map.Entry<String, List<ItemCollection>> entry : invoiceMap.entrySet()) {
|
||||||
String dbtrNumber = entry.getKey();
|
String dbtrNumber = entry.getKey();
|
||||||
|
|
@ -285,8 +290,23 @@ public class OPListExportAdapter extends POIFindReplaceAdapter {
|
||||||
String debitorName = invoices.get(0).getItemValueString("dbtr.name");
|
String debitorName = invoices.get(0).getItemValueString("dbtr.name");
|
||||||
categoryRow.getCell(1).setCellValue(debitorName);
|
categoryRow.getCell(1).setCellValue(debitorName);
|
||||||
|
|
||||||
categoryRow.getCell(6).setCellValue(42);
|
// calculate summ of all invoices for this debitor...
|
||||||
categoryRow.getCell(8).setCellValue(42);
|
Map<String, Double> currencyCatSum = new HashMap();
|
||||||
|
for (String cur : currencyList) {
|
||||||
|
currencyCatSum.put(cur, Double.valueOf(0));
|
||||||
|
}
|
||||||
|
for (ItemCollection invoice : invoices) {
|
||||||
|
String currency = invoice.getItemValueString("invoice.currency");
|
||||||
|
Double saldo = currencyCatSum.get(currency);
|
||||||
|
saldo = InvoiceUtil.round(saldo + invoice.getItemValueDouble("invoice.saldo"));
|
||||||
|
currencyCatSum.put(currency, saldo);
|
||||||
|
}
|
||||||
|
int i = 0;
|
||||||
|
for (String cur : currencyList) {
|
||||||
|
i++;
|
||||||
|
Double catSum = currencyCatSum.get(cur);
|
||||||
|
categoryRow.getCell(4 + i).setCellValue(catSum);
|
||||||
|
}
|
||||||
|
|
||||||
rowPos++;
|
rowPos++;
|
||||||
|
|
||||||
|
|
@ -324,17 +344,12 @@ public class OPListExportAdapter extends POIFindReplaceAdapter {
|
||||||
// Saldo in richtige Spalte setzen...
|
// Saldo in richtige Spalte setzen...
|
||||||
int currencyColIndex = currencyList.indexOf(currency);
|
int currencyColIndex = currencyList.indexOf(currency);
|
||||||
row.getCell(5 + currencyColIndex).setCellValue(total);
|
row.getCell(5 + currencyColIndex).setCellValue(total);
|
||||||
// if (currency1.equals(currency)) {
|
|
||||||
// // EUR
|
// Gesamtsumme berechnen
|
||||||
// row.getCell(6).setCellValue(total);
|
Double totalSaldo = currencyTotalSum.get(currency);
|
||||||
// row.getCell(7).setCellValue(currency);
|
totalSaldo = InvoiceUtil.round(totalSaldo + total);
|
||||||
// saldo1 = InvoiceUtil.round(saldo1 + total);
|
currencyTotalSum.put(currency, totalSaldo);
|
||||||
// } else {
|
|
||||||
// // USD
|
|
||||||
// row.getCell(8).setCellValue(total);
|
|
||||||
// row.getCell(9).setCellValue(currency);
|
|
||||||
// saldo2 = InvoiceUtil.round(saldo2 + total);
|
|
||||||
// }
|
|
||||||
row.getCell(5 + currencyList.size()).setCellValue(invoice.getItemValueString("$workflowstatus"));
|
row.getCell(5 + currencyList.size()).setCellValue(invoice.getItemValueString("$workflowstatus"));
|
||||||
|
|
||||||
rowPos++;
|
rowPos++;
|
||||||
|
|
@ -345,7 +360,17 @@ public class OPListExportAdapter extends POIFindReplaceAdapter {
|
||||||
rowPos++;
|
rowPos++;
|
||||||
}
|
}
|
||||||
// delete reference row 11
|
// delete reference row 11
|
||||||
sheet.shiftRows(referenceRowPos, lastRow + totalRowCount, -1, true, true);
|
// sheet.shiftRows(referenceRowPos, lastRow + totalRowCount, -3, true, true);
|
||||||
|
// sheet.shiftRows(rowPos, lastRow, -3, true, true);
|
||||||
|
|
||||||
|
// finally update the totals...
|
||||||
|
int i = 0;
|
||||||
|
XSSFRow totalRow = sheet.getRow(rowPos + 1);
|
||||||
|
for (String cur : currencyList) {
|
||||||
|
i++;
|
||||||
|
Double totalSum = currencyTotalSum.get(cur);
|
||||||
|
totalRow.getCell(4 + i).setCellValue(totalSum);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue