fixes bug#23563

dev: gleimar
qua: 

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@109968 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2021-12-09 21:28:27 +00:00
parent 17e3f34861
commit 006c9860b5
1 changed files with 29 additions and 5 deletions

View File

@ -28,8 +28,32 @@ public class RelatorioEstoque extends Relatorio {
while (rset.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
String formInicio = rset.getString("tipoVenta").equals(EnumTipoVenda.TPV_MANUAL.getId().toString()) ?
(rset.getString("ultimoFolioCaja") != null ? rset.getString("ultimoFolioCaja") : rset.getString("forminicial")) : rset.getString("forminicial");
String tipoVenta = rset.getString("tipoVenta");
String formfinal = rset.getString("formfinal");
String formInicio = rset.getString("forminicial");
if (tipoVenta.equals(EnumTipoVenda.TPV_MANUAL.getId().toString())) {
String ultimoFolioCaja = rset.getString("ultimoFolioCaja");
boolean isFormularioMaior = false;
try {
int ultimoFolioCajaInt = Integer.parseInt(ultimoFolioCaja);
int formfinalInt = Integer.parseInt(formfinal);
if (ultimoFolioCaja != null && ultimoFolioCajaInt > formfinalInt) {
isFormularioMaior = true;
}
} catch (Exception e) {
}
if (isFormularioMaior) {
formInicio = formfinal;
} else {
formInicio = ultimoFolioCaja != null ? ultimoFolioCaja : formInicio;
}
}
dataResult.put("aidf", rset.getString("aidf"));
dataResult.put("empresa", rset.getString("nombempresa"));
@ -37,7 +61,7 @@ public class RelatorioEstoque extends Relatorio {
dataResult.put("agencia", rset.getString("nombpuntoventa"));
dataResult.put("serie", rset.getString("serie"));
dataResult.put("forminicio", formInicio);
dataResult.put("formfinal", rset.getString("formfinal"));
dataResult.put("formfinal", formfinal);
dataResult.put("estado", rset.getString("nombestado"));
dataResult.put("tipo", rset.getString("tipo"));
this.dados.add(dataResult);
@ -60,7 +84,7 @@ public class RelatorioEstoque extends Relatorio {
sql.append(" dab.NUMSERIEPREIMPRESA AS serie, ");
sql.append(" es.descestacion AS estacao, ");
sql.append(" tp.desctipo AS tipo, ");
sql.append(" ( case ");
sql.append(" when ");
sql.append(" dab.STATUSOPERACION = 0 ");
@ -70,7 +94,7 @@ public class RelatorioEstoque extends Relatorio {
sql.append(" coalesce(fp.FOLIOPREIMPRESO,dab.NUMFOLIOINICIAL) ");
sql.append(" end ) AS forminicial,");
sql.append(" dab.NUMFOLIOFINAL AS formfinal, ");
sql.append(" ( SELECT ");
sql.append(" MAX(to_number(c.numfoliopreimpreso)) + 1 AS numfoliopreimpreso");
sql.append(" FROM Caja c");