Skip to content

Firefly III: a personal finances manager

Journals that no longer match a bill will be removed.

James Coledf8976eabe19
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index 611e438dbe..df997ba2c0 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -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();
+ }
}
}