Beispiel #1
0
  protected void racunica(QueryDataSet tmpSet) {
    String misec;

    tmpSet.first();

    if (getCkup().equalsIgnoreCase("")) {
      this.killAllReports();
      this.addReport(
          "hr.restart.robno.repStatsMonths",
          "hr.restart.robno.repStatsMonths",
          "StatsMonths",
          "bla bla bla");
      do {
        misec = tmpSet.getTimestamp("DATDOK").toString().substring(5, 7);
        if (!lookupData.getlookupData().raLocate(monthSet, "CPAR", tmpSet.getInt("CPAR") + "")) {
          monthSet.insertRow(false);
          monthSet.setInt("CPAR", tmpSet.getInt("CPAR"));
          monthSet.setBigDecimal(misec, tmpSet.getBigDecimal("IPRODSP"));
          monthSet.setBigDecimal("UKUPNO", tmpSet.getBigDecimal("IPRODSP"));
        } else {
          monthSet.setBigDecimal(
              misec, monthSet.getBigDecimal(misec).add(tmpSet.getBigDecimal("IPRODSP")));
          monthSet.setBigDecimal(
              "UKUPNO", monthSet.getBigDecimal("UKUPNO").add(tmpSet.getBigDecimal("IPRODSP")));
        }

      } while (tmpSet.next());

      monthSet.getColumn("CART").setVisible(0);
      monthSet.getColumn("CART1").setVisible(0);
      monthSet.getColumn("BC").setVisible(0);
      monthSet.getColumn("NAZART").setVisible(0);

      if (fieldSet.getString("SLJED").equals("CPAR")) {
        monthSet.setSort(new SortDescriptor(new String[] {fieldSet.getString("SLJED")}));

      } else {
        monthSet.setSort(
            new SortDescriptor(new String[] {fieldSet.getString("SLJED")}, true, true));

        this.addReport(
            "hr.restart.robno.RepStatParMonthsChart",
            "hr.restart.robno.RepStatParMonthsChart",
            "Top lista kupaca mjeseèno - grafikon");
      }

    } else {
      this.killAllReports();
      this.addReport(
          "hr.restart.robno.repStatsMonthsArt",
          "hr.restart.robno.repStatsMonths",
          "StatsMonthsArt",
          "bla bla bla");

      do {
        misec = tmpSet.getTimestamp("DATDOK").toString().substring(5, 7);
        if (!lookupData.getlookupData().raLocate(monthSet, "CART", tmpSet.getInt("CART") + "")) {
          monthSet.insertRow(false);
          monthSet.setInt("CART", tmpSet.getInt("CART"));
          monthSet.setString("CART1", tmpSet.getString("CART1"));
          monthSet.setString("BC", tmpSet.getString("BC"));
          monthSet.setString("NAZART", tmpSet.getString("NAZART"));
          monthSet.setBigDecimal(misec, tmpSet.getBigDecimal("IPRODSP"));
          monthSet.setBigDecimal("UKUPNO", tmpSet.getBigDecimal("IPRODSP"));
        } else {
          monthSet.setBigDecimal(
              misec, monthSet.getBigDecimal(misec).add(tmpSet.getBigDecimal("IPRODSP")));
          monthSet.setBigDecimal(
              "UKUPNO", monthSet.getBigDecimal("UKUPNO").add(tmpSet.getBigDecimal("IPRODSP")));
        }
      } while (tmpSet.next());

      monthSet.getColumn("CART").setVisible(0);
      monthSet.getColumn("CART1").setVisible(0);
      monthSet.getColumn("BC").setVisible(0);
      monthSet.getColumn("CPAR").setVisible(0);
      monthSet.getColumn(Aut.getAut().getCARTdependable("CART", "CART1", "BC")).setVisible(1);

      monthSet.setSort(new SortDescriptor(new String[] {"UKUPNO"}, true, true));
    }

    monthSet.first();
    dm.getPartneri().open();
    String[] mpb =
        new String[] {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"};

    do {
      for (int i = 0; i < mpb.length; i++) {
        monthSetGraph.insertRow(false);
        monthSetGraph.setInt("CPAR", monthSet.getInt("CPAR"));

        if (lookupData
            .getlookupData()
            .raLocate(dm.getPartneri(), "CPAR", monthSet.getInt("CPAR") + "")) {
          monthSetGraph.setString("NAZPAR", dm.getPartneri().getString("NAZPAR"));
        } else {
          monthSetGraph.setString("NAZPAR", "");
        }
        monthSetGraph.setBigDecimal("UKUPNO", monthSet.getBigDecimal("UKUPNO"));

        monthSetGraph.setString("MJESEC", mpb[i]);
        monthSetGraph.setBigDecimal("IZNOS", monthSet.getBigDecimal(mpb[i]));
      }
    } while (monthSet.next());

    monthSetGraph.setSort(new SortDescriptor(new String[] {"UKUPNO", "CPAR"}, true, true));

    monthSet.last();
    setDataSetAndSums(
        monthSet,
        new String[] {
          "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "UKUPNO"
        });
  }