Esempio n. 1
0
  /** Creates new form StockDiaryEditor */
  public StockDiaryEditor(AppView app, DirtyManager dirty) {

    m_App = app;
    m_dlSales = (DataLogicSales) m_App.getBean("com.openbravo.pos.forms.DataLogicSales");

    // MSL
    m_dlSuppliers =
        (DataLogicSuppliers) m_App.getBean("com.openbravo.pos.suppliers.DataLogicSuppliers");

    initComponents();

    m_cat = new JCatalog(m_dlSales, true);
    m_cat.getComponent().setPreferredSize(new Dimension(0, 245));
    m_cat.addActionListener(new CatalogListener());
    add(m_cat.getComponent(), BorderLayout.SOUTH);

    // El modelo de locales
    m_sentlocations = m_dlSales.getLocationsList();
    m_LocationsModel = new ComboBoxValModel();

    m_ReasonModel = new ComboBoxValModel();
    m_ReasonModel.add(MovementReason.IN_PURCHASE);
    m_ReasonModel.add(MovementReason.IN_REFUND);
    m_ReasonModel.add(MovementReason.IN_MOVEMENT);
    m_ReasonModel.add(MovementReason.OUT_SALE);
    m_ReasonModel.add(MovementReason.OUT_REFUND);
    m_ReasonModel.add(MovementReason.OUT_BREAK);
    m_ReasonModel.add(MovementReason.OUT_MOVEMENT);
    m_jreason.setModel(m_ReasonModel);

    m_jdate.getDocument().addDocumentListener(dirty);
    m_jreason.addActionListener(dirty);
    m_jLocation.addActionListener(dirty);
    jproduct.getDocument().addDocumentListener(dirty);
    jattributes.getDocument().addDocumentListener(dirty);
    m_junits.getDocument().addDocumentListener(dirty);
    m_jprice.getDocument().addDocumentListener(dirty);

    writeValueEOF();
  }
  /**
   * Creates new form StockDiaryEditor
   *
   * @param app
   * @param dirty
   * @throws com.openbravo.basic.BasicException
   */
  public StockDiaryEditor(AppView app, DirtyManager dirty) throws BasicException {

    m_App = app;
    m_dlSales = (DataLogicSales) m_App.getBean("com.openbravo.pos.forms.DataLogicSales");

    initComponents();

    // El modelo de locales
    m_sentlocations = m_dlSales.getLocationsList();
    m_LocationsModel = new ComboBoxValModel();

    m_ReasonModel = new ComboBoxValModel();
    m_ReasonModel.add(MovementReason.IN_PURCHASE);
    m_ReasonModel.add(MovementReason.IN_REFUND);
    m_ReasonModel.add(MovementReason.IN_MOVEMENT);
    m_ReasonModel.add(MovementReason.OUT_SALE);
    m_ReasonModel.add(MovementReason.OUT_REFUND);
    m_ReasonModel.add(MovementReason.OUT_BREAK);
    m_ReasonModel.add(MovementReason.OUT_MOVEMENT);

    m_jreason.setModel(m_ReasonModel);

    m_cat = new JCatalog(m_dlSales);
    m_cat.addActionListener(new CatalogListener());

    catcontainer.add(m_cat.getComponent(), BorderLayout.CENTER);

    m_jdate.getDocument().addDocumentListener(dirty);
    m_jreason.addActionListener(dirty);
    m_jLocation.addActionListener(dirty);
    jproduct.getDocument().addDocumentListener(dirty);
    jattributes.getDocument().addDocumentListener(dirty);
    m_junits.getDocument().addDocumentListener(dirty);
    m_jprice.getDocument().addDocumentListener(dirty);

    writeValueEOF();
  }