Big update to properly support multi currencies.

This commit is contained in:
James Cole
2017-06-04 13:39:16 +02:00
parent 771ebde295
commit 82e74a2afd
34 changed files with 470 additions and 498 deletions

View File

@@ -38,9 +38,6 @@ class General extends Twig_Extension
public function getFilters(): array
{
return [
$this->formatAmount(),
$this->formatAmountPlain(),
$this->formatJournal(),
$this->balance(),
$this->formatFilesize(),
$this->mimeIcon(),
@@ -173,33 +170,6 @@ class General extends Twig_Extension
);
}
/**
*
* @return Twig_SimpleFilter
*/
protected function formatAmount(): Twig_SimpleFilter
{
return new Twig_SimpleFilter(
'formatAmount', function (string $string): string {
return app('amount')->format($string);
}, ['is_safe' => ['html']]
);
}
/**
* @return Twig_SimpleFilter
*/
protected function formatAmountPlain(): Twig_SimpleFilter
{
return new Twig_SimpleFilter(
'formatAmountPlain', function (string $string): string {
return app('amount')->format($string, false);
}, ['is_safe' => ['html']]
);
}
/**
* @return Twig_SimpleFilter
*/
@@ -223,17 +193,6 @@ class General extends Twig_Extension
);
}
/**
* @return Twig_SimpleFilter
*/
protected function formatJournal(): Twig_SimpleFilter
{
return new Twig_SimpleFilter(
'formatJournal', function (TransactionJournal $journal): string {
return app('amount')->formatJournal($journal);
}, ['is_safe' => ['html']]
);
}
/**
* @return Twig_SimpleFunction