fixes bug #7436
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@55720 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
25f7a93954
commit
6cf723ff85
|
@ -228,8 +228,9 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
sql.append(" AND r3.fiscalimpressora_id = ifi.fiscalimpressora_id ");
|
||||
sql.append(" inner join fiscal_t2 t2 ");
|
||||
sql.append(" ON ifi.fiscalimpressora_id = t2.fiscalimpressora_id ");
|
||||
sql.append(" inner join empresa e ");
|
||||
sql.append(" ON TRANSLATE(t2.cnpj, ' / - . ', ' ') = e.cnpj, ");
|
||||
sql.append(" inner join empresa e ON TRANSLATE(t2.cnpj, ' / - . ', ' ') ");
|
||||
sql.append(" in (TRANSLATE(e.cnpj, ' / - . ', ' '), ");
|
||||
sql.append(" (select TRANSLATE(cnpj, ' / - . ', ' ') from inscricao_estadual where empresa_id = ? )),");
|
||||
sql.append(" (SELECT numserie20, crz, totgeral ");
|
||||
sql.append(" FROM fiscal_r2) anterior ");
|
||||
sql.append("WHERE r2.datamov BETWEEN ? AND ? ");
|
||||
|
@ -267,12 +268,10 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
|
||||
PreparedStatement stmt = getConexao().prepareStatement(sql.toString());
|
||||
stmt.setFetchSize(100);
|
||||
stmt.setString(1, DateUtil.getStringDate(inicio, DATE_FORMAT_FISCAL));
|
||||
stmt.setString(2, DateUtil.getStringDate(fim, DATE_FORMAT_FISCAL));
|
||||
|
||||
if (empresaId != null) {
|
||||
stmt.setInt(3, empresaId);
|
||||
}
|
||||
stmt.setInt(1, empresaId);
|
||||
stmt.setString(2, DateUtil.getStringDate(inicio, DATE_FORMAT_FISCAL));
|
||||
stmt.setString(3, DateUtil.getStringDate(fim, DATE_FORMAT_FISCAL));
|
||||
stmt.setInt(4, empresaId);
|
||||
|
||||
ResultSet rset = stmt.executeQuery();
|
||||
while (rset.next()) {
|
||||
|
@ -521,7 +520,7 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
item.setValorPedagio(rset.getBigDecimal("importepedagio"));
|
||||
item.setValorEmbarque(rset.getBigDecimal("importetaxaembarque"));
|
||||
item.setValorSeguro(rset.getBigDecimal("importeseguro"));
|
||||
|
||||
|
||||
ImportacionFiscalVO novoFiscal = item;
|
||||
|
||||
codProduto = item.getCodProduto();
|
||||
|
@ -624,7 +623,7 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
|
||||
itensFiscais.add(novoPedagio);
|
||||
}
|
||||
|
||||
|
||||
if (temSeguro && !seguroCriada) {
|
||||
ItemFiscalVO novoSeguro = new ItemFiscalVO(fiscal);
|
||||
novoSeguro.setCodProduto(codProduto + "-SE");
|
||||
|
@ -632,7 +631,7 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
novoSeguro.setValorItem(fiscal.getValorSeguro());
|
||||
novoSeguro.setRepTributado("N1");
|
||||
novoSeguro.setNumItem(StringHelper.preencherZeroEsquerda((numeroItem++) + "", 3));
|
||||
|
||||
|
||||
itensFiscais.add(novoSeguro);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue