From dbef96600aa3d124b324fdd1f140aaf09cf6af06 Mon Sep 17 00:00:00 2001 From: fellipevasconcelos Date: Wed, 19 Feb 2014 15:52:48 -0300 Subject: [PATCH] correcoes --- Controller/PrinterController.php | 3 ++- Resources/views/Printer/index.html.twig | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Controller/PrinterController.php b/Controller/PrinterController.php index c7d667f..02970cc 100755 --- a/Controller/PrinterController.php +++ b/Controller/PrinterController.php @@ -82,7 +82,8 @@ class PrinterController extends Controller if(isset($counter[$size])) { - $pCounter[$key]['prints'] = $counter[$size]['prints'] - $counter[0]['prints']; + $pCounter[$key]['prints'] = ($size == 0) ? + $counter[$size]['prints'] : $counter[$size]['prints'] - $counter[0]['prints']; $pCounter[$key]['blackInk'] = $counter[$size]['blackInk']; $pCounter[$key]['coloredInk'] = $counter[$size]['coloredInk']; } diff --git a/Resources/views/Printer/index.html.twig b/Resources/views/Printer/index.html.twig index cd01e0d..edf8d0b 100755 --- a/Resources/views/Printer/index.html.twig +++ b/Resources/views/Printer/index.html.twig @@ -31,6 +31,8 @@ {% if printerCounter[entity.id] is defined %} {{ printerCounter[entity.id]['prints'] }} + {% else %} + 0 {% endif %} {{ entity.name }} -- libgit2 0.21.2