Package org.openswing.swing.message.receive.java

Examples of org.openswing.swing.message.receive.java.Response


            vo.getDocTypeDOC19().equals(ApplicationConsts.SALE_GENERIC_INVOICE))
          map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.ROUNDING_PROCEEDS_CODE);
        else
          map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.ROUNDING_COSTS_CODE);

        Response res = ClientUtils.getData("loadUserParam",map);
        if (!res.isError()) {
          String accCode = (String)((VOResponse)res).getVo();
          vo.setRoundingAccountCodeAcc02DOC19(accCode);
          gridFrame.getColRoundingAccCode().forceValidate();
        }
      }
View Full Code Here


          if (e.getStateChange()==e.SELECTED) {
            // pre-set the three codes...
            HashMap map = new HashMap();
            map.put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
            map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.LOSSPROFIT_E_ACCOUNT);
            Response res = ClientUtils.getData("loadUserParam",map);
            if (!res.isError()) {
              controlECode.setValue( ((VOResponse)res).getVo() );
              eAccountController.forceValidate();
            }
            map.put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
            map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.LOSSPROFIT_P_ACCOUNT);
            res = ClientUtils.getData("loadUserParam",map);
            if (!res.isError()) {
              controlPCode.setValue( ((VOResponse)res).getVo() );
              pAccountController.forceValidate();
            }
            map.put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
            map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.CLOSING_ACCOUNT);
            res = ClientUtils.getData("loadUserParam",map);
            if (!res.isError()) {
              controlCCode.setValue( ((VOResponse)res).getVo() );
              cAccountController.forceValidate();
            }
          }
        }
View Full Code Here

    HashMap map = new HashMap();
    map.put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
    map.put(ApplicationConsts.DATE_FILTER,controlFromDate.getValue());
    map.put(ApplicationConsts.LOSSPROFIT_E_ACCOUNT,controlECode.getValue());
    map.put(ApplicationConsts.LOSSPROFIT_P_ACCOUNT,controlPCode.getValue());
    Response res = ClientUtils.getData("endorseEAccounts",map);
    if (res.isError()) {
      JOptionPane.showMessageDialog(
          ClientUtils.getParentFrame(this),
          res.getErrorMessage(),
          ClientSettings.getInstance().getResources().getResource("Error"),
          JOptionPane.ERROR_MESSAGE
      );
    }
    else
View Full Code Here

    HashMap map = new HashMap();
    map.put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
    map.put(ApplicationConsts.DATE_FILTER,controlFromDate.getValue());
    map.put(ApplicationConsts.CLOSING_ACCOUNT,controlCCode.getValue());
    Response res = ClientUtils.getData("closePAccounts",map);
    if (res.isError()) {
      JOptionPane.showMessageDialog(
          ClientUtils.getParentFrame(this),
          res.getErrorMessage(),
          ClientSettings.getInstance().getResources().getResource("Error"),
          JOptionPane.ERROR_MESSAGE
      );
    }
    else
View Full Code Here

      values.add(serverLanguageId);

      GridParams gridParams = new GridParams();

      // read from ACC04 table...
      Response answer = CustomizeQueryUtil.getQuery(
          conn,
          new UserSessionParameters(username),
          sql,
          values,
          attribute2dbField,
          VatRegisterVO.class,
          "Y",
          "N",
          null,
          gridParams,
          true,
          customizedFields
      );
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOListResponse)answer;

    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while validating vat register code",ex);
      throw new Exception(ex.getMessage());
View Full Code Here

      ArrayList values = new ArrayList();
      values.add(serverLanguageId);
      values.add(serverLanguageId);

      // read from ACC04 table...
      Response answer = CustomizeQueryUtil.getQuery(
          conn,
          new UserSessionParameters(username),
          sql,
          values,
          attribute2dbField,
          VatRegisterVO.class,
          "Y",
          "N",
          null,
          gridParams,
          true,
          customizedFields
      );
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOListResponse)answer;

    }
    catch (Throwable ex) {
      Logger.error(username,this.getClass().getName(),"executeCommand","Error while fetching vat register list",ex);
      try {
View Full Code Here

      attribute2dbField.put("companyCodeSys01ACC04","COMPANY_CODE_SYS01");
      attribute2dbField.put("accountCodeAcc02ACC04","ACCOUNT_CODE_ACC02");
      attribute2dbField.put("registerTypeACC04","REGISTER_TYPE");
      attribute2dbField.put("readOnlyACC04","READ_ONLY");

      Response res = null;
      for(int i=0;i<list.size();i++) {
        vo = (VatRegisterVO)list.get(i);
        vo.setEnabledACC04("Y");

        // insert record in SYS10...
        progressiveSYS10 = CompanyTranslationUtils.insertTranslations(vo.getDescriptionSYS10(),vo.getCompanyCodeSys01ACC04(),username,conn);
        vo.setProgressiveSys10ACC04(progressiveSYS10);

        // insert into ACC04...
        res = CustomizeQueryUtil.insertTable(
            conn,
            new UserSessionParameters(username),
            vo,
            "ACC04_VAT_REGISTERS",
            attribute2dbField,
            "Y",
            "N",
            null,
            true,
            customizedFields
        );
        if (res.isError()) {
          throw new Exception(res.getErrorMessage());
        }
      }


      return new VOListResponse(list,false,list.size());
View Full Code Here

    Connection conn = null;
    try {
      if (this.conn==null) conn = getConn(); else conn = this.conn;
      VatRegisterVO oldVO = null;
      VatRegisterVO newVO = null;
      Response res = null;

      for(int i=0;i<oldVOs.size();i++) {
        oldVO = (VatRegisterVO)oldVOs.get(i);
        newVO = (VatRegisterVO)newVOs.get(i);

        // update SYS10 table...
        CompanyTranslationUtils.updateTranslation(newVO.getCompanyCodeSys01ACC04(),oldVO.getDescriptionSYS10(),newVO.getDescriptionSYS10(),newVO.getProgressiveSys10ACC04(),serverLanguageId,username,conn);

        HashSet pkAttrs = new HashSet();
        pkAttrs.add("companyCodeSys01ACC04");
        pkAttrs.add("vatRegisterCodeACC04");

        HashMap attribute2dbField = new HashMap();
        attribute2dbField.put("registerCodeACC04","REGISTER_CODE");
        attribute2dbField.put("progressiveSys10ACC04","PROGRESSIVE_SYS10");
        attribute2dbField.put("enabledACC04","ENABLED");
        attribute2dbField.put("companyCodeSys01ACC04","COMPANY_CODE_SYS01");
        attribute2dbField.put("accountCodeAcc02ACC04","ACCOUNT_CODE_ACC02");
        attribute2dbField.put("registerTypeACC04","REGISTER_TYPE");
        attribute2dbField.put("readOnlyACC04","READ_ONLY");

        res = new CustomizeQueryUtil().updateTable(
            conn,
            new UserSessionParameters(username),
            pkAttrs,
            oldVO,
            newVO,
            "ACC04_VAT_REGISTERS",
            attribute2dbField,
            "Y",
            "N",
            null,
            true,
            customizedFields
        );
        if (res.isError()) {
          throw new Exception(res.getErrorMessage());
        }
      }

      return new VOListResponse(newVOs,false,newVOs.size());
    }
View Full Code Here

        // retrieve vat endorse account code...
        HashMap params = new HashMap();
        params.put(ApplicationConsts.COMPANY_CODE_SYS01,companyCode);
        params.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.VAT_ENDORSE_ACCOUNT);
        Response res = userParamAction.loadUserParam(params,serverLanguageId,username);
        if (res.isError()) {
          throw new Exception(res.getErrorMessage());
        }
        String vatEndorseAccountCode = ((VOResponse)res).getVo().toString();

        SimpleDateFormat sdf = new SimpleDateFormat(t1);

        // for each vat register: create an accounting item to endorse vat amount from the register to th tresury...
        Enumeration en = lastRecordNumbers.keys();
        sql =
            "select VAT_VALUE,RECORD_NUMBER from ACC07_VAT_ROWS where COMPANY_CODE_SYS01=? and REGISTER_CODE_ACC04=? and "+
            "RECORD_NUMBER>? and VAT_DATE<=?";
        pstmt = conn.prepareStatement(sql);
        BigDecimal amount = null;
        BigDecimal newLastRN = null;
        JournalHeaderVO jhVO = null;
        JournalRowVO jrVO = null;
        String accountCode = null;

        sql = "update ACC04_VAT_REGISTERS set LAST_RECORD_NUMBER=?,LAST_VAT_DATE=?,LAST_UPDATE_USER=?,LAST_UPDATE_DATE=?  where COMPANY_CODE_SYS01=? and REGISTER_CODE=? and (LAST_RECORD_NUMBER=? || LAST_RECORD_NUMBER is null)";
        pstmt2 = conn.prepareStatement(sql);

        while(en.hasMoreElements()) {
          // retrieve total vat amount for the specified vat register...
          amount = new BigDecimal(0);
          regCode = en.nextElement().toString();
          lastRN = (BigDecimal)lastRecordNumbers.get(regCode);
          lastVD = (java.sql.Date)lastVatDates.get(regCode);
          accountCode = (String)accountCodes.get(regCode);
          pstmt.setString(1,companyCode);
          pstmt.setString(2,regCode);
          pstmt.setBigDecimal(3,lastRN);
          pstmt.setDate(4,new java.sql.Date(toDate.getTime()));
          rset = pstmt.executeQuery();
          while(rset.next()) {
            amount = amount.add(rset.getBigDecimal(1));
            newLastRN = rset.getBigDecimal(2);
          }
          rset.close();

          if (amount.doubleValue()!=0) {
            lastVD.setTime(lastVD.getTime()+86400*1000);

            // create the accounting item...
            jhVO = new JournalHeaderVO();
            jhVO.setCompanyCodeSys01ACC05(companyCode);
            jhVO.setAccountingMotiveCodeAcc03ACC05(ApplicationConsts.MOTIVE_VAT_ENDORSING);
            jhVO.setDescriptionACC05(
              t2+" "+
              regCode+" "+
              t3+" "+sdf.format(lastVD)+" - "+sdf.format(toDate)

            );
            jhVO.setItemDateACC05(new java.sql.Date(System.currentTimeMillis()));
            jhVO.setItemYearACC05(new BigDecimal(Calendar.getInstance().get(Calendar.YEAR)));

            jrVO = new JournalRowVO();
            jrVO.setCompanyCodeSys01ACC06(jhVO.getCompanyCodeSys01ACC05());
            jrVO.setAccountCodeAcc02ACC06(accountCode);
            jrVO.setAccountCodeACC06(accountCode);
            jrVO.setAccountCodeTypeACC06(ApplicationConsts.ACCOUNT_TYPE_ACCOUNT);
            jrVO.setDebitAmountACC06(amount);
            jrVO.setDescriptionACC06("");
            jrVO.setItemYearAcc05ACC06(jhVO.getItemYearACC05());
            jrVO.setProgressiveAcc05ACC06(jhVO.getProgressiveACC05());
            jhVO.addJournalRow(jrVO);

            jrVO = new JournalRowVO();
            jrVO.setCompanyCodeSys01ACC06(jhVO.getCompanyCodeSys01ACC05());
            jrVO.setAccountCodeAcc02ACC06(vatEndorseAccountCode);
            jrVO.setAccountCodeACC06(vatEndorseAccountCode);
            jrVO.setAccountCodeTypeACC06(ApplicationConsts.ACCOUNT_TYPE_ACCOUNT);
            jrVO.setCreditAmountACC06(amount);
            jrVO.setDescriptionACC06("");
            jrVO.setItemYearAcc05ACC06(jhVO.getItemYearACC05());
            jrVO.setProgressiveAcc05ACC06(jhVO.getProgressiveACC05());
            jhVO.addJournalRow(jrVO);

            res = bean.insertJournalItem(jhVO,serverLanguageId,username);
            if (res.isError()) {
              throw new Exception(res.getErrorMessage());
            }

            // update last record number in the current vat register...
            pstmt2.setBigDecimal(1,newLastRN);
            pstmt2.setDate(2,new java.sql.Date(toDate.getTime()));
            pstmt2.setString(3,username);
            pstmt2.setTimestamp(4,new java.sql.Timestamp(System.currentTimeMillis()));
            pstmt2.setString(5,companyCode);
            pstmt2.setString(6,regCode);
            pstmt2.setBigDecimal(7,lastRN);
            int upd = pstmt2.executeUpdate();
            if (upd==0) {
              return new VOResponse("Updating not performed: the record was previously updated.");
            }

          }
        }

        Response answer = new VOResponse(Boolean.TRUE);
        if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOResponse)answer;
      }
      catch (Throwable ex) {
        Logger.error(username,this.getClass().getName(),"executeCommand","Error while endorsing vat",ex);
        try {
          if (this.conn==null && conn!=null)
View Full Code Here

      CustomizedWindows cust = ((JAIOUserSessionParameters)userSessionPars).getCustomizedWindows();
      ArrayList customizedFields = cust.getCustomizedFields(ApplicationConsts.ID_VAT_REGISTERS);

      VatRegisters bean = (VatRegisters)JAIOBeanFactory.getInstance().getBean(VatRegisters.class);
      ArrayList companiesList = ((JAIOUserSessionParameters)userSessionPars).getCompanyBa().getCompaniesList("ACC04");
      Response answer = bean.loadVatRegisters(gridParams,((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername(),companiesList,customizedFields);

      return answer;
    }
    catch (Throwable ex) {
      Logger.error(userSessionPars.getUsername(),this.getClass().getName(),"executeCommand","Error while processing request",ex);
View Full Code Here

TOP

Related Classes of org.openswing.swing.message.receive.java.Response

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.