prevent two exceptions
This commit is contained in:
@@ -231,13 +231,13 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
izac = new Charge();
|
||||
}
|
||||
if (amountString != null) {
|
||||
izac.setTotalAmount(new BigDecimal(amountString));
|
||||
izac.setTotalAmount(new BigDecimal(amountString.trim()));
|
||||
}
|
||||
if (basisAmountString != null) {
|
||||
izac.setBasisAmount(new BigDecimal(basisAmountString));
|
||||
izac.setBasisAmount(new BigDecimal(basisAmountString.trim()));
|
||||
}
|
||||
if (percentString != null) {
|
||||
izac.setPercent(new BigDecimal(percentString));
|
||||
izac.setPercent(new BigDecimal(percentString.trim()));
|
||||
}
|
||||
if (reason != null) {
|
||||
izac.setReason(reason);
|
||||
|
||||
@@ -1260,7 +1260,8 @@ public class ZUGFeRDInvoiceImporter {
|
||||
if (chargeChildName != null) {
|
||||
if (chargeChildName.equals("BasisPeriodMeasure")) {
|
||||
if (currentNode.getAttributes().getNamedItem("unitCode").getNodeValue().equals("DAY")) {
|
||||
cd.setDays(Integer.valueOf(XMLTools.trimOrNull(currentNode)));
|
||||
cd.setDays(Math.round(Float.valueOf(XMLTools.trimOrNull(currentNode))));
|
||||
// in case someone writes 30.00 days (happens!) we still want 30 integer days
|
||||
}
|
||||
} else if (chargeChildName.equals("CalculationPercent")) {
|
||||
cd.setPercent(new BigDecimal(XMLTools.trimOrNull(currentNode)));
|
||||
|
||||
Reference in New Issue
Block a user