/** * @return The total net sum of all assigned cost entries multiplied with the vat of this position. */ @Transient public BigDecimal getKostZuweisungGrossSum() { return CurrencyHelper.getGrossAmount(getKostZuweisungsNetSum(), vat); }
/** * Calculates gross amount using the vat from the invoice position. * * @return Gross amount if vat found otherwise net amount. * @see #getRechnungsPosition() * @see #getEingangsrechnungsPosition() */ @Transient public BigDecimal getBrutto() { final BigDecimal vat; if (this.rechnungsPosition != null) { vat = this.rechnungsPosition.getVat(); } else if (this.eingangsrechnungsPosition != null) { vat = this.eingangsrechnungsPosition.getVat(); } else { vat = null; } return CurrencyHelper.getGrossAmount(this.netto, vat); }
@Test public void grossAmount() { myAssertEquals("0", CurrencyHelper.getGrossAmount(null, null)); myAssertEquals("0", CurrencyHelper.getGrossAmount(null, BigDecimal.ZERO)); myAssertEquals("0", CurrencyHelper.getGrossAmount(null, BigDecimal.ONE)); myAssertEquals("0", CurrencyHelper.getGrossAmount(BigDecimal.ZERO, null)); myAssertEquals("0", CurrencyHelper.getGrossAmount(BigDecimal.ZERO, BigDecimal.ZERO)); myAssertEquals("1", CurrencyHelper.getGrossAmount(BigDecimal.ONE, null)); myAssertEquals("1", CurrencyHelper.getGrossAmount(BigDecimal.ONE, BigDecimal.ZERO)); myAssertEquals("1.19", CurrencyHelper.getGrossAmount(BigDecimal.ONE, new BigDecimal("0.19"))); }
korrektur = CurrencyHelper.getGrossAmount(position.getKostZuweisungNetFehlbetrag(), position.getVat()); if (NumberHelper.isZeroOrNull(korrektur) == true) { korrektur = null;