Skip to content

Commit

Permalink
Fix valorCobrado quando sem acrésimos e descontos (#292)
Browse files Browse the repository at this point in the history
* Fix valorCobrado quando igual a valorBoleto

* Fix teste

---------

Co-authored-by: Rogerio Angeliski <[email protected]>
  • Loading branch information
rodrigofcr and angeliski authored Feb 13, 2025
1 parent f1d635c commit 2fb14ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ public BigDecimal getValorCobrado() {
valorCobrado = valorCobrado.add(acrescimos);
}
if (valorCobrado.compareTo(valorBoleto) == 0){
return BigDecimal.ZERO;
valorCobrado = valorBoleto;
}

return valorCobrado;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ public void boletoDeveAceitarNoMaximoDoisLocais() {
}

@Test
public void valorCobradoDeveSerZeroSemAcrescimoOuDescontos() {
public void valorCobradoDeveSerIgualAValorBoletoQuandoSemAcrescimoOuDescontos() {
Boleto b = Boleto.novoBoleto();
b.comValorBoleto("40.00");
assertEquals(BigDecimal.ZERO, b.getValorCobrado());
assertEquals(b.getValorBoleto(), b.getValorCobrado());
}

@Test
Expand Down

0 comments on commit 2fb14ed

Please sign in to comment.