Ejemplo n.º 1
0
  private void imprimirTexto(final TYPE_PRINT bVisualizar, final ResultSet rs) {

    String sLinhaFina = StringFunctions.replicate("-", 125);
    ImprimeOS imp = new ImprimeOS("", con);
    int linPag = imp.verifLinPag() - 1;
    imp.montaCab();

    try {

      imp.limpaPags();
      imp.montaCab();
      imp.setTitulo("Relatório de UF");

      while (rs.next()) {

        if (imp.pRow() == linPag) {
          imp.pulaLinha(1, imp.comprimido());
          imp.say(0, "+" + sLinhaFina + "+");
          imp.eject();
          imp.incPags();
        }

        if (imp.pRow() == 0) {
          imp.impCab(126, false);
          imp.say(0, imp.normal());
          imp.say(2, "Cód.UF");
          imp.say(10, "|");
          imp.say(14, "Sigla.UF");
          imp.say(24, "|");
          imp.say(28, "Nome.UF");
          imp.say(60, "|");
          imp.say(64, "Região.UF");
          imp.say(75, "|");
          imp.say(79, "Cód País");
          imp.say(89, "|");
          imp.say(93, "Nome País");
          imp.say(126, "|");
          imp.pulaLinha(1, imp.normal());
          imp.say(0, StringFunctions.replicate("-", 125));
        }

        imp.pulaLinha(1, imp.normal());
        imp.say(2, rs.getString("CodUf").trim());
        imp.say(10, "|");
        imp.say(14, rs.getString("SiglaUf").trim());
        imp.say(24, "|");
        imp.say(28, rs.getString("NomeUf").trim());
        imp.say(60, "|");
        imp.say(64, rs.getString("RegiaoUf").trim());
        imp.say(75, "|");
        imp.say(79, rs.getString("CodPais").trim());
        imp.say(89, "|");
        imp.say(93, rs.getString("NomePais").trim());
        imp.say(126, "|");

        if (imp.pRow() >= linPag) {
          imp.incPags();
          imp.eject();
        }
      }

      imp.pulaLinha(1, imp.normal());
      imp.say(0, StringFunctions.replicate("=", 125));
      imp.pulaLinha(1, imp.normal());

      imp.eject();
      imp.fechaGravacao();

      if (bVisualizar == TYPE_PRINT.VIEW) {
        imp.preview(this);
      } else {
        imp.print();
      }

    } catch (SQLException err) {
      err.printStackTrace();
      Funcoes.mensagemErro(this, "Erro consulta UF!\n" + err.getMessage(), true, con, err);
    }
  }
Ejemplo n.º 2
0
  public void imprimir(TYPE_PRINT bVisualizar) {

    if (txtDatafim.getVlrDate().before(txtDataini.getVlrDate())) {
      Funcoes.mensagemInforma(this, "Data final maior que a data inicial!");
      return;
    }

    ImprimeOS imp = new ImprimeOS("", con);
    int linPag = imp.verifLinPag() - 1;
    int numcheque = 0;
    boolean pass = false;

    String sPag = "";

    String sDataini = "";
    String sDatafim = "";

    sDataini = txtDataini.getVlrString();
    sDatafim = txtDatafim.getVlrString();

    ResultSet rs = getResultSet();

    try {

      imp.limpaPags();

      while (rs.next()) {

        if (numcheque != rs.getInt("NCHEQUE")) {
          pass = true;
          numcheque = rs.getInt("NCHEQUE");
        } else pass = false;

        if (imp.pRow() >= (linPag - 1)) {
          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
          imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 89) + "|");
          imp.incPags();
          imp.eject();
        }
        if (imp.pRow() == 0) {
          imp.montaCab();
          imp.setTitulo("Relatório de saida x retorno" + sPag);
          imp.addSubTitulo(
              "RELATÓRIO DE SAIDA X RETORNO "
                  + sPag
                  + "   -   PERIODO DE :"
                  + sDataini
                  + " ATE: "
                  + sDatafim);
          imp.impCab(91, true);
          imp.say(imp.pRow() + 0, 0, "" + imp.comprimido());
          imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 88) + "|");
        }

        if (pass == true) {

          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
          imp.say(imp.pRow() + 0, 0, StringFunctions.replicate("=", 90));
          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());

          imp.say(imp.pRow() + 0, 0, " Cliente:");
          imp.say(imp.pRow() + 0, 2, rs.getString("NOMECLI"));

          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());

          imp.say(imp.pRow() + 0, 2, "Num.Cheque:");
          imp.say(imp.pRow() + 0, 2, rs.getString("NCHEQUE"));
          imp.say(imp.pRow() + 0, 3, "Valor:");
          imp.say(imp.pRow() + 0, 2, rs.getString("VALOR"));
          imp.say(imp.pRow() + 0, 3, "Banco:");
          imp.say(imp.pRow() + 0, 2, rs.getString("banco"));

          imp.say(imp.pRow() + 2, 0, "" + imp.comprimido());

          imp.say(imp.pRow() + 0, 2, "Data/Saída");
          imp.say(imp.pRow() + 0, 3, "Descrição");
          imp.say(imp.pRow() + 0, 42, "Data/Retorno");
          imp.say(imp.pRow() + 0, 5, "Cód.Retorno");
          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
          imp.say(imp.pRow() + 0, 0, StringFunctions.replicate("-", 90));
        }

        imp.say(imp.pRow() + 1, 0, "" + imp.normal());
        imp.say(imp.pRow() + 0, 2, Funcoes.dateToStrDate(rs.getDate("Dates")));
        imp.say(imp.pRow() + 0, 3, rs.getString("DESCRICAO"));
        imp.say(imp.pRow() + 0, 5, Funcoes.dateToStrDate(rs.getDate("Dater")));
        imp.say(imp.pRow() + 0, 11, rs.getString("Codigor"));

        if (imp.pRow() >= linPag) {
          imp.incPags();
          imp.eject();
        }
      }

      imp.say(imp.pRow() + 1, 0, "" + imp.normal());
      imp.say(imp.pRow() + 0, 0, StringFunctions.replicate("=", 90));

      imp.eject();

      imp.fechaGravacao();

      con.commit();

    } catch (SQLException err) {
      Funcoes.mensagemErro(this, "Erro consulta tabela de Cheques!" + err.getMessage());
    }

    if (bVisualizar == TYPE_PRINT.VIEW) {
      imp.preview(this);
    } else {
      imp.print();
    }
  }
Ejemplo n.º 3
0
  public void imprimiTexto(ResultSet rs, TYPE_PRINT bVisualizar, String sCab) {

    BigDecimal bTotal = new BigDecimal("0");
    BigDecimal bSaldo = new BigDecimal("0");
    BigDecimal bSaldoLinha = new BigDecimal("0");
    BigDecimal bVlrDeb = new BigDecimal("0");
    BigDecimal bVlrCred = new BigDecimal("0");
    BigDecimal bVlrTotDeb = new BigDecimal("0");
    BigDecimal bVlrTotCred = new BigDecimal("0");
    BigDecimal bAnt = buscaSaldoAnt();
    ImprimeOS imp = new ImprimeOS("", con);
    String linhafina = StringFunctions.replicate("-", 133);
    String sDataLanca = "";
    String sConta = "";
    String sCodConta = txtCodConta.getVlrString();

    boolean bPrim = true;
    int linPag = imp.verifLinPag() - 1;

    try {

      imp.limpaPags();
      imp.setTitulo("Extrato Bancário");
      imp.addSubTitulo("EXTRATO BANCÁRIO");
      sConta = "CONTA: " + sCodConta + " - " + txtDescConta.getVlrString();
      imp.addSubTitulo(sConta);

      while (rs.next()) {

        if (!bPrim) {

          if (!(sDataLanca.equals(rs.getString("DataSL")))) {
            bTotal = new BigDecimal(rs.getString("SaldoSL"));
          }
        } else {
          bTotal = new BigDecimal(rs.getString("SaldoSL"));
        }

        if (imp.pRow() == linPag) {
          imp.eject();
          imp.incPags();
        }
        if (imp.pRow() == 0) {

          imp.montaCab();
          imp.impCab(136, true);

          imp.say(0, imp.comprimido());
          imp.say(0, "|" + linhafina + "|");
          imp.pulaLinha(1, imp.comprimido());
          imp.say(0, "| Data");
          imp.say(14, "| Historico");
          imp.say(69, "| Doc");
          imp.say(82, "| Débito");
          imp.say(100, "| Crédito");
          imp.say(118, "| Saldo");
          imp.say(135, "|");
          imp.pulaLinha(1, imp.comprimido());
          imp.say(0, "|" + linhafina + "|");

          if (bPrim) {

            imp.pulaLinha(1, imp.comprimido());
            imp.say(0, "|");
            imp.say(
                103,
                "Saldo Anterior: "
                    + Funcoes.strDecimalToStrCurrency(15, Aplicativo.casasDecFin, bAnt.toString()));
            imp.say(135, "|");
            imp.pulaLinha(1, imp.comprimido());
            imp.say(0, "|" + linhafina + "|");
            bSaldoLinha = new BigDecimal(bAnt.toString());
          }
        }
        bPrim = false;
        bSaldo = new BigDecimal(rs.getBigDecimal("SaldoSL").toString());
        bAnt = bSaldo;
        sDataLanca = rs.getString("DataSL");
        bSaldoLinha = bSaldoLinha.add(rs.getBigDecimal("VlrSubLanca"));

        if (rs.getFloat("VlrSubLanca") < 0) {
          bVlrDeb = new BigDecimal(rs.getBigDecimal("VlrSubLanca").toString()).abs();
          bVlrCred = new BigDecimal("0.00");
          bVlrTotDeb = bVlrTotDeb.add(new BigDecimal(bVlrDeb.toString()));
        } else {
          bVlrCred = new BigDecimal(rs.getBigDecimal("VlrSubLanca").toString());
          bVlrDeb = new BigDecimal("0.00");
          bVlrTotCred = bVlrTotCred.add(new BigDecimal(bVlrCred.toString()));
        }

        imp.pulaLinha(1, imp.comprimido());
        imp.say(0, "| " + StringFunctions.sqlDateToStrDate(rs.getDate("DataSL")));
        imp.say(14, "| " + Funcoes.copy(rs.getString("HistBLanca"), 0, 50));
        imp.say(69, "| " + Funcoes.alinhaDir(rs.getString("DocLanca"), 10));
        imp.say(82, "|");
        if (bVlrDeb.floatValue() != 0) {
          imp.say(
              imp.pRow() + 0,
              84,
              Funcoes.strDecimalToStrCurrency(15, Aplicativo.casasDecFin, bVlrDeb.toString()));
        }
        imp.say(100, "|");
        if (bVlrCred.floatValue() != 0) {
          imp.say(
              0,
              102,
              Funcoes.strDecimalToStrCurrency(15, Aplicativo.casasDecFin, bVlrCred.toString()));
        }
        imp.say(
            118,
            "|"
                + Funcoes.strDecimalToStrCurrency(
                    15, Aplicativo.casasDecFin, bSaldoLinha.toString()));
        imp.say(135, "|");
      }
      imp.pulaLinha(1, imp.comprimido());
      imp.say(0, "|" + linhafina + "|");
      imp.pulaLinha(1, imp.comprimido());
      imp.say(0, "|");
      imp.say(82, "|");
      imp.say(
          84, Funcoes.strDecimalToStrCurrency(15, Aplicativo.casasDecFin, bVlrTotDeb.toString()));
      imp.say(100, "|");
      imp.say(
          102, Funcoes.strDecimalToStrCurrency(15, Aplicativo.casasDecFin, bVlrTotCred.toString()));
      imp.say(118, "|");
      imp.say(119, Funcoes.strDecimalToStrCurrency(15, Aplicativo.casasDecFin, bTotal.toString()));
      imp.say(135, "|");
      imp.pulaLinha(1, imp.comprimido());
      imp.say(0, "+" + linhafina + "+");

      imp.eject();
      imp.fechaGravacao();

      rs.close();
      con.commit();

    } catch (Exception e) {

      e.printStackTrace();
    }
    if (bVisualizar == TYPE_PRINT.VIEW) {
      imp.preview(this);
    } else {
      imp.print();
    }
  }
Ejemplo n.º 4
0
  public void imprimir(TYPE_PRINT bVisualizar) {

    if (txtDatafim.getVlrDate().before(txtDataini.getVlrDate())) {
      Funcoes.mensagemInforma(this, "Data final maior que a data inicial!");
      return;
    }

    ImprimeOS imp = new ImprimeOS("", con);
    int linPag = imp.verifLinPag() - 1;
    boolean bFimDia = false;
    String sSQL = "";

    BigDecimal bTotalDiaVal = new BigDecimal("0");
    BigDecimal bTotalDiaDesc = new BigDecimal("0");
    BigDecimal bTotalDiaLiq = new BigDecimal("0");

    BigDecimal bTotalVal = new BigDecimal("0");
    BigDecimal bTotalDesc = new BigDecimal("0");
    BigDecimal bTotalLiq = new BigDecimal("0");

    imp.montaCab();
    String sDataini = "";
    String sDatafim = "";
    String sDtemitvenda = "";

    sDataini = txtDataini.getVlrString();
    sDatafim = txtDatafim.getVlrString();

    imp.setTitulo("Resumo Diário de Vendas");
    if (rgFormato.getVlrString().equals("D")) {
      sSQL =
          "SELECT V.DTEMITVENDA,V.CODTIPOMOV,V.CODVENDA,V.DOCVENDA,V.SERIE,"
              + "V.STATUSVENDA,V.DOCVENDA,"
              + "V.DTEMITVENDA,V.VLRPRODVENDA,V.VLRLIQVENDA,"
              + "V.CODPLANOPAG,P.DESCPLANOPAG,"
              + "V.VLRCOMISVENDA,V.VLRDESCITVENDA,"
              + "V.CODCLI,C.RAZCLI,V.STATUSVENDA"
              + " FROM VDVENDA V,VDCLIENTE C,FNPLANOPAG P, EQTIPOMOV TM "
              + "WHERE TM.CODTIPOMOV=V.CODTIPOMOV"
              + " AND TM.CODEMP=V.CODEMPTM"
              + " AND TM.CODFILIAL=V.CODFILIALTM"
              + " AND C.CODCLI=V.CODCLI"
              + " AND C.CODEMP=V.CODEMPCL AND C.CODFILIAL=V.CODFILIALCL"
              + " AND V.DTEMITVENDA BETWEEN ? AND ? AND "
              + "P.CODPLANOPAG=V.CODPLANOPAG AND V.FLAG IN "
              + AplicativoPD.carregaFiltro(con, org.freedom.library.swing.frame.Aplicativo.iCodEmp)
              + " AND V.CODEMP=? AND V.CODFILIAL=?"
              + " AND TM.TIPOMOV IN ('VD','PV','VT','SE')"
              + " AND NOT SUBSTR(V.STATUSVENDA,1,1)='C' ORDER BY V.DTEMITVENDA,V.DOCVENDA";
    } else if (rgFormato.getVlrString().equals("R")) {
      sSQL =
          "SELECT V.DTEMITVENDA,SUM(V.VLRLIQVENDA) FROM VDVENDA V,"
              + " EQTIPOMOV TM WHERE V.DTEMITVENDA BETWEEN ? AND ? AND V.FLAG IN "
              + AplicativoPD.carregaFiltro(con, org.freedom.library.swing.frame.Aplicativo.iCodEmp)
              + " AND TM.CODEMP=V.CODEMPTM"
              + " AND TM.CODFILIAL=V.CODFILIALTM"
              + " AND TM.CODTIPOMOV=V.CODTIPOMOV"
              + " AND TM.TIPOMOV IN ('VD','PV','VT','SE')"
              + " AND V.CODEMP=? AND V.CODFILIAL=? GROUP BY V.DTEMITVENDA";
      System.out.println(sSQL);
    }

    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
      ps = con.prepareStatement(sSQL);
      ps.setDate(1, Funcoes.dateToSQLDate(txtDataini.getVlrDate()));
      ps.setDate(2, Funcoes.dateToSQLDate(txtDatafim.getVlrDate()));
      ps.setInt(3, Aplicativo.iCodEmp);
      ps.setInt(4, ListaCampos.getMasterFilial("VDVENDA"));
      rs = ps.executeQuery();
      imp.limpaPags();

      if (rgFormato.getVlrString().equals("D")) {

        while (rs.next()) {

          if ((!StringFunctions.sqlDateToStrDate(rs.getDate("dtemitvenda")).equals(sDtemitvenda))
              & (bFimDia)) {
            imp.impCab(136, false);
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|");
            imp.say(
                imp.pRow() + 0,
                61,
                "Totais do Dia-> "
                    + sDtemitvenda
                    + " |"
                    + Funcoes.strDecimalToStrCurrency(10, 2, "" + bTotalDiaVal)
                    + Funcoes.strDecimalToStrCurrency(10, 2, "" + bTotalDiaDesc)
                    + Funcoes.strDecimalToStrCurrency(11, 2, "" + bTotalDiaLiq));
            imp.say(imp.pRow(), 136, "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");
            bTotalDiaVal = new BigDecimal("0");
            bTotalDiaDesc = new BigDecimal("0");
            bTotalDiaLiq = new BigDecimal("0");
            bFimDia = false;
          }

          if (imp.pRow() >= (linPag - 1)) {
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");
            imp.incPags();
            imp.eject();
          }

          if (imp.pRow() == 0) {
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "+" + StringFunctions.replicate("-", 134) + "+");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|   Emitido em :" + Funcoes.dateToStrDate(new Date()));
            imp.say(imp.pRow() + 0, 120, "Pagina : " + (imp.getNumPags()));
            imp.say(imp.pRow() + 0, 136, "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|");
            imp.say(
                imp.pRow() + 0,
                5,
                "RESUMO DIARIO DE VENDAS   -   PERIODO DE :" + sDataini + " Até: " + sDatafim);
            imp.say(imp.pRow() + 0, 136, "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|");
            imp.say(imp.pRow() + 0, 136, "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "| Dt. Emissao");
            imp.say(imp.pRow() + 0, 17, "NF./Ped.");
            imp.say(imp.pRow() + 0, 31, "Cliente");
            imp.say(imp.pRow() + 0, 88, "|    Valor   Desconto " + "   Liquido F.Pagto.");
            imp.say(imp.pRow() + 0, 136, "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");
          }

          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
          imp.say(imp.pRow() + 0, 0, "|");
          if (!StringFunctions.sqlDateToStrDate(rs.getDate("dtemitvenda")).equals(sDtemitvenda)) {
            imp.say(imp.pRow() + 0, 3, StringFunctions.sqlDateToStrDate(rs.getDate("dtemitvenda")));
          }

          imp.say(
              imp.pRow() + 0,
              17,
              rs.getString("StatusVenda").substring(0, 1).equals("P")
                  ? "P-" + Funcoes.copy(rs.getString("codvenda"), 0, 6)
                  : "V-" + Funcoes.copy(rs.getString("docvenda"), 0, 6));

          imp.say(
              imp.pRow() + 0,
              31,
              Funcoes.copy(rs.getString("codcli"), 0, 7)
                  + "-"
                  + Funcoes.copy(rs.getString("razcli"), 0, 49)
                  + "|"
                  + Funcoes.strDecimalToStrCurrency(10, 2, rs.getString("vlrprodvenda"))
                  + Funcoes.strDecimalToStrCurrency(10, 2, rs.getString("vlrdescitvenda"))
                  + Funcoes.strDecimalToStrCurrency(11, 2, rs.getString("vlrliqvenda"))
                  + " "
                  + Funcoes.copy(rs.getString("descplanopag"), 0, 15)
                  + "|");

          if (rs.getString("VlrProdVenda") != null) {
            bTotalDiaVal = bTotalDiaVal.add(new BigDecimal(rs.getString("VlrProdVenda")));
            bTotalVal = bTotalVal.add(new BigDecimal(rs.getString("VlrProdVenda")));
          }

          if (rs.getString("VlrDescitvenda") != null) {
            bTotalDiaDesc = bTotalDiaDesc.add(new BigDecimal(rs.getString("VlrDescitVenda")));
            bTotalDesc = bTotalDesc.add(new BigDecimal(rs.getString("VlrDescitVenda")));
          }

          if (rs.getString("VlrLiqVenda") != null) {
            bTotalDiaLiq = bTotalDiaLiq.add(new BigDecimal(rs.getString("VlrLiqVenda")));
            bTotalLiq = bTotalLiq.add(new BigDecimal(rs.getString("VlrLiqVenda")));
          }

          bFimDia = true;
          sDtemitvenda = StringFunctions.sqlDateToStrDate(rs.getDate("Dtemitvenda"));
        }

        if (bFimDia) {
          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
          imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");
          imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
          imp.say(imp.pRow() + 0, 0, "|");
          imp.say(
              imp.pRow() + 0,
              61,
              "Totais do Dia-> "
                  + sDtemitvenda
                  + " |"
                  + Funcoes.strDecimalToStrCurrency(10, 2, "" + bTotalDiaVal)
                  + Funcoes.strDecimalToStrCurrency(10, 2, "" + bTotalDiaDesc)
                  + Funcoes.strDecimalToStrCurrency(11, 2, "" + bTotalDiaLiq));
          imp.say(imp.pRow(), 136, "|");
        }

        imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
        imp.say(imp.pRow(), 0, "|" + StringFunctions.replicate("-", 134) + "|");
        imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
        imp.say(imp.pRow() + 0, 0, "|");
        imp.say(
            imp.pRow() + 0,
            72,
            "Totais Geral    |"
                + Funcoes.strDecimalToStrCurrency(10, 2, "" + bTotalVal)
                + Funcoes.strDecimalToStrCurrency(10, 2, "" + bTotalDesc)
                + Funcoes.strDecimalToStrCurrency(11, 2, "" + bTotalLiq));
        imp.say(imp.pRow(), 136, "|");

        imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
        imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");

      } else if (rgFormato.getVlrString().equals("R")) {
        iLinha = 1;
        iCol = 0;
        while (rs.next()) {
          if (imp.pRow() >= (linPag - 1)) {
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|" + StringFunctions.replicate("-", 134) + "|");
            imp.incPags();
            imp.eject();
          }
          if (imp.pRow() == 0) {
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "+" + StringFunctions.replicate("-", 134) + "+");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|   Emitido em :" + Funcoes.dateToStrDate(new Date()));
            imp.say(imp.pRow() + 0, 120, "Pagina : " + (imp.getNumPags()));
            imp.say(imp.pRow() + 0, 136, "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|");
            imp.say(
                imp.pRow() + 0,
                5,
                "RESUMO DE TOTAL DE VENDAS - PERIODO DE :" + sDataini + " Até: " + sDatafim);
            imp.say(imp.pRow() + 0, 136, "|");
            imp.say(imp.pRow() + 1, 0, "|" + StringFunctions.replicate("-", 134) + "|");
            imp.say(imp.pRow() + 1, 0, "" + imp.comprimido());
            imp.say(imp.pRow() + 0, 0, "|  Data");
            imp.say(imp.pRow() + 0, 14, "        Valor");
            imp.say(imp.pRow() + 0, 35, "|  Data");
            imp.say(imp.pRow() + 0, 49, "        Valor");
            imp.say(imp.pRow() + 0, 70, "|  Data");
            imp.say(imp.pRow() + 0, 84, "        Valor");
            imp.say(imp.pRow() + 0, 105, "|  Data");
            imp.say(imp.pRow() + 0, 119, "       Valor");
            imp.say(imp.pRow() + 0, 136, "|");
            imp.say(imp.pRow() + 1, 0, "|" + StringFunctions.replicate("-", 134) + "|");
          }

          imp.say(
              imp.pRow() + iLinha, iCol, "|  " + StringFunctions.sqlDateToStrDate(rs.getDate(1)));
          imp.say(
              imp.pRow() + 0,
              iCol + 14,
              " " + Funcoes.strDecimalToStrCurrency(15, 2, "" + rs.getString(2)));
          if (iCol == 0) {
            iLinha = 0;
            iCol = 35;
          } else if (iCol == 35) iCol = 70;
          else if (iCol == 70) iCol = 105;
          else {
            imp.say(imp.pRow() + 0, 136, "|");
            iCol = 0;
            iLinha = 1;
          }

          if (rs.getString(2) != null) {
            bTotalDiaLiq = bTotalDiaLiq.add(new BigDecimal(rs.getString(2)));
            bTotalLiq = bTotalLiq.add(new BigDecimal(rs.getString(2)));
          }
        }
      }
      if ((iCol < 105) && (iLinha == 0)) {
        imp.say(imp.pRow() + 0, 136, "|");
      }
      imp.say(imp.pRow() + 1, 0, "+" + StringFunctions.replicate("-", 134) + "+");
      imp.say(imp.pRow() + 1, 0, "|");
      imp.say(
          imp.pRow() + 0,
          88,
          "| Total Geral do Período   | " + Funcoes.strDecimalToStrCurrency(11, 2, "" + bTotalLiq));
      imp.say(imp.pRow(), 136, "|");
      imp.say(imp.pRow() + 1, 0, "+" + StringFunctions.replicate("-", 134) + "+");

      imp.eject();

      imp.fechaGravacao();

      // rs.close();
      // ps.close();
      con.commit();
      // dl.dispose();
    } catch (SQLException err) {
      Funcoes.mensagemErro(
          this, "Erro consulta tabela de vendas!" + err.getMessage(), true, con, err);
    }

    if (bVisualizar == TYPE_PRINT.VIEW) {
      imp.preview(this);
    } else {
      imp.print();
    }
  }