fix missing invoice.rate
This commit is contained in:
parent
6e8d6b34ba
commit
e3a24515f6
1 changed files with 11 additions and 0 deletions
|
|
@ -137,6 +137,15 @@ public class OPListController implements Serializable {
|
||||||
// passen
|
// passen
|
||||||
invoiceList = new ArrayList<ItemCollection>();
|
invoiceList = new ArrayList<ItemCollection>();
|
||||||
for (ItemCollection _invoice : invoiceListTemp) {
|
for (ItemCollection _invoice : invoiceListTemp) {
|
||||||
|
|
||||||
|
// Test if we have 'invoice.base.amount' and 'invoice.rate'
|
||||||
|
if (!_invoice.hasItem("invoice.base.amount")) {
|
||||||
|
_invoice.setItemValue("invoice.base.amount", 0.0);
|
||||||
|
}
|
||||||
|
if (!_invoice.hasItem("invoice.rate")) {
|
||||||
|
_invoice.setItemValue("invoice.rate", 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
if (currencyFilter == null || currencyFilter.isEmpty() || currencyFilter.equals("-")) {
|
if (currencyFilter == null || currencyFilter.isEmpty() || currencyFilter.equals("-")) {
|
||||||
invoiceList.add(_invoice);
|
invoiceList.add(_invoice);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -162,6 +171,8 @@ public class OPListController implements Serializable {
|
||||||
if (rate != 0) {
|
if (rate != 0) {
|
||||||
maxSaldo = maxSaldo / rate;
|
maxSaldo = maxSaldo / rate;
|
||||||
invoice.setItemValue("invoice.saldo.byrate", maxSaldo);
|
invoice.setItemValue("invoice.saldo.byrate", maxSaldo);
|
||||||
|
} else {
|
||||||
|
invoice.setItemValue("invoice.saldo.byrate", 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue