Пример #1
0
  public BigDecimal iznosTroskovaUsluge(String cradnal, int rbsrn) {

    BigDecimal suma = Aus.zero2;
    QueryDataSet rns =
        Rnser.getDataModule().getTempSet("cradnal='" + cradnal + "' and rbsid=" + rbsrn);
    rns.open();
    for (rns.first(); rns.inBounds(); rns.next()) {
      suma = suma.add(rns.getBigDecimal("VRI"));
    }

    if (rns.rowCount() == 0) {
      String selectRN =
          "select cart,kol from stdoki where cradnal = '"
              + cradnal
              + "' and vrdok='RNL' and rbsid="
              + rbsrn;
      QueryDataSet radninalog = hr.restart.util.Util.getNewQueryDataSet(selectRN, true);
      QueryDataSet normativUs =
          Aut.getAut().expandArt(radninalog.getInt("CART"), radninalog.getBigDecimal("KOL"), false);

      for (normativUs.first(); normativUs.inBounds(); normativUs.next()) {
        if (raVart.isUsluga(normativUs.getInt("CART"))) {
          // Aut.getAut().artTipa(normativUs.getInt("CART"),"U")) {
          suma =
              suma.add(dm.getArtikli().getBigDecimal("NC"))
                  .multiply(normativUs.getBigDecimal("KOL"));
        }
      }
    }

    return suma;
  }
Пример #2
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"
        });
  }
Пример #3
0
 public String getCART() {
   return Aut.getAut().getCARTdependable(ds);
 }