Ejemplo n.º 1
0
 static String getPripOrg(String corg, String tekst) {
   com.borland.dx.dataset.StorageDataSet tds =
       hr.restart.zapod.OrgStr.getOrgStr().getOrgstrAndKnjig(corg);
   return Condition.in(tekst, tds, "corg").toString();
   //    int i=0;
   //    String cVrati=tekst+" in (";
   //    tds.first();
   //    do {
   //      if (i>0) {
   //        cVrati=cVrati+',';
   //      }
   //      i++;
   //      cVrati=cVrati+"'"+tds.getString("CORG")+"'";
   //    } while (tds.next());
   //    cVrati=cVrati+")";
   //    return cVrati;
 }
Ejemplo n.º 2
0
  private String getUpit() {
    String selStr =
        "select artikli.cart, artikli.cart1, artikli.bc, artikli.nazart, doki.cpar, doki.datdok, stdoki.kol, stdoki.jm, stdoki.IPRODSP ";

    //    if (fieldSet.getString("SLJED").equalsIgnoreCase("RUC")){
    //      selStr += "(stdoki.iprodbp-stdoki.inab) as ruc ";
    //    } else if (fieldSet.getString("SLJED").equalsIgnoreCase("POR")){
    //      selStr += "(stdoki.iprodsp - stdoki.iprodbp) as por ";
    //    } else {
    //      selStr += "stdoki.IPRODSP ";
    //    }

    String inq;
    StorageDataSet corgs =
        hr.restart.zapod.OrgStr.getOrgStr().getOrgstrAndKnjig(fieldSet.getString("CORG"));
    if (corgs.rowCount() == 0) inq = "1=1";
    else if (corgs.rowCount() == 1) inq = "DOKI.CSKL = '" + fieldSet.getString("CORG") + "'";
    else
      inq =
          "(DOKI.CSKL in "
              + hr.restart.zapod.OrgStr.getOrgStr().getInQuery(corgs, "DOKI.CSKL")
              + ") ";
    hr.restart.baza.Condition oj = hr.restart.baza.Condition.in("DOKI.VRDOK", TypeDoc.araj_docsOJ);
    String exInClude =
        "AND (("
            + oj
            + " AND "
            + inq
            + ") OR ("
            + oj.not()
            + " AND DOKI.CSKL = '"
            + getCskl()
            + "')) ";

    String artikliFilter;

    if (fieldSet.getString("VRART").equals("") || fieldSet.getString("VRART").equals("X"))
      artikliFilter = "";
    else artikliFilter = " AND ARTIKLI.VRART='" + fieldSet.getString("VRART") + "' ";

    String carting = "";
    if (!rpcart.findCART(podgrupe).equals("")) {
      carting = " AND " + rpcart.findCART(podgrupe);
    }

    String ckupca = "";

    if (!getCkup().equals("")) ckupca = "and doki.cpar='" + getCkup() + "' ";

    selStr +=
        " from doki,stdoki,artikli,partneri WHERE doki.cskl = stdoki.cskl AND doki.vrdok = stdoki.vrdok AND doki.god = stdoki.god "
            + "AND doki.brdok = stdoki.brdok AND stdoki.cart = artikli.cart AND doki.cpar = partneri.cpar and doki.god='"
            + hr.restart.robno.Aut.getAut().getKnjigodRobno()
            + "' AND doki.vrdok not in ('PON','NDO','NKU','RNL','REV','PRV','OTR','INM','INV','IZD','TRE','ZAH') "
            + exInClude
            + ckupca
            + artikliFilter
            + carting
            + " order by datdok";

    // REMARK!!
    // nešto što sam primjetio, a moglo bi dobro doæi kad se bude implementirao nabavljaè je da
    // postoji i CPAR kolona u tablici artikli
    // i predstavlja dobavljaèa za taj artikl.

    //    System.out.println("\n\n"+selStr+"\n\n");

    return selStr;
  }
Ejemplo n.º 3
0
  private void init() {
    //  Test Grafikoni

    // FFU
    /*
        jbChart = new JButton("Grafikon");
        jbChart.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ev) {
            if (monthSet == null) return;
            getJPTV().enableEvents(false);

            try {
    			ChartZ.showChartDialog(monthSet, "Grafikon po mjesecima", null);
    		} catch (Exception e) {
    			//
    			e.printStackTrace();
    		}

            getJPTV().enableEvents(true);
          }
        });
        getOKPanel().add(jbChart, BorderLayout.WEST);
        jbChart.setVisible(false);
    */

    this.addReport(
        "hr.restart.robno.repStatsMonths",
        "hr.restart.robno.repStatsMonths",
        "StatsMonths",
        "bla bla bla");

    getJPTV()
        .addTableModifier(
            new hr.restart.swing.raTableColumnModifier(
                "CPAR", new String[] {"CPAR", "NAZPAR"}, dm.getPartneri()));

    rcmbSljed.setRaItems(
        new String[][] {
          {"Šifra kupca", "CPAR"},
          {"Ukupni iznos", "UKUPNO"}
        });

    //    jlSljed.setText("Kolona za ispis");
    //    rcmbSljed.setRaItems(new String[][] {
    //      /*{"Iznos nabave","INAB"},
    //      {"Razlika u cijeni","RUC"},
    //      {"Iznos Poreza","POR"},*/
    //      {"Ukupan promet","IPRODSP"}
    //    });

    jp.remove(jlDatum1);
    jp.remove(jtfPocDatum);
    jp.remove(jtfZavDatum);
    jp.add(jlSljed, new com.borland.jbcl.layout.XYConstraints(15, 167, -1, -1));
    jp.add(rcmbSljed, new com.borland.jbcl.layout.XYConstraints(150, 165, 205, 20));

    xYLayout3.setHeight(275);

    hr.restart.zapod.OrgStr.getOrgStr()
        .addKnjigChangeListener(
            new hr.restart.zapod.raKnjigChangeListener() {
              public void knjigChanged(String oldKnj, String newKnj) {
                showDefaultValues();
              }
            });
  }