From 7a0dbc5ad0ad4c5c24876e8bc372ee6b1983e0e4 Mon Sep 17 00:00:00 2001 From: desplega Date: Tue, 9 Aug 2022 13:51:23 +0200 Subject: [PATCH 01/14] Fix: Download file should be possible regardless delete permissions. --- resources/views/components/media/file.blade.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/views/components/media/file.blade.php b/resources/views/components/media/file.blade.php index 87687236c..91ca06fb6 100644 --- a/resources/views/components/media/file.blade.php +++ b/resources/views/components/media/file.blade.php @@ -14,15 +14,15 @@ @can('delete-common-uploads') delete - - @if ($options) - - - - @endif - - download @endcan + @if ($options) + + + + @endif + + download + From cadfff459c2ce44985dd99e89b339c6815d8124c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 9 Aug 2022 18:13:12 +0300 Subject: [PATCH 02/14] Added Transaction job new events.. --- .../Banking/DocumentTransactionCreated.php | 26 ++++++++++++++++ .../Banking/DocumentTransactionCreating.php | 25 ++++++++++++++++ .../Banking/DocumentTransactionUpdated.php | 30 +++++++++++++++++++ .../Banking/DocumentTransactionUpdating.php | 30 +++++++++++++++++++ app/Events/Banking/TransactionUpdated.php | 25 ++++++++++++++++ app/Events/Banking/TransactionUpdating.php | 25 ++++++++++++++++ .../CreateBankingDocumentTransaction.php | 6 ++++ .../UpdateBankingDocumentTransaction.php | 8 ++++- app/Jobs/Banking/UpdateTransaction.php | 6 ++++ 9 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 app/Events/Banking/DocumentTransactionCreated.php create mode 100644 app/Events/Banking/DocumentTransactionCreating.php create mode 100644 app/Events/Banking/DocumentTransactionUpdated.php create mode 100644 app/Events/Banking/DocumentTransactionUpdating.php create mode 100644 app/Events/Banking/TransactionUpdated.php create mode 100644 app/Events/Banking/TransactionUpdating.php diff --git a/app/Events/Banking/DocumentTransactionCreated.php b/app/Events/Banking/DocumentTransactionCreated.php new file mode 100644 index 000000000..58fb543bf --- /dev/null +++ b/app/Events/Banking/DocumentTransactionCreated.php @@ -0,0 +1,26 @@ +document = $document; + $this->transaction = $transaction; + } +} diff --git a/app/Events/Banking/DocumentTransactionCreating.php b/app/Events/Banking/DocumentTransactionCreating.php new file mode 100644 index 000000000..c5a366bcf --- /dev/null +++ b/app/Events/Banking/DocumentTransactionCreating.php @@ -0,0 +1,25 @@ +document = $document; + $this->request = $request; + } +} diff --git a/app/Events/Banking/DocumentTransactionUpdated.php b/app/Events/Banking/DocumentTransactionUpdated.php new file mode 100644 index 000000000..3a822fe1c --- /dev/null +++ b/app/Events/Banking/DocumentTransactionUpdated.php @@ -0,0 +1,30 @@ +document = $document; + $this->transaction = $transaction; + $this->request = $request; + } +} diff --git a/app/Events/Banking/DocumentTransactionUpdating.php b/app/Events/Banking/DocumentTransactionUpdating.php new file mode 100644 index 000000000..7bc2a6651 --- /dev/null +++ b/app/Events/Banking/DocumentTransactionUpdating.php @@ -0,0 +1,30 @@ +document = $document; + $this->transaction = $transaction; + $this->request = $request; + } +} diff --git a/app/Events/Banking/TransactionUpdated.php b/app/Events/Banking/TransactionUpdated.php new file mode 100644 index 000000000..59bafc914 --- /dev/null +++ b/app/Events/Banking/TransactionUpdated.php @@ -0,0 +1,25 @@ +transaction = $transaction; + $this->request = $request; + } +} diff --git a/app/Events/Banking/TransactionUpdating.php b/app/Events/Banking/TransactionUpdating.php new file mode 100644 index 000000000..86850cec2 --- /dev/null +++ b/app/Events/Banking/TransactionUpdating.php @@ -0,0 +1,25 @@ +transaction = $transaction; + $this->request = $request; + } +} diff --git a/app/Jobs/Banking/CreateBankingDocumentTransaction.php b/app/Jobs/Banking/CreateBankingDocumentTransaction.php index 139467f0b..94e14d530 100644 --- a/app/Jobs/Banking/CreateBankingDocumentTransaction.php +++ b/app/Jobs/Banking/CreateBankingDocumentTransaction.php @@ -3,6 +3,8 @@ namespace App\Jobs\Banking; use App\Abstracts\Job; +use App\Events\Banking\DocumentTransactionCreated; +use App\Events\Banking\DocumentTransactionCreating; use App\Jobs\Banking\CreateTransaction; use App\Jobs\Document\CreateDocumentHistory; use App\Events\Document\PaidAmountCalculated; @@ -27,6 +29,8 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate public function handle(): Transaction { + event(new DocumentTransactionCreating($this->model, $this->request)); + $this->prepareRequest(); $this->checkAmount(); @@ -46,6 +50,8 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate $this->createHistory(); }); + event(new DocumentTransactionCreated($this->model, $this->transaction)); + return $this->transaction; } diff --git a/app/Jobs/Banking/UpdateBankingDocumentTransaction.php b/app/Jobs/Banking/UpdateBankingDocumentTransaction.php index 914735cf7..1c96c8eb2 100644 --- a/app/Jobs/Banking/UpdateBankingDocumentTransaction.php +++ b/app/Jobs/Banking/UpdateBankingDocumentTransaction.php @@ -3,9 +3,11 @@ namespace App\Jobs\Banking; use App\Abstracts\Job; +use App\Events\Banking\DocumentTransactionUpdated; +use App\Events\Banking\DocumentTransactionUpdating; +use App\Events\Document\PaidAmountCalculated; use App\Jobs\Banking\UpdateTransaction; use App\Jobs\Document\CreateDocumentHistory; -use App\Events\Document\PaidAmountCalculated; use App\Interfaces\Job\ShouldUpdate; use App\Models\Banking\Transaction; use App\Models\Document\Document; @@ -26,6 +28,8 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate public function handle(): Transaction { + event(new DocumentTransactionUpdating($this->model, $this->transaction, $this->request)); + $this->prepareRequest(); $this->checkAmount(); @@ -45,6 +49,8 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate $this->createHistory(); }); + event(new DocumentTransactionUpdated($this->model, $this->transaction, $this->request)); + return $this->transaction; } diff --git a/app/Jobs/Banking/UpdateTransaction.php b/app/Jobs/Banking/UpdateTransaction.php index 45e4a0bce..9408f1c99 100644 --- a/app/Jobs/Banking/UpdateTransaction.php +++ b/app/Jobs/Banking/UpdateTransaction.php @@ -3,6 +3,8 @@ namespace App\Jobs\Banking; use App\Abstracts\Job; +use App\Events\Banking\TransactionUpdated; +use App\Events\Banking\TransactionUpdating; use App\Interfaces\Job\ShouldUpdate; use App\Models\Banking\Transaction; @@ -12,6 +14,8 @@ class UpdateTransaction extends Job implements ShouldUpdate { $this->authorize(); + event(new TransactionUpdating($this->model, $this->request)); + \DB::transaction(function () { $this->model->update($this->request->all()); @@ -32,6 +36,8 @@ class UpdateTransaction extends Job implements ShouldUpdate $this->model->updateRecurring($this->request->all()); }); + event(new TransactionUpdated($this->model, $this->request)); + return $this->model; } From 1b6997db9aca68e11a2cbf19c3e287627373269e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 9 Aug 2022 18:57:56 +0300 Subject: [PATCH 03/14] Wizard fixed logo validation issue. --- resources/assets/js/views/wizard/Company.vue | 54 +++++++++++++++---- .../assets/js/views/wizard/Currencies.vue | 12 ++--- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/resources/assets/js/views/wizard/Company.vue b/resources/assets/js/views/wizard/Company.vue index d85852928..268f159f8 100644 --- a/resources/assets/js/views/wizard/Company.vue +++ b/resources/assets/js/views/wizard/Company.vue @@ -12,7 +12,15 @@