fixes bug#15326

dev: julio
qua: 

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@97180 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2019-09-02 18:47:59 +00:00
parent bae2913823
commit ac064b5e6e
1 changed files with 8 additions and 4 deletions

View File

@ -579,8 +579,13 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
agr.setAliquota(detail.getAliquota() == null ? BigDecimal.ZERO : detail.getAliquota());
agr.setIcms(MoneyHelper.somar(agr.getIcms(), detail.getIcms()));
agr.setCp(detail.getCp() == null ? BigDecimal.ZERO : detail.getCp());
agr.setCredPres(MoneyHelper.somar(agr.getCredPres(), detail.getCredPres()));
agr.setIcmsRec(MoneyHelper.somar(agr.getIcmsRec(), detail.getIcmsRec()));
BigDecimal credPres = agr.getIcms().multiply(agr.getCp()).divide(new BigDecimal("100"));
BigDecimal icmsRec = agr.getIcms().subtract(credPres);
agr.setCredPres(credPres);
agr.setIcmsRec(icmsRec);
return agr;
}
@ -675,8 +680,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
cp = det.getPorcRedMunicipal() == null ? BigDecimal.ZERO : det.getPorcRedMunicipal();
}
BigDecimal cpPor = MoneyHelper.dividir(cp, BigDecimal.TEN.multiply(BigDecimal.TEN));
BigDecimal credPres = MoneyHelper.multiplicar(icms, cpPor);
BigDecimal credPres = MoneyHelper.dividir(MoneyHelper.multiplicar(icms, cp), new BigDecimal("100"));
BigDecimal icmsRec = MoneyHelper.subtrair(icms, credPres);
BigDecimal vRedBC = new BigDecimal(pRedBC == null ? "0.0" : pRedBC);