Merge pull request 'fixes bug #AL3553' (!122) from AL-3553 into master
Reviewed-on: adm/ModelWeb#122 Reviewed-by: Gleison da Cruz <gleison.cruz@totvs.com.br>master
commit
6200cf536e
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ModelWeb</artifactId>
|
||||
<version>1.26.1</version>
|
||||
<version>1.26.2</version>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
|
|
|
@ -49,6 +49,12 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|||
public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, String>
|
||||
implements CalcularPeajeDAO {
|
||||
|
||||
|
||||
/**
|
||||
* Este índice foi estabelecido conforme portaria do orgão anexa do mantis 8274
|
||||
*/
|
||||
private static final float INDICE_ORIGINAL_AGER_MT = 0.004895f;
|
||||
|
||||
@Autowired
|
||||
private OrgaoConcedenteService orgaoConcedenteService;
|
||||
|
||||
|
@ -437,8 +443,9 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
}
|
||||
}
|
||||
|
||||
private static BigDecimal calculateImportePeajeAGER(BigDecimal km) {
|
||||
return km.multiply(new BigDecimal(0.004895f)).setScale(HIGH_PRECISION, RoundingMode.HALF_UP); // esse valor deveria vir do indice do orgao mas as casas decimais nao sao compativeis.. verificar se pode mudar a precisao do campo de indice..
|
||||
private static BigDecimal calculateImportePeajeAGER(BigDecimal km, OrgaoConcedente orgao) {
|
||||
BigDecimal indicePejeOrgao = orgao!=null && orgao.getIndicePeaje() !=null ? orgao.getIndicePeaje() : new BigDecimal(INDICE_ORIGINAL_AGER_MT);
|
||||
return km.multiply(indicePejeOrgao).setScale(HIGH_PRECISION, RoundingMode.HALF_UP); // esse valor deveria vir do indice do orgao mas as casas decimais nao sao compativeis.. verificar se pode mudar a precisao do campo de indice..
|
||||
}
|
||||
|
||||
// ((importe * rutaCantEixos) / (indice)) / ( 1 - icms)
|
||||
|
@ -468,7 +475,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
return calculateImportePeajeANTT(importe, icms, indice, rutaCantEixos, getRutaCantAsientos(ruta), usaICMS);
|
||||
}
|
||||
if (Constantes.ORGAOS_CONCEDENTES_CALCULO_AGER.contains(orgao.getOrgaoConcedenteId())) {
|
||||
return calculateImportePeajeAGER(km);
|
||||
return calculateImportePeajeAGER(km, orgao);
|
||||
}
|
||||
|
||||
return BigDecimal.ZERO; // TODO throw an exception? como calcular quando é outro orgao concendente?
|
||||
|
|
Loading…
Reference in New Issue