Package org.jallinone.items.java

Examples of org.jallinone.items.java.ItemTypeVO


   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      itemTypesList = ((VOListResponse)res).getRows();
      for(int i=0;i<itemTypesList.size();i++) {
        vo = (ItemTypeVO)itemTypesList.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    comboBoxControl1.setDomain(d);
    comboBoxControl1.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          ItemTypeVO vo = (ItemTypeVO)itemTypesList.get(comboBoxControl1.getSelectedIndex());
          hierarTreePanel.setCompanyCode(vo.getCompanyCodeSys01ITM02());
          hierarTreePanel.setProgressiveHIE02((BigDecimal)comboBoxControl1.getValue());
          hierarTreePanel.reloadTree();
          grid.clearData();
        }
      }
View Full Code Here


  private void init() {

      Response res = ClientUtils.getData("loadItemTypes",new GridParams());
      final Domain d = new Domain("ITEM_TYPES");
      if (!res.isError()) {
        ItemTypeVO vo = null;
        itemTypes = ((VOListResponse)res).getRows();
        for(int i=0;i<itemTypes.size();i++) {
          vo = (ItemTypeVO)itemTypes.get(i);
          d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
        }
      }
      controlItemType.setDomain(d);
      controlItemType.getComboBox().addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange() == e.SELECTED) {
            int selIndex = ( (JComboBox) e.getSource()).getSelectedIndex();
            Object selValue = d.getDomainPairList()[selIndex].getCode();
            ItemTypeVO vo = (ItemTypeVO)itemTypes.get(controlItemType.getSelectedIndex());

            treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM02());
            treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, selValue);
          }
        }
      });


      // item code lookup...
      itemDataLocator.setGridMethodName("loadItems");
      itemDataLocator.setValidationMethodName("validateItemCode");

      controlItem.setLookupController(itemController);
      controlItem.setControllerMethodName("getItemsList");
      itemController.setForm(filterPanel);
      itemController.setLookupDataLocator(itemDataLocator);
      itemController.setFrameTitle("items");

      itemController.setCodeSelectionWindow(itemController.TREE_GRID_FRAME);
      treeLevelDataLocator.setServerMethodName("loadCompanyHierarchy");
      itemDataLocator.setTreeDataLocator(treeLevelDataLocator);
      itemDataLocator.setNodeNameAttribute("descriptionSYS10");

      itemController.setLookupValueObjectClassName("org.jallinone.items.java.GridItemVO");
      itemController.addLookup2ParentLink("itemCodeITM01", "itemCode");

      itemController.setAllColumnVisible(false);
      itemController.setVisibleColumn("itemCodeITM01", true);
      itemController.setVisibleColumn("descriptionSYS10", true);
      itemController.setPreferredWidthColumn("descriptionSYS10", 250);
      itemController.setFramePreferedSize(new Dimension(680,500));
      itemController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          if (itemController.getLookupVO()==null) {
            controlITemDescr.setText("");
          }
          else {
            GridItemVO vo = (GridItemVO)itemController.getLookupVO();
            controlITemDescr.setText(vo.getDescriptionSYS10());
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {
          itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,controlItemType.getValue());
          itemController.getLookupDataLocator().getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlComp.getValue());
          itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,controlItemType.getValue());
          itemController.getLookupDataLocator().getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlComp.getValue());
        }

        public void forceValidate() {}

      });



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

      controlCust.setLookupController(customerController);
      controlCust.setControllerMethodName("getCustomersList");
      customerController.setForm(filterPanel);
      customerController.setLookupDataLocator(customerDataLocator);
      customerController.setFrameTitle("customers");
      customerController.setLookupValueObjectClassName("org.jallinone.sales.customers.java.GridCustomerVO");
      customerController.addLookup2ParentLink("customerCodeSAL07","customerCode");
      customerController.setAllColumnVisible(false);
      customerController.setVisibleColumn("companyCodeSys01REG04", true);
      customerController.setFilterableColumn("companyCodeSys01REG04", true);
      customerController.setFilterableColumn("customerCodeSAL07", true);
      customerController.setFilterableColumn("name_1REG04", true);
      customerController.setFilterableColumn("name_2REG04", true);
      customerController.setFilterableColumn("cityREG04", true);
      customerController.setFilterableColumn("provinceREG04", true);

      customerController.setSortableColumn("companyCodeSys01REG04", true);
      customerController.setSortableColumn("customerCodeSAL07", true);
      customerController.setSortableColumn("name_1REG04", true);
      customerController.setSortableColumn("name_2REG04", true);
      customerController.setSortableColumn("cityREG04", true);
      customerController.setSortableColumn("provinceREG04", 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));
      customerController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          if (customerController.getLookupVO()==null) {
            controlCustName1.setText("");
            controlCustName2.setText("");
          }
          else {
            GridCustomerVO vo = (GridCustomerVO)customerController.getLookupVO();
            controlCustName1.setText(vo.getName_1REG04());
            controlCustName2.setText(vo.getName_2REG04());
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {
          customerDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlComp.getValue());
          customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlComp.getValue());
        }

        public void forceValidate() {}

      });




      pivotTable.setController(new PivotTableController(){

        public Response getPivotTableModel(PivotTableParameters pars) {
          filterPanel.pull();
          SalesPivotVO vo= (SalesPivotVO)filterPanel.getVOModel().getValueObject();
          vo.setPivotPars(pars);
          pars.setInputFilter(new InputFilter());
          Response res = ClientUtils.getData("salesPivot",vo);
          if (res.isError())
            OptionPane.showMessageDialog(SalesPivotFrame.this,res.getErrorMessage(),"Error while loading data",JOptionPane.ERROR_MESSAGE);
          return res;
        }

      });

      RowField rowFieldItem = new RowField("itemCodeItm01DOC02",100);
      RowField rowFieldCustomer = new RowField("customerCodeSAL07",150);
      RowField rowFieldWarehouse = new RowField("warehouseCodeWar01DOC01",100);

      pivotTable.getAllRowFields().add(rowFieldItem);
      pivotTable.getAllRowFields().add(rowFieldCustomer);
      pivotTable.getAllRowFields().add(rowFieldWarehouse);

      pivotTable.addRowField(rowFieldWarehouse);
//      pivotTable.addRowField(rowFieldItem);

      ColumnField columnFieldYear = new ColumnField("docDateDOC01","year",new YearAggregator());
      ColumnField columnFieldQuarter = new ColumnField("docDateDOC01","quarter",new QuarterAggregator());

      pivotTable.getAllColumnFields().add(columnFieldYear);
      pivotTable.getAllColumnFields().add(columnFieldQuarter);

      pivotTable.addColumnField(columnFieldYear);
      pivotTable.addColumnField(columnFieldQuarter);

      NumberFormat nf = NumberFormat.getCurrencyInstance();
      Currency currency = Currency.getInstance(Locale.getDefault()); // to review...
      nf.setCurrency(currency);
      nf.setMaximumFractionDigits(2);
      nf.setMinimumFractionDigits(2);
      nf.setGroupingUsed(true);

      DataField dataFieldTotal = new DataField("totalDOC01",80,"sellAmount",new SumFunction()); // sum function...
      dataFieldTotal.setFormatter(nf);

      NumberFormat nf2 = NumberFormat.getIntegerInstance();

      DataField dataFieldItemQty = new DataField("qtyDOC02",80,"sellQty",new SumFunction()); // sum function...
      dataFieldItemQty.setFormatter(nf2);

      pivotTable.getAllDataFields().add(dataFieldTotal);
      pivotTable.getAllDataFields().add(dataFieldItemQty);
      pivotTable.addDataField(dataFieldTotal);


      pivotTable.setDataFieldRenderer(new DataFieldRenderer() {

        /**
         * @param currentColor current color to set
         * @param rowPath GenericNodeKey row fields path that identify current row
         * @param colPath GenericNodeKey column fields path that identify current column
         * @param value value to show in the specified cell
         * @param row current row
         * @param col current column
         * @return Color background color to set
         */
        public Color getBackgroundColor(Color currentColor,GenericNodeKey rowPath,GenericNodeKey colPath,Object value,int row,int col) {
          if (rowPath.getPath().length<pivotTable.getPivotTableParameters().getRowFields().size() ||
              colPath.getPath().length<pivotTable.getPivotTableParameters().getColumnFields().size()+1) {
            int c = 200+rowPath.getPath().length*colPath.getPath().length*5;
            return new Color(c,c,c);
          }
          return currentColor;
        }


        /**
         * @param currentColor current color to set
         * @param rowPath GenericNodeKey row fields path that identify current row
         * @param colPath GenericNodeKey column fields path that identify current column
         * @param value value to show in the specified cell
         * @param row current row
         * @param col current column
         * @return Color foreground color to set
         */
        public Color getForegroundColor(Color currentColor,GenericNodeKey rowPath,GenericNodeKey colPath,Object value,int row,int col) {
          return currentColor;
        }


        /**
         * @param currentFont current font to set
         * @param rowPath GenericNodeKey row fields path that identify current row
         * @param colPath GenericNodeKey column fields path that identify current column
         * @param value value to show in the specified cell
         * @param row current row
         * @param col current column
         * @return font to set
         */
        public Font getFont(Font currentFont,GenericNodeKey rowPath,GenericNodeKey colPath,Object value,int row,int col) {
          if (rowPath.getPath().length<pivotTable.getPivotTableParameters().getRowFields().size() ||
              colPath.getPath().length<pivotTable.getPivotTableParameters().getColumnFields().size()+1)
            return new Font(currentFont.getFontName(),Font.BOLD,currentFont.getSize());
          return currentFont;
        }

      });



      controlComp.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
          Object companyCodeSys01 = controlComp.getValue();
          if (companyCodeSys01==null)
            companyCodeSys01 = controlComp.getDomain().getDomainPairList()[0].getCode();

          SalesPivotVO vo= (SalesPivotVO)filterPanel.getVOModel().getValueObject();
          vo.setCompanyCode((String)companyCodeSys01);
        }

      });

  }
View Full Code Here

   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
  }
View Full Code Here

   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    comboBoxControl1.setDomain(d);
    comboBoxControl1.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          ItemTypeVO vo = (ItemTypeVO)list.get(comboBoxControl1.getSelectedIndex());
          hierarTreePanel.setCompanyCode(vo.getCompanyCodeSys01ITM02());
          hierarTreePanel.setProgressiveHIE02((BigDecimal)comboBoxControl1.getValue());
          hierarTreePanel.reloadTree();
          discountsGrid.clearData();
        }
      }
View Full Code Here

   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
  }
View Full Code Here

   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
  }
View Full Code Here

    });

    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
    controlItemType.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED && detailPanel.getMode()!=Consts.READONLY) {
          DetailSaleDocRowVO vo = (DetailSaleDocRowVO)detailPanel.getVOModel().getValueObject();
          vo.setItemCodeItm01DOC02(null);
          vo.setDescriptionSYS10(null);
          vo.setMinSellingQtyUmCodeReg02DOC02(null);
          vo.setVatCodeItm01DOC02(null);
          vo.setVatDescriptionDOC02(null);
          vo.setDeductibleReg01DOC02(null);
          vo.setValueReg01DOC02(null);
          vo.setValueSal02DOC02(null);
          vo.setQtyDOC02(null);

          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC02());
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);

          detailPanel.pull(controlItemCode.getAttributeName());
          try {
            controlItemCode.validateCode(null);
View Full Code Here

    // retrieve item types and fill in the item types combo box and set buttons disabilitation...
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
    controlItemType.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          ItemToPrintVO vo = (ItemToPrintVO)itemPanel.getVOModel().getValueObject();
          vo.setItemCodeItm01(null);
          vo.setDescriptionSYS10(null);
          vo.setQty(null);

          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);
View Full Code Here

    });

    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    final Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      java.util.List list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlItemType.setDomain(d);
    controlItemType.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED && detailPanel.getMode()!=Consts.READONLY) {
          DetailSaleDocRowVO vo = (DetailSaleDocRowVO)detailPanel.getVOModel().getValueObject();
          vo.setItemCodeItm01DOC02(null);
          vo.setDescriptionSYS10(null);
          vo.setMinSellingQtyUmCodeReg02DOC02(null);
          vo.setVatCodeItm01DOC02(null);
          vo.setVatDescriptionDOC02(null);
          vo.setDeductibleReg01DOC02(null);
          vo.setValueReg01DOC02(null);
          vo.setValueSal02DOC02(null);
          vo.setQtyDOC02(null);

          int selIndex = ((JComboBox)e.getSource()).getSelectedIndex();
          Object selValue = d.getDomainPairList()[selIndex].getCode();
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC02());
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,selValue);

          detailPanel.pull(controlItemCode.getAttributeName());
          try {
            controlItemCode.validateCode(null);
View Full Code Here

   */
  private void init() {
    Response res = ClientUtils.getData("loadItemTypes",new GridParams());
    Domain d = new Domain("ITEM_TYPES");
    if (!res.isError()) {
      ItemTypeVO vo = null;
      list = ((VOListResponse)res).getRows();
      for(int i=0;i<list.size();i++) {
        vo = (ItemTypeVO)list.get(i);
        d.addDomainPair(vo.getProgressiveHie02ITM02(),vo.getDescriptionSYS10());
      }
    }
    controlHierarchy.setDomain(d);
    controlHierarchy.getComboBox().addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange()==e.SELECTED) {
          ItemTypeVO typeVO = (ItemTypeVO)list.get(controlHierarchy.getSelectedIndex());
          treePanel.setCompanyCode(typeVO.getCompanyCodeSys01ITM02());
          treePanel.setProgressiveHIE02((BigDecimal)controlHierarchy.getValue());
          DetailSupplierVO vo = (DetailSupplierVO)supplierPanel.getVOModel().getValueObject();
          treePanel.setCompanyCode(vo.getCompanyCodeSys01REG04());
          treePanel.reloadTree();
          itemsGrid.clearData();
View Full Code Here

TOP

Related Classes of org.jallinone.items.java.ItemTypeVO

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.