This commit is contained in:
James Cole
2016-04-03 14:38:12 +02:00
parent f22a9799a1
commit 7a216f95ca
2 changed files with 41 additions and 16 deletions

View File

@@ -52,7 +52,7 @@ class General extends Twig_Extension
$this->getCurrencySymbol(),
$this->phpdate(),
$this->env(),
$this->getAmountFromJournal(),
$this->activeRouteStrict(),
$this->activeRoutePartial(),
$this->activeRoutePartialWhat(),
@@ -306,4 +306,16 @@ class General extends Twig_Extension
);
}
/**
* @return Twig_SimpleFunction
*/
private function getAmountFromJournal()
{
return new Twig_SimpleFunction(
'getAmount', function (TransactionJournal $journal) : string {
return TransactionJournal::amount($journal);
}
);
}
}