Journals that no longer match a bill will be removed.

This commit is contained in:
James Cole 2015-04-11 12:40:47 +02:00
parent 3e01daa172
commit df8976eabe

View File

@ -315,6 +315,12 @@ class BillRepository implements BillRepositoryInterface
Log::debug('TOTAL match is true!');
$journal->bill()->associate($bill);
$journal->save();
} else {
if ((!$wordMatch || !$amountMatch) && $bill->id == $journal->bill_id) {
// if no match, but bill used to match, remove it:
$journal->bill_id = null;
$journal->save();
}
}
}