コード例 #1
0
ファイル: raenginePRD.java プロジェクト: hernad/spa-erp
  public void prepareVtPred(String cradnal, int rbsrn, boolean single) {
    sds = new StorageDataSet();
    sds.setColumns(dm.getVTPred().cloneColumns());
    sds.open();
    sds.insertRow(false);
    initParams();
    QueryDataSet materijal = selectIzdatnice(cradnal, rbsrn, single);
    for (materijal.first(); materijal.inBounds(); materijal.next()) {
      if (ld.raLocate(dm.getSklad(), "CSKL", materijal.getString("CSKL"))) {
        if (dm.getSklad().getString("TIPSKL").equalsIgnoreCase("M")) {
          sds.setBigDecimal(
              "MAT_I", sds.getBigDecimal("MAT_I").add(materijal.getBigDecimal("IRAZ")));

        } else if (dm.getSklad().getString("TIPSKL").equalsIgnoreCase("P")) {
          sds.setBigDecimal(
              "PRO_I", sds.getBigDecimal("PRO_I").add(materijal.getBigDecimal("IRAZ")));
        } else if (dm.getSklad().getString("TIPSKL").equalsIgnoreCase("R")) {
          sds.setBigDecimal(
              "ROB_I", sds.getBigDecimal("ROB_I").add(materijal.getBigDecimal("IRAZ")));
        } else if (dm.getSklad().getString("TIPSKL").equalsIgnoreCase("L")) {
          sds.setBigDecimal(
              "POL_I", sds.getBigDecimal("POL_I").add(materijal.getBigDecimal("IRAZ")));
        }
      } else {
        throw new RuntimeException(
            "Skladište " + materijal.getString("CSKL") + " nisam uspio pronaæi sa raLocate !!! ");
      }
    }
    sds.setBigDecimal("USL_I", iznosTroskovaUsluge(cradnal, rbsrn));
    faktorizacija();
  }
コード例 #2
0
ファイル: DOStoIZD.java プロジェクト: hernad/spa-erp
 private void setBrdok() {
   StorageDataSet dsq = new StorageDataSet();
   dsq.addColumn(doki.getDataModule().getColumn("VRDOK").cloneColumn());
   dsq.addColumn(doki.getDataModule().getColumn("CSKL").cloneColumn());
   dsq.addColumn(doki.getDataModule().getColumn("GOD").cloneColumn());
   dsq.open();
   dsq.setString("VRDOK", "IZD");
   dsq.setString("CSKL", getCskl());
   dsq.setString("GOD", getGodina());
   seqO = hr.restart.robno.Util.getUtil().getSeqString(dsq);
   brdok = Valid.getValid().findSeqInt(seqO, false);
 }
コード例 #3
0
ファイル: jpMatchTotals.java プロジェクト: hernad/spa-erp
  private void jbInit() throws Exception {
    tots.setColumns(
        new Column[] {
          dM.createBigDecimalColumn("TOT", 2),
          dM.createBigDecimalColumn("POK", 2),
          dM.createBigDecimalColumn("SAL", 2),
          dM.createBigDecimalColumn("TOTPV", 2),
          dM.createBigDecimalColumn("POKPV", 2),
          dM.createBigDecimalColumn("SALPV", 2)
        });
    tots.open();
    tots.insertRow(false);

    jraTot.setDataSet(tots);
    jraTot.setColumnName("TOT");
    jraPok.setDataSet(tots);
    jraPok.setColumnName("POK");
    jraOst.setDataSet(tots);
    jraOst.setColumnName("SAL");
    jlTot.setHorizontalAlignment(JLabel.CENTER);
    jlPok.setHorizontalAlignment(JLabel.CENTER);
    jlOst.setHorizontalAlignment(JLabel.CENTER);
    jraTotPv.setDataSet(tots);
    jraTotPv.setColumnName("TOTPV");
    jraPokPv.setDataSet(tots);
    jraPokPv.setColumnName("POKPV");
    jraOstPv.setDataSet(tots);
    jraOstPv.setColumnName("SALPV");
    setLayout(lay);
    lay.setWidth(475);
    lay.setHeight(80);
    add(jlUk, new XYConstraints(15, 20, -1, -1));
    add(jraTot, new XYConstraints(150, 20, 100, -1));
    add(jraPok, new XYConstraints(255, 20, 100, -1));
    add(jraOst, new XYConstraints(360, 20, 100, -1));
    add(jlTot, new XYConstraints(150, 4, 100, -1));
    add(jlPok, new XYConstraints(255, 4, 100, -1));
    add(jlOst, new XYConstraints(360, 4, 100, -1));
    add(jlUkPv, new XYConstraints(15, 50, -1, -1));
    add(jraTotPv, new XYConstraints(150, 50, 100, -1));
    add(jraPokPv, new XYConstraints(255, 50, 100, -1));
    add(jraOstPv, new XYConstraints(360, 50, 100, -1));
    setBorder(BorderFactory.createRaisedBevelBorder());
  }
コード例 #4
0
ファイル: frmSPL.java プロジェクト: hernad/spa-erp
  private void makeRepSet(QueryDataSet obrada, QueryDataSet arhiva) {
    repSet = new StorageDataSet();
    repSet.setColumns(obrada.cloneColumns());
    repSet.open();

    repSet.insertRow(false);

    repSet.setBigDecimal(
        "SATI",
        (obrada.getBigDecimal("SATI").add(arhiva.getBigDecimal("SATI")))
            .setScale(0, java.math.BigDecimal.ROUND_HALF_UP)); // dadd
    repSet.setBigDecimal(
        "BRUTO",
        (obrada.getBigDecimal("BRUTO") /*.add(arhiva.getBigDecimal("BRUTO"))*/)
            .setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
    repSet.setBigDecimal(
        "NETO",
        (obrada.getBigDecimal("NETO").add(arhiva.getBigDecimal("NETO")))
            .setScale(0, java.math.BigDecimal.ROUND_HALF_UP)); // dadd
    repSet.setBigDecimal(
        "DOPRINOSI",
        (obrada.getBigDecimal("DOPRINOSI").add(arhiva.getBigDecimal("DOPRINOSI")))
            .setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
    repSet.setBigDecimal(
        "NETO2",
        (obrada.getBigDecimal("NETO2").add(arhiva.getBigDecimal("NETO2")))
            .setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
    repSet.setBigDecimal(
        "PORIPRIR",
        (obrada.getBigDecimal("PORIPRIR").add(arhiva.getBigDecimal("PORIPRIR")))
            .setScale(0, java.math.BigDecimal.ROUND_HALF_UP));

    //    System.out.println(obrada.getBigDecimal("BMIN") + "
    // obrada.getBigDecimal(\"BMIN\").compareTo(arhiva.getBigDecimal(\"BMIN\")) >= 0 "+
    // arhiva.getBigDecimal("BMIN")+ " ; " +
    // (obrada.getBigDecimal("BMIN").compareTo(arhiva.getBigDecimal("BMIN")) >= 0));
    //    System.out.println("arhiva.getBigDecimal(\"BMIN\").compareTo(new
    // java.math.BigDecimal(\"0.00\")) != 0 " + (arhiva.getBigDecimal("BMIN").compareTo(new
    // java.math.BigDecimal("0.00")) != 0));

    if (obrada.getBigDecimal("BMIN").compareTo(arhiva.getBigDecimal("BMIN")) <= 0
        && arhiva.getBigDecimal("BMIN").compareTo(new java.math.BigDecimal("0.00")) != 0) {
      //      System.out.println("obrada nema redova ili obrada manja oda arhive i arhiva nije
      // nula");
      repSet.setBigDecimal(
          "BMIN", arhiva.getBigDecimal("BMIN").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
    } else {
      //      System.out.println("nesto ne stima!!! ili ???");
      repSet.setBigDecimal(
          "BMIN", obrada.getBigDecimal("BMIN").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
    }

    if (obrada.getBigDecimal("BMAX").compareTo(arhiva.getBigDecimal("BMAX")) >= 0) {
      repSet.setBigDecimal(
          "BMAX", obrada.getBigDecimal("BMAX").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
      maxBrutoTableName = "kumulrad";
      primanjaBrutoTableName = "primanjaobr";
      pomocnaBrut = "orgpl";
    } else {
      repSet.setBigDecimal(
          "BMAX", arhiva.getBigDecimal("BMAX").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
      maxBrutoTableName = "kumulradarh";
      primanjaBrutoTableName = "primanjaarh";
      pomocnaBrut = "Kumulorgarh";
    }

    if (obrada.getBigDecimal("NMIN").compareTo(arhiva.getBigDecimal("NMIN")) <= 0
        && arhiva.getBigDecimal("NMIN").compareTo(new java.math.BigDecimal("0")) != 0) {
      repSet.setBigDecimal(
          "NMIN", arhiva.getBigDecimal("NMIN").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
    } else {
      repSet.setBigDecimal(
          "NMIN", obrada.getBigDecimal("NMIN").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
    }

    if (obrada.getBigDecimal("NMAX").compareTo(arhiva.getBigDecimal("NMAX")) >= 0) {
      repSet.setBigDecimal(
          "NMAX", obrada.getBigDecimal("NMAX").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
      maxNetoTableName = "kumulrad";
      primanjaNetoTableName = "primanjaobr";
      pomocnaNet = "orgpl";
    } else {
      repSet.setBigDecimal(
          "NMAX", arhiva.getBigDecimal("NMAX").setScale(0, java.math.BigDecimal.ROUND_HALF_UP));
      maxNetoTableName = "kumulradarh";
      primanjaNetoTableName = "primanjaarh";
      pomocnaNet = "Kumulorgarh";
    }
  }