Package org.jallinone.purchases.items.java

Examples of org.jallinone.purchases.items.java.SupplierItemVO


        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridItemVO vo = (GridItemVO)itemController.getLookupVO();
          if (vo.getItemCodeITM01()!=null) {
            SupplierItemVO supplierVO = (SupplierItemVO)parentVO;
            supplierVO.setSupplierItemCodePUR02(vo.getItemCodeITM01());
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}

      });



      // purchase um lookup...
      umDataLocator.setGridMethodName("loadMeasures");
      umDataLocator.setValidationMethodName("validateMeasureCode");
      colUmCode.setLookupController(umController);
      colUmCode.setControllerMethodName("getMeasureUnitsList");
      umController.setLookupDataLocator(umDataLocator);
      umController.setFrameTitle("measures");
      umController.setLookupValueObjectClassName("org.jallinone.registers.measure.java.MeasureVO");
      umController.addLookup2ParentLink("umCodeREG02", "umCodeReg02PUR02");
      umController.addLookup2ParentLink("decimalsREG02","decimalsREG02");
      umController.setAllColumnVisible(false);
      umController.setVisibleColumn("umCodeREG02", true);
      umController.setVisibleColumn("decimalsREG02", true);
      new CustomizedColumns(ApplicationConsts.ID_UM_GRID,umController);
      umController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          MeasureVO vo = (MeasureVO)umController.getLookupVO();
          if (vo.getUmCodeREG02()!=null) {
            colMinQty.setDecimals(vo.getDecimalsREG02().intValue());
            colMultipleQty.setDecimals(vo.getDecimalsREG02().intValue());
            SupplierItemVO supplierVO = (SupplierItemVO)parentVO;
            if (supplierVO.getMinPurchaseQtyPUR02()!=null)
              supplierVO.setMinPurchaseQtyPUR02(supplierVO.getMinPurchaseQtyPUR02().setScale(vo.getDecimalsREG02().intValue(),BigDecimal.ROUND_HALF_UP));
            if (supplierVO.getMultipleQtyPUR02()!=null)
              supplierVO.setMultipleQtyPUR02(supplierVO.getMultipleQtyPUR02().setScale(vo.getDecimalsREG02().intValue(),BigDecimal.ROUND_HALF_UP));
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {}
View Full Code Here


  /**
   * Method invoked when pressing import all items button: it add all items to the supplier items collection.
   */
  void impAllItemsButton_actionPerformed(ActionEvent e) {
    DetailSupplierVO vo = (DetailSupplierVO)supplierPanel.getVOModel().getValueObject();
    SupplierItemVO itemVO = new SupplierItemVO();
    itemVO.setCompanyCodeSys01PUR02(vo.getCompanyCodeSys01REG04());
    itemVO.setProgressiveReg04PUR02(vo.getProgressiveREG04());
    itemVO.setProgressiveHie02PUR02((BigDecimal)controlHierarchy.getValue());
    Response res = ClientUtils.getData("importAllItemsToSupplier",itemVO);
    if (!res.isError())
      itemsGrid.reloadData();
  }
View Full Code Here

  /**
   * 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 {
    SupplierItemVO vo = (SupplierItemVO)valueObject;
    vo.setMinPurchaseQtyPUR02(new BigDecimal(1));
    vo.setMultipleQtyPUR02(new BigDecimal(1));
  }
View Full Code Here

   * @param rowNumbers row indexes related to the new rows to save
   * @param newValueObjects list of new value objects to save
   * @return an ErrorResponse value object in case of errors, VOListResponse if the operation is successfully completed
   */
  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

   * 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 {
    SupplierItemVO vo = null;
    ArrayList pks = new ArrayList();
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (SupplierItemVO)persistentObjects.get(i);
      pks.add(new SupplierItemPK(vo.getCompanyCodeSys01PUR02(),vo.getItemCodeItm01PUR02(),vo.getProgressiveReg04PUR02()));
    }
    Response response = ClientUtils.getData("deleteSupplierItems",pks);
    return response;
  }
View Full Code Here

      // insert into PUR04...
      SupplierPriceVO vo = null;
      Response res = null;
      ArrayList items = new ArrayList();
      SupplierItemVO itemVO = new SupplierItemVO();
      items.add(itemVO);
      DetailItemVO detailItemVO = null;
      for(int i=0;i<list.size();i++) {
        vo = (SupplierPriceVO)list.get(i);

        // check if the item is already defined in a supplier-pricelist, otherwise it will be added...
        pstmt.setString(1,vo.getCompanyCodeSys01PUR04());
        pstmt.setBigDecimal(2,vo.getProgressiveReg04PUR04());
        pstmt.setString(3,vo.getItemCodeItm01PUR04());
        rset = pstmt.executeQuery();
        if (!rset.next()) {
          // item not found: it will be added...
          ItemPK pk = new ItemPK(vo.getCompanyCodeSys01PUR04(),vo.getItemCodeItm01PUR04());
          BigDecimal prog = loadItem.getProgressiveHie02ITM01(pk, username);

          res = new VOResponse(loadItem.loadItem(pk,prog,serverLanguageId,username,imagePath,new ArrayList()));
          if (res.isError()) {
            throw new Exception(res.getErrorMessage());
          }
          detailItemVO = (DetailItemVO)((VOResponse)res).getVo();
          itemVO.setCompanyCodeSys01PUR02(vo.getCompanyCodeSys01PUR04());
          itemVO.setDecimalsREG02(detailItemVO.getMinSellingQtyDecimalsREG02());
          itemVO.setItemCodeItm01PUR02(vo.getItemCodeItm01PUR04());
          itemVO.setMinPurchaseQtyPUR02(detailItemVO.getMinSellingQtyITM01());
          itemVO.setMultipleQtyPUR02(itemVO.getMinPurchaseQtyPUR02());
          itemVO.setProgressiveHie01PUR02(detailItemVO.getProgressiveHie01ITM01());
          itemVO.setProgressiveHie02PUR02(detailItemVO.getProgressiveHie02ITM01());
          itemVO.setProgressiveReg04PUR02(vo.getProgressiveReg04PUR04());
          itemVO.setSupplierItemCodePUR02(vo.getItemCodeItm01PUR04());
          itemVO.setUmCodeReg02PUR02(detailItemVO.getMinSellingQtyUmCodeReg02ITM01());

          res = insItem.insertSupplierItems(items,serverLanguageId,username,companiesList,customizedFields);
          if (res.isError()) {
            throw new Exception(res.getErrorMessage());
          }
View Full Code Here

   */
  public void saveItems(ArrayList items,Date startDate,Date endDate,BigDecimal price) {
    SupplierPricelistVO pricelistVO = (SupplierPricelistVO)panel.getGrid().getVOListTableModel().getObjectForRow(panel.getGrid().getSelectedRow());

    ArrayList persistentObjects = new ArrayList();
    SupplierItemVO vo = null;
    SupplierPriceVO priceVO = null;
    for(int i=0;i<items.size();i++) {
      vo = (SupplierItemVO)items.get(i);
      priceVO = new SupplierPriceVO();
      priceVO.setCompanyCodeSys01PUR04(vo.getCompanyCodeSys01PUR02());
      priceVO.setEndDatePUR04(new java.sql.Date(endDate.getTime()));
      priceVO.setItemCodeItm01PUR04(vo.getItemCodeItm01PUR02());
      priceVO.setItemDescriptionSYS10(vo.getDescriptionSYS10());
      priceVO.setPricelistCodePur03PUR04(pricelistVO.getPricelistCodePUR03());
      priceVO.setPricelistDescriptionSYS10(pricelistVO.getDescriptionSYS10());
      priceVO.setProgressiveHie02ITM01(vo.getProgressiveHie02PUR02());
      priceVO.setStartDatePUR04(new java.sql.Date(startDate.getTime()));
      priceVO.setProgressiveReg04PUR04(vo.getProgressiveReg04PUR02());
      priceVO.setValuePUR04(price);
      persistentObjects.add(priceVO);
    }
    Response res = ClientUtils.getData("insertSupplierPrices",persistentObjects);
    if (res.isError()) {
View Full Code Here

    if (gridId.equals(ApplicationConsts.ID_SUPPLIER_ITEMS_GRID.toString()) &&
        panel.getGrid().getSelectedRow()!=-1) {

      SupplierDetailFrame f = (SupplierDetailFrame)MDIFrame.getSelectedFrame();
      int[] rows = f.getItemsGrid().getSelectedRows();
      SupplierItemVO vo = null;
      ArrayList list = new ArrayList();
      for(int i=0;i<rows.length;i++) {
        vo = (SupplierItemVO)f.getItemsGrid().getVOListTableModel().getObjectForRow(rows[i]);
        list.add( vo );
      }
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 );
      }
      Response res = ClientUtils.getData("insertSupplierItems",list);
      frame.getItemsGrid().reloadData();
View Full Code Here

TOP

Related Classes of org.jallinone.purchases.items.java.SupplierItemVO

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.