Added some (yet without function) information icons. [skip ci] [skip Scrutinizer]

This commit is contained in:
James Cole
2016-02-06 20:17:55 +01:00
parent 6c2df1a783
commit 8fb3348a7c
8 changed files with 58 additions and 32 deletions
+19
View File
@@ -27,6 +27,9 @@ class BillLine
/** @var string */
protected $min;
/** @var int */
private $transactionJournalId;
/**
* @return string
*/
@@ -91,6 +94,22 @@ class BillLine
$this->min = $min;
}
/**
* @return int
*/
public function getTransactionJournalId(): int
{
return $this->transactionJournalId ?? 0;
}
/**
* @param int $transactionJournalId
*/
public function setTransactionJournalId(int $transactionJournalId)
{
$this->transactionJournalId = $transactionJournalId;
}
/**
* @return boolean
*/
+5 -4
View File
@@ -80,11 +80,13 @@ class ReportHelper implements ReportHelperInterface
$entry = $journals->filter(
function (TransactionJournal $journal) use ($bill) {
return $journal->bill_id == $bill->id;
return $journal->bill_id === $bill->id;
}
);
if (!is_null($entry->first())) {
$billLine->setAmount($entry->first()->journalAmount);
$first = $entry->first();
if (!is_null($first)) {
$billLine->setTransactionJournalId($first->id);
$billLine->setAmount($first->journalAmount);
$billLine->setHit(true);
} else {
$billLine->setHit(false);
@@ -93,7 +95,6 @@ class ReportHelper implements ReportHelperInterface
$collection->addBill($billLine);
}
}
return $collection;
+1
View File
@@ -82,6 +82,7 @@ class BillRepository implements BillRepositoryInterface
->get(
[
'transaction_journals.bill_id',
'transaction_journals.id',
DB::Raw('SUM(`transactions`.`amount`) as `journalAmount`'),
]
);