Skip to content
Snippets Groups Projects

imp: I-8144 autoClose account reconcile entries

Merged simon requested to merge imp-I-8144-autoClose-reconcile-entries into 1.x
Compare and
4 files
+ 29
2
Preferences
File browser
Compare changes
@@ -562,4 +562,18 @@ class AccountingAccount extends ContentEntityBase implements AccountingAccountIn
return $fields;
}
/**
* {@inheritdoc}
*/
public function transitionClose() {
if ($this->getCurrentBalance() <> 0) {
return;
}
\Drupal::service('accounting.book_entry')->reconcileEntryLines(
$this->getUnreconciledLines());
$this->setState('closed');
$this->save();
}
}