added basic invoice rendering #97 #93 (#99)

This commit is contained in:
Kevin Papst
2018-01-21 22:50:46 +01:00
committed by GitHub
parent 9a161b8fd9
commit 4cbc5391c0
73 changed files with 2986 additions and 918 deletions

View File

@@ -11,9 +11,7 @@
namespace App\Twig;
use App\Utils\Markdown;
use Symfony\Component\Intl\Intl;
use App\Entity\Customer;
use App\Entity\Timesheet;
/**
@@ -123,8 +121,11 @@ class Extensions extends \Twig_Extension
*/
public function money($amount, $currency = null)
{
$currency = $currency ?: Customer::DEFAULT_CURRENCY;
return round($amount) . ' ' . Intl::getCurrencyBundle()->getCurrencySymbol($currency);
$result = round($amount, 2);
if ($currency !== null) {
$result .= ' ' . Intl::getCurrencyBundle()->getCurrencySymbol($currency);
}
return $result;
}
/**