Example #1
0
  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();
  }
Example #2
0
  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";
    }
  }
Example #3
0
 private void faktorizacija() {
   sds.setBigDecimal("MAT_F", faktormat);
   sds.setBigDecimal(
       "MAT_FI",
       (sds.getBigDecimal("MAT_I").multiply(faktormat).setScale(2, BigDecimal.ROUND_HALF_UP)));
   sds.setBigDecimal("PRO_F", faktorpro);
   sds.setBigDecimal(
       "PRO_FI",
       (sds.getBigDecimal("PRO_I").multiply(faktorpro).setScale(2, BigDecimal.ROUND_HALF_UP)));
   sds.setBigDecimal("ROB_F", faktorrob);
   sds.setBigDecimal(
       "ROB_FI",
       (sds.getBigDecimal("ROB_I").multiply(faktorrob).setScale(2, BigDecimal.ROUND_HALF_UP)));
   sds.setBigDecimal("USL_F", faktorusl);
   sds.setBigDecimal(
       "USL_FI",
       (sds.getBigDecimal("USL_I").multiply(faktorusl).setScale(2, BigDecimal.ROUND_HALF_UP)));
   sds.setBigDecimal("POL_F", faktorost);
   sds.setBigDecimal(
       "POL_FI",
       (sds.getBigDecimal("POL_I").multiply(faktorost).setScale(2, BigDecimal.ROUND_HALF_UP)));
   sds.setBigDecimal(
       "TOTAL",
       sds.getBigDecimal("MAT_FI")
           .add(sds.getBigDecimal("PRO_FI"))
           .add(sds.getBigDecimal("ROB_FI"))
           .add(sds.getBigDecimal("USL_FI"))
           .add(sds.getBigDecimal("POL_FI")));
 }
Example #4
0
 public void setPokriveno(BigDecimal pok) {
   tots.setBigDecimal("POK", pok);
   if (isTotalDefined()) tots.setBigDecimal("SAL", tots.getBigDecimal("TOT").subtract(pok));
 }
Example #5
0
 public void initTotalPv(BigDecimal totalPv) {
   tots.setBigDecimal("TOTPV", totalPv);
   tots.setBigDecimal("POKPV", raSaldaKonti.n0);
   tots.setBigDecimal("SALPv", totalPv);
 }
Example #6
0
 public void initTotal(BigDecimal total) {
   tots.setBigDecimal("TOT", total);
   tots.setBigDecimal("POK", raSaldaKonti.n0);
   tots.setBigDecimal("SAL", total);
 }
Example #7
0
 public void setPokrivenoPv(BigDecimal pokPv) {
   tots.setBigDecimal("POKPV", pokPv);
   if (isTotalDefined()) tots.setBigDecimal("SALPV", tots.getBigDecimal("TOTPV").subtract(pokPv));
 }