private void setDefaults() throws Throwable {
    wrbBelegdatum.setSelected(true);
    wrbKalenderjahr.setSelected(true);
    wrbGeschaeftsjahr.setVisible(true);

    wcoGeschaeftsjahr.setMap(
        DelegateFactory.getInstance().getSystemDelegate().getAllGeschaeftsjahr());
    // Default ist das aktuelle GJ
    wcoGeschaeftsjahr.setKeyOfSelectedItem(
        DelegateFactory.getInstance().getParameterDelegate().getGeschaeftsjahr());
    String mandantWaehrung =
        DelegateFactory.getInstance()
            .getMandantDelegate()
            .mandantFindByPrimaryKey(LPMain.getTheClient().getMandant())
            .getWaehrungCNr();
  }
  /**
   * ptkrit: 2 die gewaehlten Kriterien zusammenbauen. <br>
   * Es gilt fuer Auftrag Uebersicht: <br>
   * Krit1 : Auswertung (Belegdatum oder Liefertermin oder Finaltermin) = Auswahl Geschaeftsjahr
   *
   * @throws Throwable
   * @return FilterKriterium[]
   */
  public FilterKriterium[] buildFilterKriterien() throws Throwable {
    aAlleKriterien = new FilterKriterium[EingangsrechnungFac.ANZAHL_KRITERIEN];

    FilterKriterium fkDatum = null;
    FilterKriterium fkJahr = null;

    if (wrbBelegdatum.isSelected()) {
      // Auswertung nach Belegdatum
      fkDatum =
          EingangsrechnungFilterFactory.getInstance()
              .createFKKriteriumBelegdatum(
                  wrbBelegdatum.isSelected(), wcoGeschaeftsjahr.getKeyOfSelectedItem().toString());
    } else if (wrbFreigabedatum.isSelected()) {
      // Auswertung nach Freigabedatum
      fkDatum =
          EingangsrechnungFilterFactory.getInstance()
              .createFKKriteriumFreigabedatum(
                  wrbBelegdatum.isSelected(), wcoGeschaeftsjahr.getKeyOfSelectedItem().toString());
    }
    if (wrbGeschaeftsjahr.isSelected()) {
      fkJahr =
          EingangsrechnungFilterFactory.getInstance()
              .createFKKriteriumGeschaeftsjahr(
                  wrbBelegdatum.isSelected(), wcoGeschaeftsjahr.getKeyOfSelectedItem().toString());
    } else if (wrbKalenderjahr.isSelected()) {
      fkJahr =
          EingangsrechnungFilterFactory.getInstance()
              .createFKKriteriumKalenderjahr(
                  wrbBelegdatum.isSelected(), wcoGeschaeftsjahr.getKeyOfSelectedItem().toString());
    }

    aAlleKriterien[EingangsrechnungFac.IDX_KRIT_DATUM] = fkDatum;
    aAlleKriterien[EingangsrechnungFac.IDX_KRIT_JAHR] = fkJahr;

    FilterKriterium fkZusatzkosten =
        new FilterKriterium(
            EingangsrechnungFac.KRIT_ZUSATZKOSTEN,
            false,
            Helper.boolean2Short(tabbedPaneER.isBZusatzkosten()) + "",
            FilterKriterium.OPERATOR_EQUAL,
            false);

    aAlleKriterien[EingangsrechnungFac.IDX_KRIT_ZUSATZKOSTEN] = fkZusatzkosten;

    return aAlleKriterien;
  }
コード例 #3
0
  public JasperPrintLP getReport(String sDrucktype) throws Throwable {
    JasperPrintLP jasperPrint = null;

    if (wrbErledigt.isSelected()) {

      if (auftragIId == null && losIId == null) {
        java.sql.Timestamp wdfBisTemp =
            new java.sql.Timestamp(wdfBis.getTimestamp().getTime() + 24 * 3600000);

        jasperPrint =
            DelegateFactory.getInstance()
                .getFertigungDelegate()
                .printLosstatistik(
                    Helper.cutTimestamp(wdfVon.getTimestamp()),
                    Helper.cutTimestamp(wdfBisTemp),
                    losIId,
                    stuecklisteIId,
                    auftragIId,
                    wcbArbeitsplanSortiertNachAG.isSelected(),
                    wcbVerdichtetNachArtikel.isSelected(),
                    null);
      } else {
        jasperPrint =
            DelegateFactory.getInstance()
                .getFertigungDelegate()
                .printLosstatistik(
                    null,
                    null,
                    losIId,
                    stuecklisteIId,
                    auftragIId,
                    wcbArbeitsplanSortiertNachAG.isSelected(),
                    wcbVerdichtetNachArtikel.isSelected(),
                    null);
      }
    } else {
      if (auftragIId == null && losIId == null) {
        java.sql.Timestamp wdfBisTemp =
            new java.sql.Timestamp(wdfBis.getTimestamp().getTime() + 24 * 3600000);

        jasperPrint =
            DelegateFactory.getInstance()
                .getFertigungDelegate()
                .printLosstatistik(
                    null,
                    null,
                    losIId,
                    stuecklisteIId,
                    auftragIId,
                    wcbArbeitsplanSortiertNachAG.isSelected(),
                    wcbVerdichtetNachArtikel.isSelected(),
                    wdfStichtag.getTimestamp());
      } else {
        jasperPrint =
            DelegateFactory.getInstance()
                .getFertigungDelegate()
                .printLosstatistik(
                    null,
                    null,
                    losIId,
                    stuecklisteIId,
                    auftragIId,
                    wcbArbeitsplanSortiertNachAG.isSelected(),
                    wcbVerdichtetNachArtikel.isSelected(),
                    wdfStichtag.getTimestamp());
      }
    }
    return jasperPrint;
  }
  /**
   * Dialog initialisieren
   *
   * @throws Throwable
   */
  private void jbInit() throws Throwable {
    // die Gruppe mit nach Datum
    wlaNachdatum = new WrapperLabel(LPMain.getTextRespectUISPr("label.auswertung"));
    wlaNachdatum.setMaximumSize(new Dimension(120, 23));
    wlaNachdatum.setMinimumSize(new Dimension(120, 23));
    wlaNachdatum.setPreferredSize(new Dimension(120, 23));
    wlaNachdatum.setHorizontalAlignment(SwingConstants.LEADING);

    wlaEmptyLabel1 = new WrapperLabel();
    wlaEmptyLabel1.setMaximumSize(new Dimension(10, 23));
    wlaEmptyLabel1.setMinimumSize(new Dimension(10, 23));
    wlaEmptyLabel1.setPreferredSize(new Dimension(10, 23));

    jbgNachdatum = new ButtonGroup();
    jbgJahr = new ButtonGroup();

    wrbBelegdatum = new WrapperRadioButton();
    wrbBelegdatum.setText(LPMain.getTextRespectUISPr("label.belegdatum"));

    wrbFreigabedatum = new WrapperRadioButton();
    wrbFreigabedatum.setText(LPMain.getTextRespectUISPr("label.freigabedatum"));

    wrbKalenderjahr = new WrapperRadioButton();
    wrbKalenderjahr.setText(LPMain.getTextRespectUISPr("label.kalenderjahr"));

    wrbGeschaeftsjahr = new WrapperRadioButton();
    wrbGeschaeftsjahr.setText(LPMain.getTextRespectUISPr("label.geschaeftsjahr"));

    jbgNachdatum.add(wrbBelegdatum);
    jbgNachdatum.add(wrbFreigabedatum);

    jbgJahr.add(wrbGeschaeftsjahr);
    jbgJahr.add(wrbKalenderjahr);

    wlaEmptyLabel2 = new WrapperLabel();

    wlaPeriode = new WrapperLabel(LPMain.getTextRespectUISPr("label.periode"));
    wlaPeriode.setHorizontalAlignment(SwingConstants.LEADING);
    wlaEmptyLabel3 = new WrapperLabel();
    wcoGeschaeftsjahr = new WrapperComboBox();
    wcoGeschaeftsjahr.setMandatoryField(true);

    jpaWorkingOn.add(
        wlaNachdatum,
        new GridBagConstraints(
            0,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wlaEmptyLabel1,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wrbBelegdatum,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wrbFreigabedatum,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wlaPeriode,
        new GridBagConstraints(
            0,
            iZeile,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wrbKalenderjahr,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wrbGeschaeftsjahr,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wlaEmptyLabel2,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));

    iZeile++;
    jpaWorkingOn.add(
        wlaEmptyLabel3,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wcoGeschaeftsjahr,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));
  }
コード例 #5
0
  private void jbInit() throws Throwable {
    this.setLayout(new GridBagLayout());
    getInternalFrame().addItemChangedListener(this);
    jpaWorkingOn.setLayout(new GridBagLayout());
    wrbErledigt.setText(LPMain.getInstance().getTextRespectUISPr("fert.losstatistik.erledigtvon"));
    wlaBis.setText(LPMain.getInstance().getTextRespectUISPr("lp.bis"));
    wdfVon.setMandatoryField(true);
    wdfBis.setMandatoryField(true);
    wdfStichtag.setMandatoryField(true);
    wdfStichtag.setTimestamp(new java.sql.Timestamp(System.currentTimeMillis()));
    wdrBereich = new WrapperDateRangeController(wdfVon, wdfBis);

    wrbStichtag.setText(LPMain.getInstance().getTextRespectUISPr("lp.stichtag"));

    buttonGroup.add(wrbErledigt);
    buttonGroup.add(wrbStichtag);
    wrbErledigt.setSelected(true);

    wbuStueckliste.setText(LPMain.getInstance().getTextRespectUISPr("button.stueckliste"));
    wbuAuftrag.setText(LPMain.getInstance().getTextRespectUISPr("button.auftrag"));
    wbuLos.setText(LPMain.getInstance().getTextRespectUISPr("fert.tab.unten.los.title") + "...");

    wcbArbeitsplanSortiertNachAG.setText(
        LPMain.getInstance()
            .getTextRespectUISPr("fertigung.report.losstatistik.arbeitsplansortiertnachag"));
    wcbVerdichtetNachArtikel.setText(
        LPMain.getInstance().getTextRespectUISPr("lp.verdichtetartikelnummer"));

    wcbVerdichtetNachArtikel.setSelected(true);

    wbuStueckliste.setActionCommand(ACTION_SPECIAL_STUECKLISTE_FROM_LISTE);
    wbuStueckliste.addActionListener(this);

    wbuAuftrag.setActionCommand(ACTION_SPECIAL_AUFTRAG_FROM_LISTE);
    wbuAuftrag.addActionListener(this);

    wbuLos.setActionCommand(ACTION_SPECIAL_LOS_FROM_LISTE);
    wbuLos.addActionListener(this);

    wtfStueckliste.setActivatable(false);
    wtfLos.setActivatable(false);
    wtfAuftrag.setActivatable(false);

    this.add(
        jpaWorkingOn,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.WEST,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    int iZeile = 0;

    jpaWorkingOn.add(
        wrbErledigt,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wdfVon,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wlaBis,
        new GridBagConstraints(
            2,
            iZeile,
            1,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wdfBis,
        new GridBagConstraints(
            3,
            iZeile,
            1,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wdrBereich,
        new GridBagConstraints(
            4,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));

    iZeile++;
    jpaWorkingOn.add(
        wrbStichtag,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wdfStichtag,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    iZeile++;

    jpaWorkingOn.add(
        wbuLos,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wtfLos,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wcbArbeitsplanSortiertNachAG,
        new GridBagConstraints(
            2,
            iZeile,
            2,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));

    iZeile++;
    jpaWorkingOn.add(
        wbuAuftrag,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wtfAuftrag,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wcbVerdichtetNachArtikel,
        new GridBagConstraints(
            2,
            iZeile,
            2,
            1,
            0.1,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wbuStueckliste,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wtfStueckliste,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(2, 2, 2, 2),
            0,
            0));
  }