private void difoltMjGod() throws NumberFormatException { raIniciranje.getInstance().posOrgsPl(hr.restart.zapod.OrgStr.getKNJCORG()); fieldSet.setShort( "GODINAOD", Short.parseShort(Util.getUtil().getYear(dm.getOrgpl().getTimestamp("DATUMISPL")))); fieldSet.setShort( "MJESECOD", Short.parseShort(Util.getUtil().getMonth(dm.getOrgpl().getTimestamp("DATUMISPL")))); }
private void setKnjigovodstvo() { String knjigovodstvo = "SELECT Orgstruktura.naziv, Orgstruktura.mjesto, Orgstruktura.adresa, Orgstruktura.hpbroj, Orgstruktura.ziro, " + (raObracunPL.isOIB() ? "Logotipovi.oib" : "Logotipovi.matbroj") + " AS MATBROJ" + ", Logotipovi.sifdjel " + "FROM Orgstruktura, Logotipovi " + "WHERE orgstruktura.corg = logotipovi.corg and orgstruktura.corg ='" + hr.restart.zapod.OrgStr.getKNJCORG() + "'"; knjig = Util.getNewQueryDataSet(knjigovodstvo); }
public String getNSPRAVOSOB() { String nspo = ""; if (lookupData .getlookupData() .raLocate(dm.getOrgstruktura(), "CORG", hr.restart.zapod.OrgStr.getKNJCORG())) { nspo = dm.getOrgstruktura().getString("NAZIV") + ", " + dm.getOrgstruktura().getString("ADRESA") + ", " + dm.getOrgstruktura().getString("HPBROJ") + " " + dm.getOrgstruktura().getString("MJESTO"); } else nspo = rpm.getFirstLine() + " " + rpm.getSecondLine() + ", " + rpm.getThirdLine(); return nspo; }
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; }
public File getAttachment() { File dir = new File(System.getProperty("user.dir") + File.separator + "dumps"); if (dir.exists() && !dir.isDirectory()) dir.delete(); if (!dir.exists()) dir.mkdir(); QueryDataSet knjs = Orgstruktura.getDataModule().getKnjig(); knjs.open(); lookupData.getlookupData().raLocate(knjs, "CORG", OrgStr.getKNJCORG()); String prefix = getMailProperties().getProperty("dump.name", knjs.getString("NAZIV")); String dumpFileName = dir.getAbsolutePath() + File.separator + prefix + "-dbdump-" + new java.sql.Date(System.currentTimeMillis()) + ".zi_"; File plainDumpFile = new File(dumpFileName + "__plain.tmp"); File dumpFile = new File(dumpFileName); raDbaseCreator.dumpTo(plainDumpFile); DesEncrypter enc = new DesEncrypter(getFrom()); enc.encrypt(plainDumpFile, dumpFile); return dumpFile; }
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; }
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(); } }); }