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(); }
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"))); }
public boolean Validacija() { if (!super.Validacija()) return false; rcc.EnabDisabAll(jPanel1, false); fondSati = raIzvjestaji.getFond(fieldSet.getShort("GODINAOD"), fieldSet.getShort("MJESECOD"), true) .satiUk; gomj = fieldSet.getShort("GODINAOD") * 100 + fieldSet.getShort("MJESECOD"); _od = java.sql.Timestamp.valueOf( fieldSet.getShort("GODINAOD") + "-" + fieldSet.getShort("MJESECOD") + "-01 00:00:00.00"); _do = Util.getUtil().getLastSecondOfDay(Util.getUtil().getLastDayOfMonth(_od)); /*java.sql.Timestamp.valueOf(fieldSet.getShort("GODINAOD") + "-" + fieldSet.getShort("MJESECOD") + "-31 23:59:59.99");*/ String qst1 = "select sum(kumulrad.sati) as sati, sum(kumulrad.bruto) as bruto, sum(kumulrad.neto) as neto," + " sum(kumulrad.doprinosi) as doprinosi," + " sum(kumulrad.neto2) as neto2, sum(kumulrad.poriprir) as poriprir," + " min(kumulrad.bruto) as bmin, max(kumulrad.bruto) as bmax, min(kumulrad.netopk) as nmin, " + " max(kumulrad.netopk) as nmax" + " from kumulrad, radnici where radnici.cradnik = kumulrad.cradnik " + // "AND radnici.corg = orgpl.corg " + "AND " + getWhereQuery("radnici"); // +" AND (orgpl.datumispl between '" + _od + "'"+ // " AND '" + _do + "')" ; String qst2 = "select sum(kumulradarh.sati) as sati, sum(kumulradarh.bruto) as bruto, sum(kumulradarh.neto) as neto," + " sum(kumulradarh.doprinosi) as doprinosi," + " sum(kumulradarh.neto2) as neto2, sum(kumulradarh.poriprir) as poriprir," + " min(kumulradarh.bruto) as bmin, max(kumulradarh.bruto) as bmax, min(kumulradarh.netopk) as nmin, " + " max(kumulradarh.netopk) as nmax" + " from kumulradarh, radnici, Kumulorgarh WHERE kumulradarh.cradnik = radnici.cradnik" + " AND kumulradarh.godobr = kumulorgarh.godobr AND kumulradarh.mjobr = kumulorgarh.mjobr" + " AND kumulradarh.rbrobr = kumulorgarh.rbrobr AND kumulradarh.cvro = kumulorgarh.cvro" + " AND kumulradarh.corg = kumulorgarh.corg AND radnici.corg = kumulorgarh.corg AND " + getWhereQuery("radnici") + " AND kumulorgarh.datumispl between '" + _od + "' AND '" + _do + "' "; System.out.println("\nobradaQDS query : " + qst1); System.out.println("\narhivaQDS query : " + qst2 + "\n"); QueryDataSet obradaQDS = Util.getNewQueryDataSet(qst1); QueryDataSet arhivaQDS = Util.getNewQueryDataSet(qst2); makeRepSet(obradaQDS, arhivaQDS); maxBN(); // _od, _do); bruto0 = arhivaQDS.getBigDecimal("BRUTO").setScale(0, java.math.BigDecimal.ROUND_HALF_UP); try { if (frmParam .getParam( "pl", "splbrrad", "F", "SPL: broj radnika se dobiva iz (F)onda sati ili brojanjem (R)adnika") .equalsIgnoreCase("R")) { brojRadnika = calcBrojRadnika(); } else { brojRadnika = repSet.getBigDecimal("SATI").divide(fondSati, 2, java.math.BigDecimal.ROUND_HALF_UP); } } catch (Exception ex) { ex.printStackTrace(); brojRadnika = new java.math.BigDecimal("0"); } return true; }
public BigDecimal getProIzn() { return sds.getBigDecimal("TOTAL"); }
public boolean isTotalDefined() { return tots.getBigDecimal("TOT").signum() != 0; }
public void setPokriveno(BigDecimal pok) { tots.setBigDecimal("POK", pok); if (isTotalDefined()) tots.setBigDecimal("SAL", tots.getBigDecimal("TOT").subtract(pok)); }
public BigDecimal getTotalPv() { return tots.getBigDecimal("TOTPV"); }
public BigDecimal getSaldoPv() { return tots.getBigDecimal("SALPV"); }
public BigDecimal getPokrivenoPv() { return tots.getBigDecimal("POKPV"); }
public void addPokrivenoPv(BigDecimal pokPv) { setPokrivenoPv(tots.getBigDecimal("POKPV").add(pokPv)); }
public void setPokrivenoPv(BigDecimal pokPv) { tots.setBigDecimal("POKPV", pokPv); if (isTotalDefined()) tots.setBigDecimal("SALPV", tots.getBigDecimal("TOTPV").subtract(pokPv)); }
public BigDecimal getSaldo() { return tots.getBigDecimal("SAL"); }
public void addPokriveno(BigDecimal pok) { setPokriveno(tots.getBigDecimal("POK").add(pok)); }