Beispiel #1
0
 public static ESRRecord load(final String id) {
   ESRRecord ret = new ESRRecord(id);
   if (ret.exists()) {
     return ret;
   }
   return null;
 }
  public Color getBackground(Object element, int columnIndex) {
    ESRRecord rec = (ESRRecord) element;

    if (rec.getRejectCode().equals(ESRRecord.REJECT.OK)) {
      if (StringTool.isNothing(rec.getGebucht())) {
        return Desk.getColor(Desk.COL_GREY);
      }
      return Desk.getColor(Desk.COL_WHITE);
    } else {
      return Desk.getColor(Desk.COL_RED);
    }
  }
  public String getColumnText(Object element, int columnIndex) {
    String text = ""; // $NON-NLS-1$

    ESRRecord rec = (ESRRecord) element;

    switch (columnIndex) {
      case ESRView.DATUM_INDEX:
        text = rec.get("Datum"); // $NON-NLS-1$
        break;
      case ESRView.RN_NUMMER_INDEX:
        Rechnung rn = rec.getRechnung();
        if (rn != null) {
          text = rn.getNr();
        }
        break;
      case ESRView.BETRAG_INDEX:
        text = rec.getBetrag().getAmountAsString();
        break;
      case ESRView.EINGELESEN_INDEX:
        text = rec.getEinlesedatatum();
        break;
      case ESRView.VERRECHNET_INDEX:
        text = rec.getVerarbeitungsdatum();
        break;
      case ESRView.GUTGESCHRIEBEN_INDEX:
        text = rec.getValuta();
        break;
      case ESRView.PATIENT_INDEX:
        text = rec.getPatient().getLabel();
        break;
      case ESRView.BUCHUNG_INDEX:
        String dat = rec.getGebucht();
        if (StringTool.isNothing(dat)) {
          text = Messages.ESRView2_notbooked;
        } else {
          text = new TimeTool(dat).toString(TimeTool.DATE_GER);
        }
        break;
      case ESRView.DATEI_INDEX:
        text = rec.getFile();
        break;
    }

    return text;
  }
Beispiel #4
0
 static {
   addMapping(
       TABLENAME,
       PersistentObject.DATE_COMPOUND,
       "Eingelesen=S:D:EINGELESEN", //$NON-NLS-1$
       "Verarbeitet=S:D:VERARBEITET", //$NON-NLS-1$
       "Gutgeschrieben=S:D:GUTSCHRIFT", //$NON-NLS-1$
       "BetragInRp=BETRAGINRP", //$NON-NLS-1$
       CODE,
       RECHNUNGS_ID,
       PATIENT_ID,
       MANDANT_ID,
       FLD_REJECT_CODE,
       "Gebucht=S:D:GEBUCHT",
       "File" //$NON-NLS-1$ //$NON-NLS-2$
       );
   ESRRecord init = load("1"); // $NON-NLS-1$
   if (init == null) {
     createOrModifyTable(createDB);
   } else {
     String v = init.get("File"); // $NON-NLS-1$
     if (StringTool.isNothing(v)) { // < version 1
       getConnection()
           .exec(
               "ALTER TABLE "
                   + TABLENAME
                   + " ADD deleted CHAR(1) default '0';"); //$NON-NLS-1$ //$NON-NLS-2$
       init.set("File", VERSION); // $NON-NLS-1$
     } else {
       VersionInfo vi = new VersionInfo(v);
       if (vi.isOlder("2.0.0")) { // $NON-NLS-1$
         createOrModifyTable(upd2);
       }
       init.set("File", VERSION); // $NON-NLS-1$
     }
   }
 }