corrected a test, corrected calculation
This commit is contained in:
@@ -145,7 +145,8 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
|||||||
if(totalAmount != null) {
|
if(totalAmount != null) {
|
||||||
return totalAmount;
|
return totalAmount;
|
||||||
} else if (percent!=null) {
|
} else if (percent!=null) {
|
||||||
BigDecimal singlePrice=currentItem.getValue().divide(BigDecimal.ONE.add(getPercent().divide(new BigDecimal(100))), 18, RoundingMode.HALF_UP);
|
// BigDecimal singlePrice=currentItem.getValue().divide(BigDecimal.ONE.add(getPercent().divide(new BigDecimal(100))), 18, RoundingMode.HALF_UP);
|
||||||
|
BigDecimal singlePrice=currentItem.getValue().multiply(BigDecimal.ONE.subtract(getPercent().divide(new BigDecimal(100))));
|
||||||
BigDecimal singlePriceDiff=currentItem.getValue().subtract(singlePrice);
|
BigDecimal singlePriceDiff=currentItem.getValue().subtract(singlePrice);
|
||||||
return singlePriceDiff;
|
return singlePriceDiff;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -275,21 +275,20 @@ public class ZF2PushTest extends TestCase {
|
|||||||
fail("IOException should not be raised");
|
fail("IOException should not be raised");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// now check the contents (like MustangReaderTest)
|
// now check the contents (like MustangReaderTest)
|
||||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ITEMCHARGESALLOWANCESPDF);
|
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ITEMCHARGESALLOWANCESPDF);
|
||||||
|
|
||||||
assertEquals("EUR", zi.getInvoiceCurrencyCode());
|
assertEquals("EUR", zi.getInvoiceCurrencyCode());
|
||||||
assertTrue(zi.getUTF8().contains("0911623562")); // fax number
|
assertTrue(zi.getUTF8().contains("0911623562")); // fax number
|
||||||
assertTrue(zi.getUTF8().contains("ABK"));
|
assertTrue(zi.getUTF8().contains("ABK"));
|
||||||
|
|
||||||
// Reading ZUGFeRD
|
// Reading ZUGFeRD
|
||||||
assertEquals("19.52", zi.getAmount());
|
assertEquals("18.33", zi.getAmount());
|
||||||
assertEquals(orgname, zi.getHolder());
|
assertEquals(orgname, zi.getHolder());
|
||||||
assertEquals(number, zi.getForeignReference());
|
assertEquals(number, zi.getForeignReference());
|
||||||
try {
|
|
||||||
assertEquals(zi.getVersion(), 2);
|
assertEquals(zi.getVersion(), 2);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
fail("Exception should not be raised");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user