prevent change/delete for reconciled records

This commit is contained in:
denisdulici
2020-03-13 14:55:50 +03:00
parent 88a3159d68
commit d46e6c44ac
6 changed files with 78 additions and 0 deletions

View File

@@ -41,6 +41,12 @@ class DeleteTransaction extends Job
*/
public function authorize()
{
if ($this->transaction->reconciled) {
$message = trans('messages.warning.reconciled_tran');
throw new \Exception($message);
}
if ($this->transaction->category->id == Category::transfer()) {
throw new \Exception('Unauthorized');
}