Package org.jallinone.purchases.suppliers.java

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


    // add to the domain about data import type:
    // - supplier items
    res = ClientUtils.getData("loadSuppliers",new GridParams());
    if (!res.isError()) {
      GridSupplierVO vo = null;
      ItemTypeVO itemTypeVO = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (GridSupplierVO)list.get(i);
        for(int j=0;j<itemTypesList.size();j++) {
          itemTypeVO = (ItemTypeVO)itemTypesList.get(j);
          ditVO = new DataImportType();
          ditVO.comboItemIndex = pos++;
          ditVO.subTypeCode = vo.getProgressiveREG04();
          ditVO.subTypeCode2 = itemTypeVO.getProgressiveHie02ITM02();
          ditVO.progressiveHIE02 = itemTypeVO.getProgressiveHie02ITM02();
          ditVO.className = ImportSupplierItemsDescriptorVO.class.getName();
          ditVO.companyCodeSys01 = vo.getCompanyCodeSys01REG04();

          dit.addDomainPair(
            ditVO,
            ClientSettings.getInstance().getResources().getResource("import")+" "+
            itemTypeVO.getDescriptionSYS10()+" "+
            ClientSettings.getInstance().getResources().getResource("for supplier")+" "+
            vo.getName_1REG04()
          );
        }
      }
    }

    // add to the domain about data import type:
    // - supplier prices
    res = ClientUtils.getData("loadSupplierPricelists",new GridParams());
    if (!res.isError()) {
      SupplierPricelistVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (SupplierPricelistVO)list.get(i);
        ditVO = new DataImportType();
        ditVO.comboItemIndex = pos++;
        ditVO.subTypeCode = vo.getPricelistCodePUR03();
        ditVO.subTypeCode2 = vo.getProgressiveReg04PUR03();
        ditVO.className = ImportSupplierPricesDescriptorVO.class.getName();
        ditVO.companyCodeSys01 = vo.getCompanyCodeSys01PUR03();

        dit.addDomainPair(
          ditVO,
          ClientSettings.getInstance().getResources().getResource("import prices")+" "+
          ClientSettings.getInstance().getResources().getResource("for supplier")+" "+
          vo.getName_1REG04()+" "+
          ClientSettings.getInstance().getResources().getResource("in pricelist")+" "+vo.getDescriptionSYS10()
        );
      }
    }

    controlImportType.setDomain(dit);
    controlImportType.addItemListener(new ItemListener() {

      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          DataImportType vo = (DataImportType)controlImportType.getValue();
          ETLProcessVO processVO = (ETLProcessVO)mainPanel.getVOModel().getValueObject();
          processVO.setCompanyCodeSys01SYS23(vo.companyCodeSys01);
          processVO.setClassNameSYS23(vo.className);
          processVO.setProgressiveHIE02(vo.progressiveHIE02);
          processVO.setSubTypeValueSYS23(vo.subTypeCode);
          processVO.setSubTypeValue2SYS23(vo.subTypeCode2);
          grid.clearData();
          grid.getOtherGridParams().put(ApplicationConsts.FILTER_VO,processVO);
          grid.reloadData();
          grid.setMode(Consts.EDIT);
          controlDescr.setValue(controlImportType.getComboBox().getSelectedItem());
        }
      }

    });


    Domain d = new Domain("FILE_TYPES");
    d.addDomainPair(XLS,"Excel");
    d.addDomainPair(CSV1,"CSV(;)");
    d.addDomainPair(CSV2,"CSV(,)");
    d.addDomainPair(TXT,"Txt file");
    controlFormat.setDomain(d);
    controlFormat.addItemListener(new ItemListener() {

      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          ETLProcessVO vo = (ETLProcessVO)getMainPanel().getVOModel().getValueObject();
          vo.setLocalFile(null);
          controlLocalFile.setText("");
          controlRemoteFile.setText("");
        }
      }
View Full Code Here


      supplierController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridSupplierVO supplierVO = (GridSupplierVO)supplierController.getLookupVO();
          JournalHeaderWithVatVO vo = (JournalHeaderWithVatVO)headerPanel.getVOModel().getValueObject();
          vo.setDebitAccountCodeAcc02PUR01(supplierVO.getDebitAccountCodeAcc02PUR01());
        }

        public void beforeLookupAction(ValueObject parentVO) {
          supplierDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
          supplierDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
View Full Code Here

      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("");
            grid.getOtherGridParams().remove(ApplicationConsts.COMPANY_CODE_SYS01);
            grid.getOtherGridParams().remove(ApplicationConsts.PROGRESSIVE_REG04);
          }
          else {
            controlCodSupplier.setValue(vo.getSupplierCodePUR01());
            controlSupplierName1.setText(vo.getName_1REG04());
            controlSupplierName2.setText(vo.getName_2REG04());
            controlCodCustomer.setValue("");
            controlCustName1.setText("");
            controlCustName2.setText("");
            grid.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
            grid.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}

      });

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

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

      final Domain d = new Domain("INVOICE_DOC_TYPES");
      d.addDomainPair("","all invoices");
      d.addDomainPair(ApplicationConsts.SALE_DESK_DOC_TYPE,"desk selling");
      d.addDomainPair(ApplicationConsts.SALE_GENERIC_INVOICE,"sale invoice");
      d.addDomainPair(ApplicationConsts.PURCHASE_GENERIC_INVOICE,"purchase invoice");
      controlDocType.setDomain(d);
      controlDocType.getComboBox().addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange() == e.SELECTED) {
            if (controlDocType.getValue()==null ||
                controlDocType.getValue().equals(""))
              grid.getOtherGridParams().remove(ApplicationConsts.DOC_TYPE);
            else
              grid.getOtherGridParams().put(ApplicationConsts.DOC_TYPE,controlDocType.getValue());
          }
        }
      });


      controlShowPayed.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          if (controlShowPayed.isSelected())
            // show all expirations: remove filter...
            grid.getOtherGridParams().remove(ApplicationConsts.PAYED);
          else
            // show NOT yet payed expirations: apply filter on "N" (not payed)
            grid.getOtherGridParams().put(ApplicationConsts.PAYED,"N");
        }
      });
//      controlShowPayed.setSelected(true);
      grid.getOtherGridParams().put(ApplicationConsts.PAYED,"N");

      colValue.setDynamicSettings(this);
      colPayedValue.setDynamicSettings(this);
      colAlreadyPayed.setDynamicSettings(this);



      Domain docTypeDomain = new Domain("DOC_TYPE");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_DOC_TYPE,"purchase invoice");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_FROM_DN_DOC_TYPE,"purchase invoice from delivery notes");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_FROM_PD_DOC_TYPE,"purchase invoice from purchase document");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_DEBIT_NOTE_DOC_TYPE,"debiting note");
      docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_GENERIC_INVOICE,"purchase generic document");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_DOC_TYPE,"sale invoice");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_FROM_DN_DOC_TYPE,"sale invoice from delivery notes");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_FROM_SD_DOC_TYPE,"sale invoice from sale document");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_CREDIT_NOTE_DOC_TYPE,"credit note");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_GENERIC_INVOICE,"sale generic document");
      docTypeDomain.addDomainPair(ApplicationConsts.SALE_DESK_DOC_TYPE,"desk selling");
      colDocType.setDomain(docTypeDomain);


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

      colRealPayTipeCode.setLookupController(payTypeController);
      colRealPayTipeCode.setControllerMethodName("getPaymentTypesList");
      payTypeController.setLookupDataLocator(payTypeDataLocator);
      payTypeController.setFrameTitle("payment types");
      payTypeController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentTypeVO");
      payTypeController.addLookup2ParentLink("paymentTypeCodeREG11", "realPaymentTypeCodeReg11DOC19");
      payTypeController.addLookup2ParentLink("descriptionSYS10","realPaymentDescriptionSYS10");
      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();
          ExpirationVO expVO = (ExpirationVO)parentVO;
          if (vo==null || vo.getAccountCodeAcc02REG11()==null) {
            expVO.setRealAccountCodeAcc02DOC19(null);
            expVO.setRealAcc02DescriptionSYS10(null);
          }
          else {
            expVO.setRealAccountCodeAcc02DOC19(vo.getAccountCodeAcc02REG11());
            expVO.setRealAcc02DescriptionSYS10(vo.getAcc02DescriptionSYS10());
          }
        }

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

      supplierController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridSupplierVO supplierVO = (GridSupplierVO)supplierController.getLookupVO();
          JournalRowVO vo = (JournalRowVO)detailPanel.getVOModel().getValueObject();
          vo.setAccountCodeAcc02ACC06(supplierVO.getDebitAccountCodeAcc02PUR01());
          vo.setAccountCodeACC06(supplierVO.getSupplierCodePUR01());
          controlScode.setValue(supplierVO.getSupplierCodePUR01());
          controlCredit.requestFocus();
        }

        public void beforeLookupAction(ValueObject parentVO) {
          supplierDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
View Full Code Here

      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

      public void codeValidated(boolean validated) {}

      public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
        ReorderFromMinStockVO vo = (ReorderFromMinStockVO)grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
        GridSupplierVO lookupVO = (GridSupplierVO)supplierController2.getLookupVO();
        if (lookupVO!=null && lookupVO.getProgressiveREG04()!=null) {
          vo.setProgressiveREG04(lookupVO.getProgressiveREG04());

          // retrieve pricelist...
          GridParams gridParams = new GridParams();
          gridParams.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,lookupVO.getProgressiveREG04());
          gridParams.getOtherGridParams().put(ApplicationConsts.DATE_FILTER,new java.sql.Date(System.currentTimeMillis()));
          gridParams.getOtherGridParams().put(ApplicationConsts.ITEM_PK,new ItemPK(vo.getCompanyCodeSys01(),vo.getItemCode()));
          Response res = ClientUtils.getData("loadSupplierPrices",gridParams);
          if (res.isError())
            vo.setPricelistCodePUR03(null);
View Full Code Here

   * Method invoked when the user has clicked on delete button and the grid is in READONLY mode.
   * @param persistentObjects value objects to delete (related to the currently selected rows)
   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecords(ArrayList persistentObjects) throws Exception {
    GridSupplierVO vo = null;
    ArrayList pks = new ArrayList();
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (GridSupplierVO)persistentObjects.get(i);
      pks.add(new SubjectPK(vo.getCompanyCodeSys01REG04(),vo.getProgressiveREG04()));
    }
    Response response = ClientUtils.getData("deleteSuppliers",pks);
    return response;
  }
View Full Code Here

TOP

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

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.