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

class HinterlegungEinnahmenAusgabenPosten extends HinterlegungDialogBasis
{
  
  public $data;

  public function __construct()
  {
    parent::__construct();

    $dbwhlEinAus = new DBWorkHLEinAus();
    $this->data = $dbwhlEinAus->getAll();
  }

  
  public function GetColumnCount()
  {
    return 5;
  }

  
  public function GetColumnTitle($col)
  {
    switch ($col) {
      case 0: return 'Titel';
      case 1: return 'Konto';
      case 2: return 'Kostenstelle';
      case 3: return 'MwST';
      case 4: return 'DP';
    }

    return '';
  }

  
  public function GetColumnWidth($col)
  {
    switch ($col) {
      case 0: return '45%';
      case 1: return '20%';
      case 2: return '20%';
      case 3: return '10%';
      case 4: return '5%';
    }

    return '';
  }

  
  public function GetIdColumnIndices()
  {
    return array(0, 1, 2);
  }

  
  public function GetRowCount()
  {
    return count($this->data);
  }

  
  public function GetValueAt($row, $col)
  {
    switch ($col) {
      case 0: return $this->data[$row]->ea_text;
      case 1: return $this->data[$row]->ea_kto;
      case 2: return $this->data[$row]->ea_kst;
      case 3: return $this->data[$row]->mwst;
      case 4: return $this->data[$row]->dp ? 'ja' : 'nein';
    }
  }
}