Package org.jallinone.purchases.pricelist.java

Examples of org.jallinone.purchases.pricelist.java.SupplierPricelistVO


    // 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


            Response res = ClientUtils.getData("loadSupplierPricelists",gridParams);
            if (!res.isError()) {
              java.util.List rows = ((VOListResponse)res).getRows();
              if (rows.size()>0) {
                SupplierPricelistVO pricelistVO = (SupplierPricelistVO)rows.get(0);
                controlPricelistCode.setValue(pricelistVO.getPricelistCodePUR03());
                pricelistController.forceValidate();
              }
            }
          }
        }
View Full Code Here

    colItemType.setDomain(d);
    colItemType.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          SupplierPriceVO vo = (SupplierPriceVO)pricesGrid.getVOListTableModel().getObjectForRow(pricesGrid.getSelectedRow());
          SupplierPricelistVO pricelistVO = (SupplierPricelistVO)grid.getVOListTableModel().getObjectForRow(0);
          vo.setItemCodeItm01PUR04(null);
          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
          itemDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,pricelistVO.getCompanyCodeSys01PUR03());
          itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,pricelistVO.getCompanyCodeSys01PUR03());
          itemDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_REG04,pricelistVO.getProgressiveReg04PUR03());
          itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_REG04,pricelistVO.getProgressiveReg04PUR03());
          vo.setCompanyCodeSys01PUR04(pricelistVO.getCompanyCodeSys01PUR03());
          vo.setPricelistCodePur03PUR04(pricelistVO.getPricelistCodePUR03());
        }
      }
    });
  }
View Full Code Here

  /**
   * Method invoked when pressing advanced button: it will show a dialog window to apply changes on the whole items of the current pricelist.
   */
  void advancedButton_actionPerformed(ActionEvent e) {
    if (grid.getSelectedRow()!=-1) {
      SupplierPricelistVO vo = (SupplierPricelistVO) grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
      new SupplierAdvancedOptionsDialog(this,new SupplierPricelistChanges(
          vo.getCompanyCodeSys01PUR03(),
          vo.getPricelistCodePUR03(),
          vo.getProgressiveReg04PUR03()
      ));
    }
  }
View Full Code Here

  /**
   * Method invoked when pressing import all items button: it will show a dialog window to apply specified settings on the whole imported items, inside the current pricelist.
   */
  void impAllPricesButton_actionPerformed(ActionEvent e) {
    if (grid.getSelectedRow()!=-1) {
      final SupplierPricelistVO vo = (SupplierPricelistVO) grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
      ArrayList list = new ArrayList();
      new SupplierImportItemsDialog(list,new SupplierImportItems() {
        public void saveItems(ArrayList items,Date startDate,Date endDate,BigDecimal price) {
          SupplierPricelistChanges itemsVO = new SupplierPricelistChanges(
            vo.getCompanyCodeSys01PUR03(),
            vo.getPricelistCodePUR03(),
            vo.getProgressiveReg04PUR03()
          );
          itemsVO.setStartDate(new java.sql.Date(startDate.getTime()));
          itemsVO.setEndDate(new java.sql.Date(endDate.getTime()));
          itemsVO.setDeltaValue(price);
          Response res = ClientUtils.getData("importAllSupplierItems",itemsVO);
View Full Code Here

        return true;
      }


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

          return 0;
      }


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

TOP

Related Classes of org.jallinone.purchases.pricelist.java.SupplierPricelistVO

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.