Package com.openbravo.pos.ticket

Examples of com.openbravo.pos.ticket.CategoryInfo


   
    private void showRootCategoriesPanel() {
       
        selectIndicatorCategories();
        // Show selected root category
        CategoryInfo cat = (CategoryInfo) m_jListCategories.getSelectedValue();
       
        if (cat != null) {
            selectCategoryPanel(cat.getID());
        }
        showingcategory = null;
        if(listOfCategories != null)
            this.listOfCategories.clear();
    }
View Full Code Here


    }//GEN-LAST:event_m_btnBack1ActionPerformed

    private void m_jListCategoriesValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_m_jListCategoriesValueChanged

        if (!evt.getValueIsAdjusting()) {
            CategoryInfo cat = (CategoryInfo) m_jListCategories.getSelectedValue();
            if (cat != null) {
                selectCategoryPanel(cat.getID());
            }
        }
    }//GEN-LAST:event_m_jListCategoriesValueChanged
View Full Code Here

    private class SmallCategoryRenderer extends DefaultListCellRenderer {

        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
            CategoryInfo cat = (CategoryInfo) value;
            setText(cat.getName());
            setIcon(new ImageIcon(tnbcat.getThumbNail(cat.getImage())));
            return this;
        }     
View Full Code Here

    // Sync categories : download.
      Categorie[] cats = externalsales.getCategories();
     
      for (Categorie categorie : cats) {

        CategoryInfo addCategory = new CategoryInfo(categorie.getId(), externalsales.encodeString(categorie.getName()), null);
        try {
          dlintegration.syncCategory(addCategory);
         
        } catch (BasicException be) {
        //  be.printStackTrace();
        }
        notToSync.put(categorie.getName(),categorie.getId());
      }
   
// UPLOAD CATEGORIES NOT USED YET (should be on creation only with ID sync !)     
      SentenceList localCatsList = dlsales.getCategoriesList();
     
      List<CategoryInfo> localCats = localCatsList.list();
     
      for (CategoryInfo localCat : localCats) {
       
                               
                                if (dlintegration.getCategoryCount(localCat.getName())==0.0){
                                    continue;
                                }
                                   
        if (notToSync.containsKey(localCat.getName())) {
          continue;
        }
       
        Categorie category = new Categorie();
        category.setId(localCat.getID());
        category.setName(localCat.getName());
        category.setImage("");
        category.setDescription(localCat.getName());
        category.setParentcat("");
        category.setNumberofproducts("");
        category.setProducts_per_row("1");
        category.setFullimage("");
        category.setCategory_publish("Y");
        category.setCategory_browsepage("");
        category.setCategory_flypage("");
     
        externalsales.addCategory(category);
       
      }
     
      cats = externalsales.getCategories();

      HashMap<String, String> catList = new HashMap<String, String>();
      HashMap<String, String> catListRev = new HashMap<String, String>();
     
     
      for (Categorie cat: cats) {
        Iterator<CategoryInfo> it = localCats.iterator();
        while (it.hasNext()) {
          CategoryInfo ci = it.next();
          if (ci.getName().equalsIgnoreCase(cat.getName())) {
            catList.put(ci.getID() , cat.getId());
            catListRev.put(cat.getId(), ci.getID());
//            localCats.remove(ci);
            break;
          }
         
        }
View Full Code Here

        return vos.get(0).getId();
    }

    @Override
    protected CategoryInfo map2VO(ResultSet rs) throws SQLException {
        CategoryInfo category = new CategoryInfo();
        category.setId(rs.getString("id"));
        category.setParentid(rs.getString("parentid"));
        category.setName(rs.getString("name"));

        return category;
    }
View Full Code Here

    // Sync categories : download.
      Categorie[] cats = externalsales.getCategories();
     
      for (Categorie categorie : cats) {

        CategoryInfo addCategory = new CategoryInfo(categorie.getId(), externalsales.encodeStringISO(categorie.getName()), null);
        try {
          dlintegration.syncCategory(addCategory);
         
        } catch (BasicException be) {
        //  be.printStackTrace();
        }
        notToSync.put(categorie.getName(),categorie.getId());
      }
   
// UPLOAD CATEGORIES NOT USED YET (should be on creation only with ID sync !)     
      SentenceList localCatsList = dlsales.getCategoriesList();
     
      List<CategoryInfo> localCats = localCatsList.list();
     
      for (CategoryInfo localCat : localCats) {
       
                               
                                if (dlintegration.getCategoryCount(localCat.getName())==0.0){
                                    continue;
                                }
                                   
        if (notToSync.containsKey(localCat.getName())) {
          continue;
        }
       
        Categorie category = new Categorie();
        category.setId(localCat.getID());
        category.setName(localCat.getName());
        category.setImage("");
        category.setDescription(localCat.getName());
        category.setParentcat("");
        category.setNumberofproducts("");
        category.setProducts_per_row("1");
        category.setFullimage("");
        category.setCategory_publish("Y");
        category.setCategory_browsepage("");
        category.setCategory_flypage("");
     
        externalsales.addCategory(category);
       
      }
     
      cats = externalsales.getCategories();

      HashMap<String, String> catList = new HashMap<String, String>();
      HashMap<String, String> catListRev = new HashMap<String, String>();
     
     
      for (Categorie cat: cats) {
        Iterator<CategoryInfo> it = localCats.iterator();
        while (it.hasNext()) {
          CategoryInfo ci = it.next();
          if (ci.getName().equalsIgnoreCase(cat.getName())) {
            catList.put(ci.getID() , cat.getId());
            catListRev.put(cat.getId(), ci.getID());
//            localCats.remove(ci);
            break;
          }
         
        }
View Full Code Here

                            false,
                            0);
                    dlintegration.syncTax(t);
                  
                    // Synchonization of categories
                    CategoryInfo c = new CategoryInfo(product.getCategory().getId(), product.getCategory().getName(), null);
                    dlintegration.syncCategory(c);

                    // Synchonization of products
                    ProductInfoExt p = new ProductInfoExt();
                    p.setID(product.getId());
                    p.setReference(product.getId());
                    p.setCode(product.getEan() == null || product.getEan().equals("") ? product.getId() : product.getEan());
                    p.setName(product.getName());
                    p.setCom(false);
                    p.setScale(false);
                    p.setPriceBuy(product.getPurchasePrice());
                    p.setPriceSell(product.getListPrice());
                    p.setCategoryID(c.getID());
                    p.setTaxCategoryID(tc.getID());
                    p.setImage(ImageUtils.readImage(product.getImageUrl()));
                    dlintegration.syncProduct(p)
                   
                    // Synchronization of stock         
View Full Code Here

                            false,
                            0);
                    dlintegration.syncTax(t);
                  
                    // Synchonization of categories
                    CategoryInfo c = new CategoryInfo(product.getCategory().getId(), product.getCategory().getName(), null);
                    dlintegration.syncCategory(c);

                    // Synchonization of products
                    ProductInfoExt p = new ProductInfoExt();
                    p.setID(product.getId());
                    p.setReference(product.getId());
                    p.setCode(product.getEan() == null || product.getEan().equals("") ? product.getId() : product.getEan());
                    p.setName(product.getName());
                    p.setCom(false);
                    p.setScale(false);
                    p.setPriceBuy(product.getPurchasePrice());
                    p.setPriceSell(product.getListPrice());
                    p.setCategoryID(c.getID());
                    p.setTaxCategoryID(tc.getID());
                    p.setImage(ImageUtils.readImage(product.getImageUrl()));
                    dlintegration.syncProduct(p)
                   
                    // Synchronization of stock         
View Full Code Here

   
    private void showRootCategoriesPanel() {
       
        selectIndicatorCategories();
        // Show selected root category
        CategoryInfo cat = (CategoryInfo) m_jListCategories.getSelectedValue();
       
        if (cat != null) {
            selectCategoryPanel(cat.getID());
        }
        showingcategory = null;
    }
View Full Code Here

    }//GEN-LAST:event_m_jUpActionPerformed

    private void m_jListCategoriesValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_m_jListCategoriesValueChanged

        if (!evt.getValueIsAdjusting()) {
            CategoryInfo cat = (CategoryInfo) m_jListCategories.getSelectedValue();
            if (cat != null) {
                selectCategoryPanel(cat.getID());
            }
        }
       
    }//GEN-LAST:event_m_jListCategoriesValueChanged
View Full Code Here

TOP

Related Classes of com.openbravo.pos.ticket.CategoryInfo

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.