Check for valid reference object in recurring finance (#1056)
This commit is contained in:
parent
936cd2efd3
commit
922e754c9e
@ -66,6 +66,10 @@ class RecurringFinanceService extends Service
|
||||
$obj = $expense->getReferencedObject();
|
||||
}
|
||||
|
||||
if (empty($obj)) {
|
||||
return [null, null];
|
||||
}
|
||||
|
||||
if ($klass === 'Airport') {
|
||||
$memo = "Airport Expense: {$expense->name} ({$expense->ref_model_id})";
|
||||
$transaction_group = "Airport: {$expense->ref_model_id}";
|
||||
@ -128,6 +132,9 @@ class RecurringFinanceService extends Service
|
||||
}
|
||||
|
||||
[$memo, $ta_group] = $this->getMemoAndGroup($expense);
|
||||
if (empty($memo) || empty($ta_group)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->financeSvc->debitFromJournal(
|
||||
$journal,
|
||||
|
Loading…
Reference in New Issue
Block a user