mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 14:41:20 +00:00
Bill scan routine should not grab transfers and income.
This commit is contained in:
@@ -276,12 +276,21 @@ class BillRepository implements BillRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function scan(Bill $bill, TransactionJournal $journal)
|
public function scan(Bill $bill, TransactionJournal $journal)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Can only support withdrawals.
|
||||||
|
*/
|
||||||
|
if ($journal->transactionType->type !== 'Withdrawal') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$matches = explode(',', $bill->match);
|
$matches = explode(',', $bill->match);
|
||||||
$description = strtolower($journal->description) . ' ' . strtolower($journal->destination_account->name);
|
$description = strtolower($journal->description) . ' ' . strtolower($journal->destination_account->name);
|
||||||
$wordMatch = $this->doWordMatch($matches, $description);
|
$wordMatch = $this->doWordMatch($matches, $description);
|
||||||
$amountMatch = $this->doAmountMatch($journal->amount_positive, $bill->amount_min, $bill->amount_max);
|
$amountMatch = $this->doAmountMatch($journal->amount_positive, $bill->amount_min, $bill->amount_max);
|
||||||
Log::debug('Journal #' . $journal->id . ' has description "' . $description . '"');
|
Log::debug('Journal #' . $journal->id . ' has description "' . $description . '"');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If both, update!
|
* If both, update!
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user