Examples of PaymentVO


Examples of org.jallinone.expirations.java.PaymentVO

    ArrayList exp = new ArrayList();
    for(int i=0;i<frame.getGrid().getVOListTableModel().getRowCount();i++)
      exp.add( frame.getGrid().getVOListTableModel().getObjectForRow(i) );
    if (exp.size()==0)
      return new ErrorResponse("you need to specify at least one expiration");
    PaymentVO payVO = (PaymentVO)frame.getPayForm().getVOModel().getValueObject();

  // check total amount...
    BigDecimal total = new BigDecimal(0);
    PaymentDistributionVO vo = null;
    for(int i=0;i<exp.size();i++) {
      vo = (PaymentDistributionVO)exp.get(i);
      if (vo.getPaymentValueDOC28()==null)
        return new ErrorResponse("expirations must have a payment value");

      total = total.add(vo.getPaymentValueDOC28());
    }
    if ( payVO.getPaymentValueDOC27().subtract(total).doubleValue()!=0)
      return new ErrorResponse("payments specified for expirations are not equal to the total payment value");

    Response res = ClientUtils.getData("insertPayment",new Object[]{
      newPersistentObject,
      exp
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

  /**
   * Callback method invoked when the user has clicked on the insert button
   * @param valueObject empty value object just created: the user can manage it to fill some attribute values
   */
  public void createValueObject(ValueObject valueObject) throws Exception {
    PaymentVO payVO = (PaymentVO)frame.getPayForm().getVOModel().getValueObject();
    PaymentDistributionVO vo = (PaymentDistributionVO)valueObject;
    vo.setCompanyCodeSys01DOC28(payVO.getCompanyCodeSys01DOC27());
    vo.setPayedDOC28(Boolean.FALSE);
  }
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

   * @param newValue new cell value (just edited)
   * @return <code>true</code> if cell value is valid, <code>false</code> otherwise
   */
  public boolean validateCell(int rowNumber,String attributeName,Object oldValue,Object newValue) {
    PaymentDistributionVO vo = (PaymentDistributionVO)frame.getGrid().getVOListTableModel().getObjectForRow(rowNumber);
    PaymentVO payVO = (PaymentVO)frame.getPayForm().getVOModel().getValueObject();
    BigDecimal res = new BigDecimal(0);
    if (vo!=null && vo.getValueDOC19()!=null && vo.getAlreadyPayedDOC19()!=null)
      res = vo.getValueDOC19().subtract(vo.getAlreadyPayedDOC19());


    if (attributeName.equals("payedDOC28") &&
        Boolean.TRUE.equals(newValue) &&
        vo.getPaymentValueDOC28()==null
    ) {
      if (vo.getCurrencyCodeREG03().equals(payVO.getCurrencyCodeReg03DOC27()))
        vo.setPaymentValueDOC28( res );
      else {
        CurrencyConvVO convVO = null;
        for(int i=0;i<frame.getCurrConvs().size();i++) {
          convVO = (CurrencyConvVO)frame.getCurrConvs().get(i);
          if (convVO.getCurrencyCode2Reg03REG06().equals(vo.getCurrencyCodeREG03())) {
            vo.setPaymentValueDOC28( res.divide(convVO.getValueREG06(),vo.getDecimalsREG03().intValue(),BigDecimal.ROUND_HALF_UP) );
            break;
          }
        }
      }
    }
    else if (attributeName.equals("paymentValueDOC28")) {
      // check for total amount...
      BigDecimal total = new BigDecimal(0);
      if (newValue!=null)
        total = total.add((BigDecimal)newValue);
      for(int i=0;i<frame.getGrid().getVOListTableModel().getRowCount();i++) {
        vo = (PaymentDistributionVO)frame.getGrid().getVOListTableModel().getObjectForRow(i);
        if (i!=rowNumber &&
            vo.getPaymentValueDOC28()!=null)
          total = total.add(vo.getPaymentValueDOC28());
      }
      if (payVO.getPaymentValueDOC27()==null || payVO.getPaymentValueDOC27().subtract(total).doubleValue()<0)
        return false;

      vo = (PaymentDistributionVO)frame.getGrid().getVOListTableModel().getObjectForRow(rowNumber);
      if (newValue!=null) {
        BigDecimal conv = (BigDecimal)newValue;
        if (!vo.getCurrencyCodeREG03().equals(payVO.getCurrencyCodeReg03DOC27())) {
          CurrencyConvVO convVO = null;
          for(int i=0;i<frame.getCurrConvs().size();i++) {
            convVO = (CurrencyConvVO)frame.getCurrConvs().get(i);
            if (convVO.getCurrencyCode2Reg03REG06().equals(vo.getCurrencyCodeREG03())) {
              conv = conv.multiply(convVO.getValueREG06());
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

      public Response loadData(int action, int startIndex, Map filteredColumns,
                               ArrayList currentSortedColumns,
                               ArrayList currentSortedVersusColumns,
                               Class valueObjectType, Map otherGridParams) {

        PaymentVO vo = (PaymentVO)payGrid.getVOListTableModel().getObjectForRow(payGrid.getSelectedRow());
        if (vo!=null)
          return ClientUtils.getData("loadPaymentDistributions",new Object[]{
            vo.getCompanyCodeSys01DOC27(),
            vo.getProgressiveDOC27()
          });
        else
          return new VOListResponse(new ArrayList(),false,0);
      }
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

            pVO.setPaymentValueDOC28(null);
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {
          PaymentVO vo = (PaymentVO)payForm.getVOModel().getValueObject();
          expDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC27());
          expDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC27());
          expDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveReg04DOC27());
          expDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveReg04DOC27());
          expDataLocator.getLookupFrameParams().put(ApplicationConsts.PAYED,"N");
          expDataLocator.getLookupValidationParameters().put(ApplicationConsts.PAYED,"N");
          expDataLocator.getLookupFrameParams().put(ApplicationConsts.CURRENCY_CODE_REG03,vo.getCurrencyCodeReg03DOC27());
          expDataLocator.getLookupValidationParameters().put(ApplicationConsts.CURRENCY_CODE_REG03,vo.getCurrencyCodeReg03DOC27());
          expDataLocator.getLookupFrameParams().put(ApplicationConsts.DATE_FILTER,vo.getPaymentDateDOC27());
          expDataLocator.getLookupValidationParameters().put(ApplicationConsts.DATE_FILTER,vo.getPaymentDateDOC27());
        }

        public void forceValidate() {}

      });

      // banks lookup...
      bankDataLocator.setGridMethodName("loadBanks");
      bankDataLocator.setValidationMethodName("validateBankCode");
      controlBankCode.setLookupController(bankController);
      controlBankCode.setControllerMethodName("getBanksList");
      bankController.setLookupDataLocator(bankDataLocator);
      bankController.setFrameTitle("banks");
      bankController.setLookupValueObjectClassName("org.jallinone.registers.bank.java.BankVO");
      bankController.addLookup2ParentLink("bankCodeREG12", "bankCodeReg12DOC27");
      bankController.addLookup2ParentLink("descriptionREG12","descriptionREG12");
      bankController.setAllColumnVisible(false);
      bankController.setVisibleColumn("bankCodeREG12", true);
      bankController.setVisibleColumn("descriptionREG12", true);
      bankController.setPreferredWidthColumn("descriptionREG12",200);
      new CustomizedColumns(new BigDecimal(232),bankController);

      // customer lookup...
      customerDataLocator.setGridMethodName("loadCustomers");
      customerDataLocator.setValidationMethodName("validateCustomerCode");

      controlCodCustomer.setLookupController(customerController);
      controlCodCustomer.setControllerMethodName("getCustomersList");
      customerController.setLookupDataLocator(customerDataLocator);
//      customerController.setForm(filterPanel);
      customerController.setFrameTitle("customers");
      customerController.setLookupValueObjectClassName("org.jallinone.sales.customers.java.GridCustomerVO");
      customerController.setAllColumnVisible(false);
      customerController.setVisibleColumn("companyCodeSys01REG04", true);
      customerController.setVisibleColumn("customerCodeSAL07", true);
      customerController.setVisibleColumn("name_1REG04", true);
      customerController.setVisibleColumn("name_2REG04", true);
      customerController.setVisibleColumn("cityREG04", true);
      customerController.setVisibleColumn("provinceREG04", true);
      customerController.setVisibleColumn("countryREG04", true);
      customerController.setVisibleColumn("taxCodeREG04", true);
      customerController.setHeaderColumnName("cityREG04", "city");
      customerController.setHeaderColumnName("provinceREG04", "prov");
      customerController.setHeaderColumnName("countryREG04", "country");
      customerController.setHeaderColumnName("taxCodeREG04", "taxCode");
      customerController.setPreferredWidthColumn("name_1REG04", 200);
      customerController.setPreferredWidthColumn("name_2REG04", 150);
      customerController.setFramePreferedSize(new Dimension(750,500));
//      customerDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC01_ORDERS");
//      customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC01_ORDERS");
      customerController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridCustomerVO vo = (GridCustomerVO)customerController.getLookupVO();
          if (vo.getCustomerCodeSAL07()==null || vo.getCustomerCodeSAL07().equals("")) {
            controlCustName1.setText("");
            controlCustName2.setText("");
            payGrid.getOtherGridParams().remove(ApplicationConsts.COMPANY_CODE_SYS01);
            payGrid.getOtherGridParams().remove(ApplicationConsts.PROGRESSIVE_REG04);
            buttonSearch.setEnabled(false);
            payGrid.clearData();
            payForm.setMode(Consts.READONLY);
            compVO = null;

            insertButton1.setEnabled(false);
            saveButton.setEnabled(false);
            reloadButton.setEnabled(false);
            grid.clearData();
          }
          else {
            controlCodCustomer.setValue(vo.getCustomerCodeSAL07());
            controlCustName1.setText(vo.getName_1REG04());
            controlCustName2.setText(vo.getName_2REG04());
            controlCodSupplier.setValue("");
            controlSupplierName1.setText("");
            controlSupplierName2.setText("");
            payGrid.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
            payGrid.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
            buttonSearch.setEnabled(true);
            payGrid.clearData();
            payForm.setMode(Consts.READONLY);
            grid.clearData();

            Response res =  ClientUtils.getData("loadCompany",vo.getCompanyCodeSys01REG04());
            if (!res.isError())
              compVO = (OrganizationVO)((VOResponse)res).getVo();
            else
              compVO = null;

            insertButton1.setEnabled(true);
            saveButton.setEnabled(false);
            reloadButton.setEnabled(true);
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}

      });


      // supplier lookup...
      supplierDataLocator.setGridMethodName("loadSuppliers");
      supplierDataLocator.setValidationMethodName("validateSupplierCode");

      controlCodSupplier.setLookupController(supplierController);
      controlCodSupplier.setControllerMethodName("getSuppliersList");
      supplierController.setLookupDataLocator(supplierDataLocator);
//      supplierController.setForm(filterPanel);
      supplierController.setFrameTitle("suppliers");
      supplierController.setLookupValueObjectClassName("org.jallinone.purchases.suppliers.java.GridSupplierVO");
      supplierController.setAllColumnVisible(false);
      supplierController.setVisibleColumn("companyCodeSys01REG04", true);
      supplierController.setVisibleColumn("supplierCodePUR01", true);
      supplierController.setVisibleColumn("name_1REG04", true);
      supplierController.setVisibleColumn("name_2REG04", true);
      supplierController.setVisibleColumn("cityREG04", true);
      supplierController.setVisibleColumn("provinceREG04", true);
      supplierController.setVisibleColumn("countryREG04", true);
      supplierController.setVisibleColumn("taxCodeREG04", true);
      supplierController.setHeaderColumnName("name_1REG04", "corporateName1");
      supplierController.setHeaderColumnName("cityREG04", "city");
      supplierController.setHeaderColumnName("provinceREG04", "prov");
      supplierController.setHeaderColumnName("countryREG04", "country");
      supplierController.setHeaderColumnName("taxCodeREG04", "taxCode");
      supplierController.setPreferredWidthColumn("name_1REG04", 200);
      supplierController.setPreferredWidthColumn("name_2REG04", 150);
      supplierController.setFramePreferedSize(new Dimension(750,500));
//      supplierDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC06_ORDERS");
//      supplierDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"DOC06_ORDERS");
      supplierController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridSupplierVO vo = (GridSupplierVO)supplierController.getLookupVO();
          if (vo.getSupplierCodePUR01()==null || vo.getSupplierCodePUR01().equals("")) {
            controlSupplierName1.setText("");
            controlSupplierName2.setText("");
            payGrid.getOtherGridParams().remove(ApplicationConsts.COMPANY_CODE_SYS01);
            payGrid.getOtherGridParams().remove(ApplicationConsts.PROGRESSIVE_REG04);
            buttonSearch.setEnabled(false);
            payGrid.clearData();
            payForm.setMode(Consts.READONLY);

            insertButton1.setEnabled(false);
            saveButton.setEnabled(false);
            reloadButton.setEnabled(false);
          }
          else {
            controlCodSupplier.setValue(vo.getSupplierCodePUR01());
            controlSupplierName1.setText(vo.getName_1REG04());
            controlSupplierName2.setText(vo.getName_2REG04());
            controlCodCustomer.setValue("");
            controlCustName1.setText("");
            controlCustName2.setText("");
            payGrid.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
            payGrid.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
            buttonSearch.setEnabled(true);
            payGrid.clearData();
            payForm.setMode(Consts.READONLY);

            Response res =  ClientUtils.getData("loadCompany",vo.getCompanyCodeSys01REG04());
            if (!res.isError())
              compVO = (OrganizationVO)((VOResponse)res).getVo();
            else
              compVO = null;

            insertButton1.setEnabled(true);
            reloadButton.setEnabled(true);
            saveButton.setEnabled(false);
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}

      });

      controlStartDate.addDateChangedListener(new DateChangedListener() {
        public void dateChanged(Date oldDate,Date newDate) {
          if (newDate!=null)
            payGrid.getOtherGridParams().put(ApplicationConsts.START_DATE,newDate);
          else
            payGrid.getOtherGridParams().remove(ApplicationConsts.START_DATE);
        }
      });

      controlEndDate.addDateChangedListener(new DateChangedListener() {
        public void dateChanged(Date oldDate,Date newDate) {
          if (newDate!=null)
            payGrid.getOtherGridParams().put(ApplicationConsts.END_DATE,newDate);
          else
            payGrid.getOtherGridParams().remove(ApplicationConsts.END_DATE);
        }
      });


      colValueDOC27.setDynamicSettings(payGridCurrencySettings);

      colValue.setDynamicSettings(expCurrencySettings);
      colPayedValue.setDynamicSettings(payCurrencySettings);
      colAlreadyPayed.setDynamicSettings(expCurrencySettings);

      // payment lookup...
      payTypeDataLocator.setGridMethodName("loadPaymentTypes");
      payTypeDataLocator.setValidationMethodName("validatePaymentTypeCode");

      controlPayCode.setLookupController(payTypeController);
      controlPayCode.setControllerMethodName("getPaymentTypesList");
      payTypeController.setLookupDataLocator(payTypeDataLocator);
      payTypeController.setFrameTitle("payment types");
      payTypeController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentTypeVO");
      payTypeController.addLookup2ParentLink("paymentTypeCodeREG11", "paymentTypeCodeReg11DOC27");
      payTypeController.addLookup2ParentLink("descriptionSYS10","paymentDescriptionSYS10");
      payTypeController.setAllColumnVisible(false);
      payTypeController.setVisibleColumn("paymentTypeCodeREG11", true);
      payTypeController.setVisibleColumn("descriptionSYS10", true);
      new CustomizedColumns(new BigDecimal(222),payTypeController);
      payTypeController.addLookupListener(new LookupListener() {

        public void beforeLookupAction(ValueObject parentVO) {
        }

        public void codeChanged(ValueObject parentVO,
                                Collection parentChangedAttributes) {
          PaymentTypeVO vo = (PaymentTypeVO)payTypeController.getLookupVO();
          PaymentVO payVO = (PaymentVO)parentVO;
          if (vo==null || vo.getAccountCodeAcc02REG11()==null) {
            payVO.setAccountCodeAcc02DOC27(null);
            payVO.setAcc02DescriptionSYS10(null);
          }
          else {
            payVO.setAccountCodeAcc02DOC27(vo.getAccountCodeAcc02REG11());
            payVO.setAcc02DescriptionSYS10(vo.getAcc02DescriptionSYS10());
          }
        }

        public void codeValidated(boolean validated) {
        }
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

      return true;
    }


    public int getDecimals(int row) {
      PaymentVO vo = (PaymentVO)payForm.getVOModel().getValueObject();
      if (vo!=null && vo.getDecimalsREG03()!=null)
        return vo.getDecimalsREG03().intValue();
      else
        return 0;
    }
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

        return 0;
    }


    public String getCurrencySymbol(int row) {
      PaymentVO vo = (PaymentVO)payForm.getVOModel().getValueObject();
      if (vo!=null && vo.getCurrencySymbolREG03()!=null)
        return vo.getCurrencySymbolREG03();
      else
      return "E";
    }
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

      return true;
    }


    public int getDecimals(int row) {
      PaymentVO vo = (PaymentVO)payGrid.getVOListTableModel().getObjectForRow(row);
      if (vo!=null && vo.getDecimalsREG03()!=null)
        return vo.getDecimalsREG03().intValue();
      else
        return 0;
    }
View Full Code Here

Examples of org.jallinone.expirations.java.PaymentVO

        return 0;
    }


    public String getCurrencySymbol(int row) {
      PaymentVO vo = (PaymentVO)payGrid.getVOListTableModel().getObjectForRow(row);
      if (vo!=null && vo.getCurrencySymbolREG03()!=null)
        return vo.getCurrencySymbolREG03();
      else
      return "E";
    }
View Full Code Here

Examples of org.jallinone.registers.payments.java.PaymentVO

      payController.addLookupListener(new LookupListener() {

         public void codeValidated(boolean validated) {}

         public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
           PaymentVO vo = (PaymentVO)payController.getLookupVO();
           controlPayCode.setValue(vo.getPaymentCodeREG10());
           controlPayDescr.setValue(vo.getDescriptionSYS10());
         }

         public void beforeLookupAction(ValueObject parentVO) {
         }

         public void forceValidate() {}

       });


      // pricelist lookup...
      pricelistDataLocator.setGridMethodName("loadPricelists");
      pricelistDataLocator.setValidationMethodName("validatePricelistCode");
      controlPricelistCode.setLookupController(pricelistController);
      controlPricelistCode.setControllerMethodName("getSalePricesList");
      pricelistController.setLookupDataLocator(pricelistDataLocator);
//      pricelistController.setForm(form);
      pricelistController.setFrameTitle("pricelists");
      pricelistController.setLookupValueObjectClassName("org.jallinone.sales.pricelist.java.PricelistVO");
//      pricelistController.addLookup2ParentLink("pricelistCodeSAL01","pricelistCodeSal01DOC01");
//      pricelistController.addLookup2ParentLink("descriptionSYS10", "pricelistDescriptionDOC01");
//      pricelistController.addLookup2ParentLink("currencyCodeReg03SAL01","currencyCodeReg03DOC01");
      pricelistController.setAllColumnVisible(false);
      pricelistController.setVisibleColumn("pricelistCodeSAL01", true);
      pricelistController.setVisibleColumn("descriptionSYS10", true);
      pricelistController.setVisibleColumn("currencyCodeReg03SAL01", true);
      pricelistController.setPreferredWidthColumn("descriptionSYS10", 250);
      pricelistController.setFramePreferedSize(new Dimension(420,500));
      pricelistController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          PricelistVO vo = (PricelistVO)pricelistController.getLookupVO();
          controlPricelistCode.setValue(vo.getPricelistCodeSAL01());
          controlPricelistDescr.setValue(vo.getDescriptionSYS10());
          controlCurrencyCode.setValue(vo.getCurrencyCodeReg03SAL01());
        }

        public void beforeLookupAction(ValueObject parentVO) {
        }

        public void forceValidate() {}

      });


      // initialize pricelist lookup parameters...
      DetailCallOutRequestVO vo = (DetailCallOutRequestVO)frame.getCalloutPanel().getVOModel().getValueObject();
      pricelistDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      pricelistDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      wareDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      wareDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());


      // credit account code lookup...
      creditDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      creditDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      controlCreditsCode.setLookupController(creditController);
      controlCreditsCode.setControllerMethodName("getAccounts");
      creditController.setLookupDataLocator(creditDataLocator);
      creditDataLocator.setGridMethodName("loadAccounts");
      creditDataLocator.setValidationMethodName("validateAccountCode");
      creditController.setFrameTitle("accounts");
      creditController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
//      creditController.addLookup2ParentLink("accountCodeACC02", "creditAccountCodeAcc02SAL07");
//      creditController.addLookup2ParentLink("descriptionSYS10","creditAccountDescrSAL07");
      creditController.setFramePreferedSize(new Dimension(400,400));
      creditController.setAllColumnVisible(false);
      creditController.setVisibleColumn("accountCodeACC02", true);
      creditController.setVisibleColumn("descriptionSYS10", true);
      creditController.setPreferredWidthColumn("accountCodeACC02", 100);
      creditController.setPreferredWidthColumn("descriptionSYS10", 290);
      creditController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)creditController.getLookupVO();
          controlCreditsCode.setValue(vo.getAccountCodeACC02());
          controlCreditsDescr.setValue(vo.getDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) {
        }

        public void forceValidate() {}

      });


      // items account code lookup...
      itemsDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      itemsDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      controlItemsCode.setLookupController(itemsController);
      controlItemsCode.setControllerMethodName("getAccounts");
      itemsController.setLookupDataLocator(itemsDataLocator);
      itemsDataLocator.setGridMethodName("loadAccounts");
      itemsDataLocator.setValidationMethodName("validateAccountCode");
      itemsController.setFrameTitle("accounts");
      itemsController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
//      itemsController.addLookup2ParentLink("accountCodeACC02", "itemsAccountCodeAcc02SAL07");
//      itemsController.addLookup2ParentLink("descriptionSYS10","itemsAccountDescrSAL07");
      itemsController.setFramePreferedSize(new Dimension(400,400));
      itemsController.setAllColumnVisible(false);
      itemsController.setVisibleColumn("accountCodeACC02", true);
      itemsController.setVisibleColumn("descriptionSYS10", true);
      itemsController.setPreferredWidthColumn("accountCodeACC02", 100);
      itemsController.setPreferredWidthColumn("descriptionSYS10", 290);
      itemsController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)itemsController.getLookupVO();
          controlItemsCode.setValue(vo.getAccountCodeACC02());
          controlItemsDescr.setValue(vo.getDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) { }

        public void forceValidate() {}

      });


      // activities account code lookup...
      actDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      actDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      controlActCode.setLookupController(actController);
      controlActCode.setControllerMethodName("getAccounts");
      actController.setLookupDataLocator(actDataLocator);
      actDataLocator.setGridMethodName("loadAccounts");
      actDataLocator.setValidationMethodName("validateAccountCode");
      actController.setFrameTitle("accounts");
      actController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
//      actController.addLookup2ParentLink("accountCodeACC02", "activitiesAccountCodeAcc02SAL07");
//      actController.addLookup2ParentLink("descriptionSYS10","activitiesAccountDescrSAL07");
      actController.setFramePreferedSize(new Dimension(400,400));
      actController.setAllColumnVisible(false);
      actController.setVisibleColumn("accountCodeACC02", true);
      actController.setVisibleColumn("descriptionSYS10", true);
      actController.setPreferredWidthColumn("accountCodeACC02", 100);
      actController.setPreferredWidthColumn("descriptionSYS10", 290);
      actController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)actController.getLookupVO();
          controlActCode.setValue(vo.getAccountCodeACC02());
          controlActDescr.setValue(vo.getDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) { }

        public void forceValidate() {}

      });


      // charges account code lookup...
      chargesDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      chargesDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      controlChargesCode.setLookupController(chargesController);
      controlChargesCode.setControllerMethodName("getAccounts");
      chargesController.setLookupDataLocator(chargesDataLocator);
      chargesDataLocator.setGridMethodName("loadAccounts");
      chargesDataLocator.setValidationMethodName("validateAccountCode");
      chargesController.setFrameTitle("accounts");
      chargesController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
//      chargesController.addLookup2ParentLink("accountCodeACC02", "chargesAccountCodeAcc02SAL07");
//      chargesController.addLookup2ParentLink("descriptionSYS10","chargesAccountDescrSAL07");
      chargesController.setFramePreferedSize(new Dimension(400,400));
      chargesController.setAllColumnVisible(false);
      chargesController.setVisibleColumn("accountCodeACC02", true);
      chargesController.setVisibleColumn("descriptionSYS10", true);
      chargesController.setPreferredWidthColumn("accountCodeACC02", 100);
      chargesController.setPreferredWidthColumn("descriptionSYS10", 290);
      chargesController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          AccountVO vo = (AccountVO)chargesController.getLookupVO();
          controlChargesCode.setValue(vo.getAccountCodeACC02());
          controlChargesDescr.setValue(vo.getDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) { }

        public void forceValidate() {}

      });


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

      map.clear();
      map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.ITEMS_ACCOUNT);
      response = ClientUtils.getData("loadUserParam",map);
      if (!response.isError()) {
        String code = (String)((VOResponse)response).getVo();
        controlItemsCode.setValue(code);
        controlItemsCode.getLookupController().forceValidate();
      }

      map.clear();
      map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.ACTIVITIES_ACCOUNT);
      response = ClientUtils.getData("loadUserParam",map);
      if (!response.isError()) {
        String code = (String)((VOResponse)response).getVo();
        controlActCode.setValue(code);
        controlActCode.getLookupController().forceValidate();
      }

      map.clear();
      map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
      map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.CHARGES_ACCOUNT);
      response = ClientUtils.getData("loadUserParam",map);
      if (!response.isError()) {
        String code = (String)((VOResponse)response).getVo();
        controlChargesCode.setValue(code);
        controlChargesCode.getLookupController().forceValidate();
      }


      // check if there exist a customer with the specified progressive in REG04...
      String subjectTypeREG04 = null;
      if (vo.getSubjectTypeReg04SCH03().equals(ApplicationConsts.SUBJECT_ORGANIZATION))
        subjectTypeREG04 = ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER;
      else
        subjectTypeREG04 = ApplicationConsts.SUBJECT_PEOPLE_CUSTOMER;
      CustomerPK pk = new CustomerPK(vo.getCompanyCodeSys01SCH03(),vo.getProgressiveReg04SCH03(),subjectTypeREG04);
      Response res = ClientUtils.getData("loadCustomer",pk);
      if (!res.isError()) {
        if (subjectTypeREG04.equals(ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER)) {
          OrganizationCustomerVO custVO = (OrganizationCustomerVO)((VOResponse)res).getVo();
          controlCustCode.setValue(custVO.getCustomerCodeSAL07());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.