Ejemplo n.º 1
0
 /**
  *
  * @param TransactionJournal $journal
  * @param bool               $coloured
  *
  * @return string
  */
 public function formatJournal(TransactionJournal $journal, $coloured = true)
 {
     $cache = new CacheProperties();
     $cache->addProperty($journal->id);
     $cache->addProperty('formatJournal');
     if ($cache->has()) {
         return $cache->get();
         // @codeCoverageIgnore
     }
     if ($journal->isTransfer() && $coloured) {
         $txt = '<span class="text-info">' . $this->formatAnything($journal->transactionCurrency, $journal->amount_positive, false) . '</span>';
         $cache->store($txt);
         return $txt;
     }
     if ($journal->isTransfer() && !$coloured) {
         $txt = $this->formatAnything($journal->transactionCurrency, $journal->amount_positive, false);
         $cache->store($txt);
         return $txt;
     }
     $txt = $this->formatAnything($journal->transactionCurrency, $journal->amount, $coloured);
     $cache->store($txt);
     return $txt;
 }