document payment update errors fixed

This commit is contained in:
Cihan Şentürk
2022-07-03 14:59:17 +03:00
parent 87347f0df4
commit 14cd394563
3 changed files with 17 additions and 19 deletions

View File

@@ -3,7 +3,7 @@
namespace App\Jobs\Banking;
use App\Abstracts\Job;
use App\Jobs\Banking\CreateTransaction;
use App\Jobs\Banking\UpdateTransaction;
use App\Jobs\Document\CreateDocumentHistory;
use App\Events\Document\PaidAmountCalculated;
use App\Interfaces\Job\ShouldUpdate;
@@ -21,7 +21,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$this->model = $model;
$this->transaction = $transaction;
parent::__construct($request);
$this->request = $this->getRequestInstance($request);
}
public function handle(): Transaction
@@ -31,7 +31,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$this->checkAmount();
\DB::transaction(function () {
$this->transaction = $this->dispatch(new CreateTransaction($this->request));
$this->transaction = $this->dispatch(new UpdateTransaction($this->transaction, $this->request));
// Upload attachment
if ($this->request->file('attachment')) {