Ejemplo n.º 1
0
  public final void eventYouAreSelected(boolean bNeedNoYouAreSelectedI) throws Throwable {

    super.eventYouAreSelected(true);

    wbuPasswort.setBackground(UIManager.getColor("Button.background"));

    // Die normale Telefon/Faxnummer vor der Durchwajl anzeigen
    PartnerDto dto = null;
    if (getInternalFrame() instanceof InternalFrameLieferant) {
      dto = ((InternalFrameLieferant) getInternalFrame()).getLieferantDto().getPartnerDto();
    } else if (getInternalFrame() instanceof InternalFrameKunde) {
      dto = ((InternalFrameKunde) getInternalFrame()).getKundeDto().getPartnerDto();
    } else if (getInternalFrame() instanceof InternalFramePartner) {
      dto = ((InternalFramePartner) getInternalFrame()).getTpPartner().getPartnerDto();
    }

    String cTelefon =
        DelegateFactory.getInstance()
            .getPartnerDelegate()
            .enrichNumber(dto.getIId(), PartnerFac.KOMMUNIKATIONSART_TELEFON, null, true);

    if (cTelefon != null) {

      LPMain.getInstance();
      wlaDurchwahl.setText(LPMain.getTextRespectUISPr("lp.durchwahl") + " (" + cTelefon + ")");
    } else {
      LPMain.getInstance();
      wlaDurchwahl.setText(LPMain.getTextRespectUISPr("lp.durchwahl"));
    }

    cTelefon =
        DelegateFactory.getInstance()
            .getPartnerDelegate()
            .enrichNumber(dto.getIId(), PartnerFac.KOMMUNIKATIONSART_FAX, null, true);

    if (cTelefon != null) {

      LPMain.getInstance();
      wlaFaxdurchwahl.setText(
          LPMain.getTextRespectUISPr("lp.faxdurchwahl") + " (" + cTelefon + ")");
    } else {
      LPMain.getInstance();
      wlaFaxdurchwahl.setText(LPMain.getTextRespectUISPr("lp.faxdurchwahl"));
    }

    if (!bNeedNoYouAreSelectedI) {
      Object key = getKeyWhenDetailPanel();

      setAnsprechpartnerDto(new AnsprechpartnerDto());

      if (key == null || (key != null && key.equals(LPMain.getLockMeForNew()))) {

        leereAlleFelder(this);
        setDefaults();
        clearStatusbar();
        if (key != null && key.equals(LPMain.getLockMeForNew())) {
          wtfAnsprechpartner.setActivatable(true);
          wtfAnsprechpartner.setEditable(true);
          wtfVorname.setActivatable(true);
          wtfVorname.setEditable(true);
          wtfTitel.setActivatable(true);
          wtfTitel.setEditable(true);
          wtfNtitel.setActivatable(true);
          wtfNtitel.setEditable(true);
          wdfGebDatum.setActivatable(true);
          wdfGebDatum.setEnabled(true);
          wcoAnrede.setActivatable(true);
          wcoAnrede.setEnabled(true);
        }
      } else {
        wtfAnsprechpartner.setActivatable(false);
        wtfAnsprechpartner.setEditable(false);
        wtfVorname.setActivatable(false);
        wtfVorname.setEditable(false);
        wtfTitel.setActivatable(false);
        wtfTitel.setEditable(false);
        wtfNtitel.setActivatable(false);
        wtfNtitel.setEditable(false);
        wdfGebDatum.setActivatable(false);
        wdfGebDatum.setEditable(false);
        wcoAnrede.setActivatable(false);
        wcoAnrede.setEditable(false);

        setAnsprechpartnerDto(
            DelegateFactory.getInstance()
                .getAnsprechpartnerDelegate()
                .ansprechpartnerFindByPrimaryKey((Integer) key));

        setStatusbar();

        dto2Components(dto);
      }

      getInternalFrame()
          .setLpTitle(InternalFrame.TITLE_IDX_AS_I_LIKE, getSelectedPartnerTitelAnrede());
    }
  }
  private void jbInit() throws Throwable {
    getInternalFrame().addItemChangedListener(this);

    wlaGestehungspreis =
        new WrapperLabel(LPMain.getInstance().getTextRespectUISPr("lp.gestehungspreis"));
    wnfGestehungspreis = new WrapperNumberField();
    wnfGestehungspreis.setActivatable(false);
    wnfGestehungspreis.setFractionDigits(iPreiseUINachkommastellen);
    wlaWaehrungGestehungspreis = new WrapperLabel(waehrungCNr);
    wlaWaehrungGestehungspreis.setHorizontalAlignment(SwingConstants.LEADING);

    wlaMinverkaufspreis =
        new WrapperLabel(LPMain.getInstance().getTextRespectUISPr("lp.minverkaufspreisshort"));
    wnfMinverkaufspreis = new WrapperNumberField();
    wnfMinverkaufspreis.setActivatable(false);
    wnfMinverkaufspreis.setFractionDigits(iPreiseUINachkommastellen);
    wlaWaehrungMinverkaufspreis = new WrapperLabel(waehrungCNr);
    wlaWaehrungMinverkaufspreis.setHorizontalAlignment(SwingConstants.LEADING);

    wcbWirktNichtInVerkaufspreisfindung =
        new WrapperCheckBox(
            LPMain.getInstance()
                .getTextRespectUISPr("part.kundesoko.artikel.wirktnichtinpreisfindung"));

    // PJ 17390
    ParametermandantDto parameter =
        (ParametermandantDto)
            DelegateFactory.getInstance()
                .getParameterDelegate()
                .getParametermandant(
                    ParameterFac.PARAMETER_PREISBASIS_VERKAUF,
                    ParameterFac.KATEGORIE_KUNDEN,
                    LPMain.getTheClient().getMandant());

    if (parameter.getCWert() != null) {

      iPreisbasis = (Integer) parameter.getCWertAsObject();
    }

    if (iPreisbasis == 0 || iPreisbasis == 2) {
      wlaVkbasis =
          new WrapperLabel(
              LPMain.getInstance().getTextRespectUISPr("artikel.label.einzelverkaufspreis"));
    } else {
      wlaVkbasis =
          new WrapperLabel(
              LPMain.getInstance().getTextRespectUISPr("part.kundensoko.preisbasis.preisliste"));
    }

    wnfVkbasis = new WrapperNumberField();
    wnfVkbasis.setFractionDigits(iPreiseUINachkommastellen);
    wnfVkbasis.setActivatable(false);
    wlaVkbasiswaehrung = new WrapperLabel(waehrungCNr);
    wlaVkbasiswaehrung.setHorizontalAlignment(SwingConstants.LEADING);
    wlaVkbasisGueltigab =
        new WrapperLabel(LPMain.getInstance().getTextRespectUISPr("vkpf.vkbasisgueltigab"));
    wdfVkbasisGueltigab = new WrapperDateField();
    wdfVkbasisGueltigab.setActivatable(false);

    wlaFixpreis = new WrapperLabel(LPMain.getInstance().getTextRespectUISPr("lp.fixpreis"));
    wlaFixpreis.setHorizontalAlignment(SwingConstants.LEADING);
    wlaFixpreis.setVerticalAlignment(SwingConstants.BOTTOM);
    wlaBerechneterpreis =
        new WrapperLabel(LPMain.getInstance().getTextRespectUISPr("lp.berechneterpreis"));
    wlaBerechneterpreis.setHorizontalAlignment(SwingConstants.LEADING);
    wlaBerechneterpreis.setVerticalAlignment(SwingConstants.BOTTOM);

    wnfFixpreis = new WrapperNumberField();
    wnfFixpreis.setFractionDigits(iPreiseUINachkommastellen);
    wnfFixpreis.setDependenceField(true);
    wnfFixpreis.addFocusListener(new PanelMengenstaffelArtikel_fixpreis_focusAdapter(this));

    wlaFixpreiswaehrung = new WrapperLabel(waehrungCNr);
    wlaFixpreiswaehrung.setHorizontalAlignment(SwingConstants.LEADING);

    wnfBerechneterpreis = new WrapperNumberField();
    wnfBerechneterpreis.setFractionDigits(iPreiseUINachkommastellen);
    wnfBerechneterpreis.setActivatable(false);
    wnfBerechneterpreis.setDependenceField(true);

    wlaBerechneterpreiswaehrung = new WrapperLabel(waehrungCNr);
    wlaBerechneterpreiswaehrung.setHorizontalAlignment(SwingConstants.LEADING);

    initMengeRabattsatz();

    wnfRabattsatz.addFocusListener(new PanelMengenstaffelArtikel_rabattsatz_focusAdapter(this));

    wifArtikel = new WrapperIdentField(getInternalFrame(), this);
    wifArtikel.addEinheitLabel(wlaMengeeinheit);

    addFormatierungszeile();

    iZeile++;
    add(
        wifArtikel.getWbuArtikel(),
        new GridBagConstraints(
            0,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wifArtikel.getWtfIdent(),
        new GridBagConstraints(
            2,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wifArtikel.getWtfBezeichnung(),
        new GridBagConstraints(
            4,
            iZeile,
            4,
            1,
            1.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));

    if (bMitUebersteuerbarenArtikelbezeichnungen) {
      iZeile++;
      wlaKndArtBez =
          new WrapperLabel(LPMain.getInstance().getTextRespectUISPr("artikel.kundesoko.kndartbez"));

      add(
          wlaKndArtBez,
          new GridBagConstraints(
              2,
              iZeile,
              2,
              1,
              0.0,
              0.0,
              GridBagConstraints.NORTH,
              GridBagConstraints.HORIZONTAL,
              new Insets(2, 2, 2, 2),
              0,
              0));

      wtfKndArtBez = new WrapperTextField(40);
      wtfKndArtZBez = new WrapperTextField(25);
      add(
          wtfKndArtBez,
          new GridBagConstraints(
              4,
              iZeile,
              4,
              1,
              1.0,
              0.0,
              GridBagConstraints.NORTH,
              GridBagConstraints.HORIZONTAL,
              new Insets(2, 2, 2, 2),
              0,
              0));
    }

    iZeile++;

    add(
        wlaGestehungspreis,
        new GridBagConstraints(
            0,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wnfGestehungspreis,
        new GridBagConstraints(
            2,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaWaehrungGestehungspreis,
        new GridBagConstraints(
            3,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    if (bMitUebersteuerbarenArtikelbezeichnungen) {
      add(
          wtfKndArtZBez,
          new GridBagConstraints(
              4,
              iZeile,
              4,
              1,
              1.0,
              0.0,
              GridBagConstraints.NORTH,
              GridBagConstraints.HORIZONTAL,
              new Insets(2, 2, 2, 2),
              0,
              0));
    }

    iZeile++;
    add(
        wlaMinverkaufspreis,
        new GridBagConstraints(
            0,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wnfMinverkaufspreis,
        new GridBagConstraints(
            2,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaWaehrungMinverkaufspreis,
        new GridBagConstraints(
            3,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    wlaPreisgueltigkeitsanzeigeab =
        new WrapperLabel(
            LPMain.getInstance().getTextRespectUISPr("vkpf.preisgueltigkeitsanzeigeab"));
    wdfPreisgueltigkeitsanzeigeab = new WrapperDateField();
    wdfPreisgueltigkeitsanzeigeab.getDisplay().addPropertyChangeListener(this);
    // SP2243 -> Preisgueltigkeisanzeige immm ab heute
    add(
        wcbWirktNichtInVerkaufspreisfindung,
        new GridBagConstraints(
            4,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));

    /*
     * add(wlaPreisgueltigkeitsanzeigeab, new GridBagConstraints(0, iZeile,
     * 6, 1, 0.0, 0.0, GridBagConstraints.NORTH,
     * GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
     * add(wdfPreisgueltigkeitsanzeigeab, new GridBagConstraints(6, iZeile,
     * 1, 1, 0.0, 0.0, GridBagConstraints.NORTH,
     * GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
     */
    iZeile++;
    add(
        wlaVkbasis,
        new GridBagConstraints(
            0,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wnfVkbasis,
        new GridBagConstraints(
            2,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaVkbasiswaehrung,
        new GridBagConstraints(
            3,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaVkbasisGueltigab,
        new GridBagConstraints(
            4,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wdfVkbasisGueltigab,
        new GridBagConstraints(
            6,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));

    iZeile++;
    add(
        wlaMenge,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaFixpreis,
        new GridBagConstraints(
            2,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaRabattsatz,
        new GridBagConstraints(
            4,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaBerechneterpreis,
        new GridBagConstraints(
            6,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));

    iZeile++;
    add(
        wnfMenge,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaMengeeinheit,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wnfFixpreis,
        new GridBagConstraints(
            2,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaFixpreiswaehrung,
        new GridBagConstraints(
            3,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wnfRabattsatz,
        new GridBagConstraints(
            4,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaRabattsatzprozent,
        new GridBagConstraints(
            5,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wnfBerechneterpreis,
        new GridBagConstraints(
            6,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    add(
        wlaBerechneterpreiswaehrung,
        new GridBagConstraints(
            7,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTH,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));

    iZeile++;
    addZeileGueltigVonBis(iZeile);
  }