<?php

namespace App\QcRules;

class Invoice_Filter_CurrencyType extends FilterAbstract
{

	/**
	 * (non-PHPdoc)
	 * @see \App\QcRules\FilterAbstract::checkFields()
	 */
	public function checkFields(\App\QcRules\FieldsAbstract $fields, $context='')
	{

		// group invoice rows by currency type
		$currTypes = [];
		foreach ($fields->rowsList as $row) {
			if ($row['currencyType']) {
				$currTypes[$row['currencyType']] = true;
			}
		}

		return $this->checkFields_multiValues(array_keys($currTypes));

	}

}
