<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

class Ermaessigung extends Datamodul
{
  public $nr;
  public $text;
  public $prozente;
  public $kurz;
  public $bearbeiter;
  public $bearbdatum;
  public $ungueltig;

  public function getTyp($pFieldName)
  {
    switch ($pFieldName) {
      default:
        return parent::getTyp($pFieldName);
      case 'bearbdatum':
      case 'gueltigbis':
        return \DatamodulVarType::TYPE_DATE;
      case 'nr':
      case 'mandant':
        return \DatamodulVarType::TYPE_INT;
      case 'prozente':
        return \DatamodulVarType::TYPE_FLOAT_DOT;
    }
  }

  public function isKursbezogen(): bool
  {
    return $this->nr > 0 && $this->prozente == 0;
  }
}