Package org.jallinone.purchases.suppliers.java

Examples of org.jallinone.purchases.suppliers.java.DetailSupplierVO


          true,
          customizedFields
      );

      if (!res.isError()) {
        DetailSupplierVO vo = (DetailSupplierVO)((VOResponse)res).getVo();
        stmt = conn.createStatement();
        if (vo.getBankCodeReg12PUR01()!=null) {
          ResultSet rset = stmt.executeQuery(
            "select DESCRIPTION from REG12_BANKS where "+
            "REG12_BANKS.BANK_CODE='"+vo.getBankCodeReg12PUR01()+"'"
          );
          if (rset.next())
            vo.setDescriptionREG12(rset.getString(1));
          rset.close();
        }


        HashMap map = new HashMap();
        map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
        LookupValidationParams pars = new LookupValidationParams(vo.getDebitAccountCodeAcc02PUR01(),map);
        Response aRes = accountAction.validateAccountCode(pars,serverLanguageId,username,companiesList,new ArrayList());
        if (!aRes.isError())
          vo.setDebitAccountDescrPUR01( ((AccountVO)((VOListResponse)aRes).getRows().get(0)).getDescriptionSYS10() );

        pars = new LookupValidationParams(vo.getCostsAccountCodeAcc02PUR01(),map);
        aRes = accountAction.validateAccountCode(pars,serverLanguageId,username,companiesList,new ArrayList());
        if (!aRes.isError())
          vo.setCostsAccountDescrPUR01( ((AccountVO)((VOListResponse)aRes).getRows().get(0)).getDescriptionSYS10() );

      }

      Response answer = res;
      if (answer.isError()) throw new Exception(answer.getErrorMessage()); else return (VOResponse)answer;
View Full Code Here


   * Callback method called when the data loading is completed.
   * @param error <code>true</code> if an error occours during data loading, <code>false</code> if data loading is successfully completed
   */
  public void loadDataCompleted(boolean error) {
    if (!error) {
      DetailSupplierVO vo = (DetailSupplierVO)detailFrame.getCurrentForm().getVOModel().getValueObject();
      detailFrame.setTitle(ClientSettings.getInstance().getResources().getResource("supplier")+" "+vo.getSupplierCodePUR01()+" - "+vo.getName_1REG04());

      detailFrame.getReferencesPanel().getGrid().getOtherGridParams().put(
          ApplicationConsts.SUBJECT_PK,
          new SubjectPK(pk.getCompanyCodeSys01REG04(),pk.getProgressiveREG04())
      );
      detailFrame.getReferencesPanel().getGrid().reloadData();
      detailFrame.getHierarchiesPanel().getGrid().getOtherGridParams().put(
          ApplicationConsts.SUBJECT_PK,
          new SubjectPK(pk.getCompanyCodeSys01REG04(),pk.getProgressiveREG04())
      );
      detailFrame.getHierarchiesPanel().getGrid().getOtherGridParams().put(
          ApplicationConsts.SUBJECT_TYPE,
          ApplicationConsts.SUBJECT_SUPPLIER
      );
      detailFrame.getHierarchiesPanel().getGrid().reloadData();

      detailFrame.getSupplierPricelistPanel().init(vo);
      detailFrame.getSupplierPricelistPanel().getGrid().getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
      detailFrame.getSupplierPricelistPanel().getGrid().getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
      detailFrame.getSupplierPricelistPanel().getGrid().reloadData();

      detailFrame.getTreePanel().reloadTree();

      detailFrame.setButtonsEnabled(true);
View Full Code Here

   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response insertRecord(ValueObject newPersistentObject) throws Exception {
    Response response = ClientUtils.getData("insertSupplier",newPersistentObject);
    if (!response.isError()) {
      DetailSupplierVO vo = (DetailSupplierVO)((VOResponse)response).getVo();
      pk = new SubjectPK(
        vo.getCompanyCodeSys01REG04(),
        vo.getProgressiveREG04()
      );
//      gridFrame.reloadData();
      detailFrame.getReferencesPanel().getGrid().getOtherGridParams().put(
          ApplicationConsts.SUBJECT_PK,
          new SubjectPK(pk.getCompanyCodeSys01REG04(),pk.getProgressiveREG04())
      );
      detailFrame.getReferencesPanel().getGrid().reloadData();
      detailFrame.getHierarchiesPanel().getGrid().getOtherGridParams().put(
          ApplicationConsts.SUBJECT_PK,
          new SubjectPK(pk.getCompanyCodeSys01REG04(),pk.getProgressiveREG04())
      );
      detailFrame.getHierarchiesPanel().getGrid().getOtherGridParams().put(
          ApplicationConsts.SUBJECT_TYPE,
          ApplicationConsts.SUBJECT_SUPPLIER
      );
      detailFrame.getHierarchiesPanel().getGrid().reloadData();

      detailFrame.getTreePanel().reloadTree();
      detailFrame.getSupplierPricelistPanel().init(vo);
      detailFrame.getSupplierPricelistPanel().getGrid().getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
      detailFrame.getSupplierPricelistPanel().getGrid().getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
      detailFrame.getSupplierPricelistPanel().getGrid().reloadData();

      detailFrame.setButtonsEnabled(true);
    }
    return response;
View Full Code Here

   * @param persistentObject value object to delete
   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecord(ValueObject persistentObject) throws Exception {
    ArrayList list = new ArrayList();
    DetailSupplierVO vo = (DetailSupplierVO)persistentObject;
    list.add(new SubjectPK(vo.getCompanyCodeSys01REG04(),vo.getProgressiveREG04()));
    Response response = ClientUtils.getData("deleteSuppliers",list);
    if (!response.isError()) {
      gridFrame.reloadData();
      detailFrame.getReferencesPanel().getGrid().clearData();
      detailFrame.getHierarchiesPanel().getGrid().clearData();
View Full Code Here

   * Callback method called by the Form panel when the Form is set to INSERT mode.
   * The method can pre-set some v.o. attributes, so that some input controls will have a predefined value associated.
   * @param persistentObject new value object
   */
  public void createPersistentObject(ValueObject PersistentObject) throws Exception {
    DetailSupplierVO vo = (DetailSupplierVO)PersistentObject;
    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
    if (applet.getAuthorizations().isOneCompany()) {
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("PUR01");
      vo.setCompanyCodeSys01REG04( companiesList.get(0).toString() );
    }

    // set default values...
    HashMap map = new HashMap();
    map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
    map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.DEBITS_ACCOUNT);
    Response response = ClientUtils.getData("loadUserParam",map);
    if (!response.isError()) {
      String code = (String)((VOResponse)response).getVo();
      vo.setDebitAccountCodeAcc02PUR01(code);
      detailFrame.getControlDebitsCode().setValue(code);
      detailFrame.getControlDebitsCode().getLookupController().forceValidate();
    }

    map.clear();
    map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
    map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.COSTS_ACCOUNT);
    response = ClientUtils.getData("loadUserParam",map);
    if (!response.isError()) {
      String code = (String)((VOResponse)response).getVo();
      vo.setCostsAccountCodeAcc02PUR01(code);
      detailFrame.getControlCostsCode().setValue(code);
      detailFrame.getControlCostsCode().getLookupController().forceValidate();
    }

  }
View Full Code Here

   */
  public Response insertRecords(int[] rowNumbers, ArrayList newValueObjects) throws Exception {
    SupplierItemVO vo = null;
    DefaultMutableTreeNode selNode = frame.getTreePanel().getSelectedNode();
    CompanyHierarchyLevelVO levelVO = (CompanyHierarchyLevelVO)selNode.getUserObject();
    DetailSupplierVO supplierVO = (DetailSupplierVO)frame.getCurrentForm().getVOModel().getValueObject();

    for(int i=0;i<newValueObjects.size();i++) {
      vo = (SupplierItemVO)newValueObjects.get(i);
      vo.setProgressiveHie02PUR02(levelVO.getProgressiveHie02HIE01());
      vo.setProgressiveHie01PUR02(levelVO.getProgressiveHIE01());
      vo.setProgressiveReg04PUR02(supplierVO.getProgressiveREG04());
    }

    return ClientUtils.getData("insertSupplierItems",newValueObjects);
  }
View Full Code Here

      ItemsFrame f = (ItemsFrame)MDIFrame.getSelectedFrame();
      int[] rows = f.getGrid().getSelectedRows();
      GridItemVO vo = null;
      SupplierItemVO suppItemVO = null;
      ArrayList list = new ArrayList();
      DetailSupplierVO supplierVO = (DetailSupplierVO)frame.getCurrentForm().getVOModel().getValueObject();
      for(int i=0;i<rows.length;i++) {
        vo = (GridItemVO)f.getGrid().getVOListTableModel().getObjectForRow(rows[i]);
        suppItemVO = new SupplierItemVO();
        suppItemVO.setCompanyCodeSys01PUR02(vo.getCompanyCodeSys01ITM01());
        suppItemVO.setDescriptionSYS10(vo.getDescriptionSYS10());
        suppItemVO.setItemCodeItm01PUR02(vo.getItemCodeITM01());
        suppItemVO.setMinPurchaseQtyPUR02(new BigDecimal(1));
        suppItemVO.setMultipleQtyPUR02(new BigDecimal(1));
        suppItemVO.setProgressiveHie01PUR02(vo.getProgressiveHie01ITM01());
        suppItemVO.setProgressiveHie02PUR02(vo.getProgressiveHie02ITM01());
        suppItemVO.setProgressiveReg04PUR02(supplierVO.getProgressiveREG04());
        suppItemVO.setSupplierItemCodePUR02(vo.getItemCodeITM01());
        suppItemVO.setUmCodeReg02PUR02(vo.getMinSellingQtyUmCodeReg02ITM01());

        list.add( suppItemVO );
      }
View Full Code Here

TOP

Related Classes of org.jallinone.purchases.suppliers.java.DetailSupplierVO

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.