Merge branch 'master' of https://github.com/brkcvn/akaunting into code-clean

This commit is contained in:
Burak Civan 2022-08-11 09:51:48 +03:00
commit 53674b13d4
31 changed files with 473 additions and 191 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace App\Events\Banking;
use App\Abstracts\Event;
use App\Models\Banking\Transaction;
use App\Models\Document\Document;
class DocumentTransactionCreated extends Event
{
public $document;
public $transaction;
/**
* Create a new event instance.
*
* @param $document
* @param $transaction
*/
public function __construct(Document $document, Transaction $transaction)
{
$this->document = $document;
$this->transaction = $transaction;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Events\Banking;
use App\Abstracts\Event;
use App\Models\Document\Document;
class DocumentTransactionCreating extends Event
{
public $document;
public $request;
/**
* Create a new event instance.
*
* @param $document
* @param $request
*/
public function __construct(Document $document, $request)
{
$this->document = $document;
$this->request = $request;
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Events\Banking;
use App\Abstracts\Event;
use App\Models\Banking\Transaction;
use App\Models\Document\Document;
class DocumentTransactionUpdated extends Event
{
public $document;
public $transaction;
public $request;
/**
* Create a new event instance.
*
* @param $document
* @param $transaction
* @param $request
*/
public function __construct(Document $document, Transaction $transaction, $request)
{
$this->document = $document;
$this->transaction = $transaction;
$this->request = $request;
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Events\Banking;
use App\Abstracts\Event;
use App\Models\Banking\Transaction;
use App\Models\Document\Document;
class DocumentTransactionUpdating extends Event
{
public $document;
public $transaction;
public $request;
/**
* Create a new event instance.
*
* @param $document
* @param $transaction
* @param $request
*/
public function __construct(Document $document, Transaction $transaction, $request)
{
$this->document = $document;
$this->transaction = $transaction;
$this->request = $request;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Events\Banking;
use App\Abstracts\Event;
use App\Models\Banking\Transaction;
class TransactionUpdated extends Event
{
public $transaction;
public $request;
/**
* Create a new event instance.
*
* @param $transaction
* @param $request
*/
public function __construct(Transaction $transaction, $request)
{
$this->transaction = $transaction;
$this->request = $request;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Events\Banking;
use App\Abstracts\Event;
use App\Models\Banking\Transaction;
class TransactionUpdating extends Event
{
public $transaction;
public $request;
/**
* Create a new event instance.
*
* @param $transaction
* @param $request
*/
public function __construct(Transaction $transaction, $request)
{
$this->transaction = $transaction;
$this->request = $request;
}
}

View File

@ -16,10 +16,16 @@ class Bills extends Export implements WithColumnFormatting
public function map($model): array
{
$country = null;
if ($model->contact_country && array_key_exists($model->contact_country, trans('countries'))) {
$country = trans('countries.' . $model->contact_country);
}
$model->category_name = $model->category->name;
$model->bill_number = $model->document_number;
$model->billed_at = $model->issued_at;
$model->contact_country = ($model->contact_country) ? trans('countries.' . $model->contact_country) : null;
$model->contact_country = $country;
return parent::map($model);
}

View File

@ -14,7 +14,13 @@ class Vendors extends Export
public function map($model): array
{
$model->country = ($model->country) ? trans('countries.' . $model->country) : null;
$country = null;
if ($model->country && array_key_exists($model->country, trans('countries'))) {
$country = trans('countries.' . $model->country);
}
$model->country = $country;
return parent::map($model);
}

View File

@ -14,7 +14,13 @@ class Customers extends Export
public function map($model): array
{
$model->country = ($model->country) ? trans('countries.' . $model->country) : null;
$country = null;
if ($model->country && array_key_exists($model->country, trans('countries'))) {
$country = trans('countries.' . $model->country);
}
$model->country = $country;
return parent::map($model);
}

View File

@ -16,10 +16,16 @@ class Invoices extends Export implements WithColumnFormatting
public function map($model): array
{
$country = null;
if ($model->contact_country && array_key_exists($model->contact_country, trans('countries'))) {
$country = trans('countries.' . $model->contact_country);
}
$model->category_name = $model->category->name;
$model->invoice_number = $model->document_number;
$model->invoiced_at = $model->issued_at;
$model->contact_country = ($model->contact_country) ? trans('countries.' . $model->contact_country) : null;
$model->contact_country = $country;
return parent::map($model);
}

View File

@ -45,6 +45,10 @@ class Company extends FormRequest
$rules['api_key'] = 'string|check';
}
if (setting('apps.api_key', false) && (setting('apps.api_key', false) != $this->request->get('api_key'))) {
$rules['api_key'] = 'string|check';
}
return $rules;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -526,8 +526,10 @@ class Company extends Eloquent implements Ownable
$location[] = setting('company.state');
}
if (setting('company.country')) {
$location[] = trans('countries.' . setting('company.country'));
$country = setting('company.country');
if ($country && in_array($country, trans('countries'))) {
$location[] = trans('countries.' . $country);
}
return implode(', ', $location);

View File

@ -254,7 +254,7 @@ class Contact extends Model
$location[] = $this->state;
}
if ($this->country) {
if ($this->country && in_array($this->country, trans('countries'))) {
$location[] = trans('countries.' . $this->country);
}

View File

@ -463,7 +463,7 @@ class Document extends Model
$location[] = $this->contact_state;
}
if ($this->contact_country) {
if ($this->contact_country && in_array($this->contact_country, trans('countries'))) {
$location[] = trans('countries.' . $this->contact_country);
}

View File

@ -37,7 +37,7 @@ class Country extends Component
*/
public function render()
{
if (! empty($this->code)) {
if (! empty($this->code) && in_array($this->code, trans('countries'))) {
$this->country = trans('countries.' . $this->code);
}

135
composer.lock generated
View File

@ -209,16 +209,16 @@
},
{
"name": "akaunting/laravel-language",
"version": "1.0.21",
"version": "1.0.22",
"source": {
"type": "git",
"url": "https://github.com/akaunting/laravel-language.git",
"reference": "7b045415bfac261583be5195e8c7288898ba39a8"
"reference": "83285fb4ad450b406f2df8570090828e4326ee1a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/akaunting/laravel-language/zipball/7b045415bfac261583be5195e8c7288898ba39a8",
"reference": "7b045415bfac261583be5195e8c7288898ba39a8",
"url": "https://api.github.com/repos/akaunting/laravel-language/zipball/83285fb4ad450b406f2df8570090828e4326ee1a",
"reference": "83285fb4ad450b406f2df8570090828e4326ee1a",
"shasum": ""
},
"require": {
@ -265,9 +265,9 @@
],
"support": {
"issues": "https://github.com/akaunting/laravel-language/issues",
"source": "https://github.com/akaunting/laravel-language/tree/1.0.21"
"source": "https://github.com/akaunting/laravel-language/tree/1.0.22"
},
"time": "2022-06-02T10:48:01+00:00"
"time": "2022-08-05T07:33:12+00:00"
},
{
"name": "akaunting/laravel-menu",
@ -907,16 +907,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.232.1",
"version": "3.232.4",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "7e79325815640d21f3bcab9889f7002a8268d674"
"reference": "c23943f845b4418d82b8a804ebc2b961de9f9eea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7e79325815640d21f3bcab9889f7002a8268d674",
"reference": "7e79325815640d21f3bcab9889f7002a8268d674",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c23943f845b4418d82b8a804ebc2b961de9f9eea",
"reference": "c23943f845b4418d82b8a804ebc2b961de9f9eea",
"shasum": ""
},
"require": {
@ -993,9 +993,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.232.1"
"source": "https://github.com/aws/aws-sdk-php/tree/3.232.4"
},
"time": "2022-08-03T18:16:18+00:00"
"time": "2022-08-09T18:20:29+00:00"
},
{
"name": "balping/json-raw-encoder",
@ -1411,26 +1411,26 @@
},
{
"name": "brick/math",
"version": "0.9.3",
"version": "0.10.1",
"source": {
"type": "git",
"url": "https://github.com/brick/math.git",
"reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae"
"reference": "de846578401f4e58f911b3afeb62ced56365ed87"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae",
"reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae",
"url": "https://api.github.com/repos/brick/math/zipball/de846578401f4e58f911b3afeb62ced56365ed87",
"reference": "de846578401f4e58f911b3afeb62ced56365ed87",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.1 || ^8.0"
"php": "^7.4 || ^8.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0",
"vimeo/psalm": "4.9.2"
"phpunit/phpunit": "^9.0",
"vimeo/psalm": "4.25.0"
},
"type": "library",
"autoload": {
@ -1455,19 +1455,15 @@
],
"support": {
"issues": "https://github.com/brick/math/issues",
"source": "https://github.com/brick/math/tree/0.9.3"
"source": "https://github.com/brick/math/tree/0.10.1"
},
"funding": [
{
"url": "https://github.com/BenMorel",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/brick/math",
"type": "tidelift"
}
],
"time": "2021-08-15T20:50:18+00:00"
"time": "2022-08-01T22:54:31+00:00"
},
{
"name": "clue/stream-filter",
@ -1845,16 +1841,16 @@
},
{
"name": "doctrine/dbal",
"version": "3.3.7",
"version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "9f79d4650430b582f4598fe0954ef4d52fbc0a8a"
"reference": "118a360e9437e88d49024f36283c8bcbd76105f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/9f79d4650430b582f4598fe0954ef4d52fbc0a8a",
"reference": "9f79d4650430b582f4598fe0954ef4d52fbc0a8a",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/118a360e9437e88d49024f36283c8bcbd76105f5",
"reference": "118a360e9437e88d49024f36283c8bcbd76105f5",
"shasum": ""
},
"require": {
@ -1862,21 +1858,21 @@
"doctrine/cache": "^1.11|^2.0",
"doctrine/deprecations": "^0.5.3|^1",
"doctrine/event-manager": "^1.0",
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"psr/cache": "^1|^2|^3",
"psr/log": "^1|^2|^3"
},
"require-dev": {
"doctrine/coding-standard": "9.0.0",
"jetbrains/phpstorm-stubs": "2022.1",
"phpstan/phpstan": "1.7.13",
"phpstan/phpstan-strict-rules": "^1.2",
"phpunit/phpunit": "9.5.20",
"psalm/plugin-phpunit": "0.16.1",
"squizlabs/php_codesniffer": "3.7.0",
"symfony/cache": "^5.2|^6.0",
"symfony/console": "^2.7|^3.0|^4.0|^5.0|^6.0",
"vimeo/psalm": "4.23.0"
"phpstan/phpstan": "1.8.2",
"phpstan/phpstan-strict-rules": "^1.3",
"phpunit/phpunit": "9.5.21",
"psalm/plugin-phpunit": "0.17.0",
"squizlabs/php_codesniffer": "3.7.1",
"symfony/cache": "^5.4|^6.0",
"symfony/console": "^4.4|^5.4|^6.0",
"vimeo/psalm": "4.24.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
@ -1936,7 +1932,7 @@
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/3.3.7"
"source": "https://github.com/doctrine/dbal/tree/3.4.0"
},
"funding": [
{
@ -1952,7 +1948,7 @@
"type": "tidelift"
}
],
"time": "2022-06-13T21:43:03+00:00"
"time": "2022-08-06T20:35:57+00:00"
},
{
"name": "doctrine/deprecations",
@ -4472,16 +4468,16 @@
},
{
"name": "laravel/framework",
"version": "v9.23.0",
"version": "v9.24.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "c4eea9060d847b5c93957b203caa8f57544a76ab"
"reference": "053840f579cf01d353d81333802afced79b1c0af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/c4eea9060d847b5c93957b203caa8f57544a76ab",
"reference": "c4eea9060d847b5c93957b203caa8f57544a76ab",
"url": "https://api.github.com/repos/laravel/framework/zipball/053840f579cf01d353d81333802afced79b1c0af",
"reference": "053840f579cf01d353d81333802afced79b1c0af",
"shasum": ""
},
"require": {
@ -4648,7 +4644,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-08-02T14:24:44+00:00"
"time": "2022-08-09T13:43:22+00:00"
},
{
"name": "laravel/sanctum",
@ -5575,16 +5571,16 @@
},
{
"name": "livewire/livewire",
"version": "v2.10.6",
"version": "v2.10.7",
"source": {
"type": "git",
"url": "https://github.com/livewire/livewire.git",
"reference": "020ad095cf1239138b097d22b584e2701ec3edfb"
"reference": "fa0441bf82f1674beecb3a8ad8a4ae428736ed18"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/livewire/livewire/zipball/020ad095cf1239138b097d22b584e2701ec3edfb",
"reference": "020ad095cf1239138b097d22b584e2701ec3edfb",
"url": "https://api.github.com/repos/livewire/livewire/zipball/fa0441bf82f1674beecb3a8ad8a4ae428736ed18",
"reference": "fa0441bf82f1674beecb3a8ad8a4ae428736ed18",
"shasum": ""
},
"require": {
@ -5636,7 +5632,7 @@
"description": "A front-end framework for Laravel.",
"support": {
"issues": "https://github.com/livewire/livewire/issues",
"source": "https://github.com/livewire/livewire/tree/v2.10.6"
"source": "https://github.com/livewire/livewire/tree/v2.10.7"
},
"funding": [
{
@ -5644,7 +5640,7 @@
"type": "github"
}
],
"time": "2022-06-19T02:54:20+00:00"
"time": "2022-08-08T13:52:53+00:00"
},
{
"name": "lorisleiva/laravel-search-string",
@ -6525,16 +6521,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.60.0",
"version": "2.61.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "00a259ae02b003c563158b54fb6743252b638ea6"
"reference": "bdf4f4fe3a3eac4de84dbec0738082a862c68ba6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/00a259ae02b003c563158b54fb6743252b638ea6",
"reference": "00a259ae02b003c563158b54fb6743252b638ea6",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bdf4f4fe3a3eac4de84dbec0738082a862c68ba6",
"reference": "bdf4f4fe3a3eac4de84dbec0738082a862c68ba6",
"shasum": ""
},
"require": {
@ -6623,7 +6619,7 @@
"type": "tidelift"
}
],
"time": "2022-07-27T15:57:48+00:00"
"time": "2022-08-06T12:41:24+00:00"
},
{
"name": "nette/schema",
@ -8562,20 +8558,20 @@
},
{
"name": "ramsey/uuid",
"version": "4.3.1",
"version": "4.4.0",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "8505afd4fea63b81a85d3b7b53ac3cb8dc347c28"
"reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/8505afd4fea63b81a85d3b7b53ac3cb8dc347c28",
"reference": "8505afd4fea63b81a85d3b7b53ac3cb8dc347c28",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/373f7bacfcf3de038778ff27dcce5672ddbf4c8a",
"reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a",
"shasum": ""
},
"require": {
"brick/math": "^0.8 || ^0.9",
"brick/math": "^0.8 || ^0.9 || ^0.10",
"ext-ctype": "*",
"ext-json": "*",
"php": "^8.0",
@ -8591,7 +8587,6 @@
"doctrine/annotations": "^1.8",
"ergebnis/composer-normalize": "^2.15",
"mockery/mockery": "^1.3",
"moontoast/math": "^1.1",
"paragonie/random-lib": "^2",
"php-mock/php-mock": "^2.2",
"php-mock/php-mock-mockery": "^1.3",
@ -8640,7 +8635,7 @@
],
"support": {
"issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.3.1"
"source": "https://github.com/ramsey/uuid/tree/4.4.0"
},
"funding": [
{
@ -8652,7 +8647,7 @@
"type": "tidelift"
}
],
"time": "2022-03-27T21:42:02+00:00"
"time": "2022-08-05T17:58:37+00:00"
},
{
"name": "riverskies/laravel-mobile-detect",
@ -13899,16 +13894,16 @@
},
{
"name": "spatie/flare-client-php",
"version": "1.2.0",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/flare-client-php.git",
"reference": "86a380f5b1ce839af04a08f1c8f2697184cdf23f"
"reference": "b1b974348750925b717fa8c8b97a0db0d1aa40ca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/86a380f5b1ce839af04a08f1c8f2697184cdf23f",
"reference": "86a380f5b1ce839af04a08f1c8f2697184cdf23f",
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/b1b974348750925b717fa8c8b97a0db0d1aa40ca",
"reference": "b1b974348750925b717fa8c8b97a0db0d1aa40ca",
"shasum": ""
},
"require": {
@ -13956,7 +13951,7 @@
],
"support": {
"issues": "https://github.com/spatie/flare-client-php/issues",
"source": "https://github.com/spatie/flare-client-php/tree/1.2.0"
"source": "https://github.com/spatie/flare-client-php/tree/1.3.0"
},
"funding": [
{
@ -13964,7 +13959,7 @@
"type": "github"
}
],
"time": "2022-05-16T12:13:39+00:00"
"time": "2022-08-08T10:10:20+00:00"
},
{
"name": "spatie/ignition",

View File

@ -10,15 +10,15 @@ return [
'minor' => '0',
'patch' => '5',
'patch' => '6',
'build' => '',
'status' => 'Stable',
'date' => '15-July-2022',
'date' => '10-August-2022',
'time' => '23:50',
'time' => '12:00',
'zone' => 'GMT +3',

View File

@ -412,10 +412,12 @@ return new class extends Migration
$table->integer('role_id')->unsigned();
$table->string('user_type');
$table->primary(['user_id', 'role_id', 'user_type']);
});
Schema::table('user_roles', function (Blueprint $table) {
$table->foreign('role_id')->references('id')->on('roles')
->onUpdate('cascade')->onDelete('cascade');
$table->primary(['user_id', 'role_id', 'user_type']);
});
// Reconciliations

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"/livewire.js":"/livewire.js?id=c69d0f2801c01fcf8166"}
{"/livewire.js":"/livewire.js?id=de3fca26689cb5a39af4"}

View File

@ -710,9 +710,9 @@ export default {
Promise.resolve(window.axios.get(url))
.then(response => {
if (response.data.success) {
modal.title = response.data.title;
modal.title = response.data.data.title;
modal.html = response.data.html;
modal.buttons = response.data.buttons;
modal.buttons = response.data.data.buttons;
this.component = Vue.component('add-new-component', (resolve, reject) => {
resolve({

View File

@ -12,7 +12,15 @@
<div class="flex flex-col justify-between">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5 menu-scroll gap-10">
<div class="sm:col-span-6">
<base-input not-required :label="translations.company.api_key" name="api_key" data-name="api_key" :placeholder="translations.company.api_key" v-model="company.api_key"/>
<base-input
not-required
:label="translations.company.api_key"
name="api_key"
data-name="api_key"
:placeholder="translations.company.api_key"
v-model="company.api_key"
:error="onFailErrorGet('api_key')"
/>
<div class="mt-2">
<small>
@ -23,30 +31,45 @@
</div>
<div class="sm:col-span-3">
<base-input not-required type="text" :label="translations.company.tax_number" name="tax_number" data-name="tax_number" :placeholder="translations.company.tax_number" v-model="company.tax_number"/>
<base-input
not-required
type="text"
:label="translations.company.tax_number"
name="tax_number"
data-name="tax_number"
:placeholder="translations.company.tax_number"
v-model="company.tax_number"
:error="onFailErrorGet('tax_number')"
/>
</div>
<div class="sm:col-span-3">
<akaunting-date not-required :title="translations.company.financial_start" data-name="financial_start" :placeholder="translations.company.financial_start" icon="calendar_today"
<akaunting-date
not-required
:title="translations.company.financial_start"
data-name="financial_start"
:placeholder="translations.company.financial_start"
icon="calendar_today"
:date-config="{
dateFormat: 'd-m',
allowInput: false,
altInput: true,
altFormat: 'j F'
dateFormat: 'd-m',
allowInput: false,
altInput: true,
altFormat: 'j F'
}"
v-model="company.financial_start"
:form-error="onFailErrorGet('financial_start')"
></akaunting-date>
</div>
<div class="sm:col-span-3 grid gap-10">
<div class="sm:col-span-3">
<base-input not-required :label="translations.company.address">
<base-input not-required :label="translations.company.address" :error="onFailErrorGet('address')">
<textarea class="w-full text-sm px-3 py-2.5 mt-1 rounded-lg border border-light-gray text-black placeholder-light-gray bg-white disabled:bg-gray-200 focus:outline-none focus:ring-transparent focus:border-purple" name="address" data-name="address" rows="3" :placeholder="translations.company.address" v-model="company.address"></textarea>
</base-input>
</div>
<div class="sm:col-span-3">
<base-input not-required :label="translations.company.country">
<base-input not-required :label="translations.company.country" :error="onFailErrorGet('country')">
<el-select v-model="company.country" filterable>
<el-option
v-for="(country, index) in sortedCountries"
@ -63,24 +86,31 @@
</div>
<div class="sm:col-span-3">
<label class="text-black text-sm font-medium">{{ translations.company.logo }}</label>
<label class="text-black text-sm font-medium">
{{ translations.company.logo }}
</label>
<akaunting-dropzone-file-upload ref="dropzoneWizard" class="form-file dropzone-column w-2/5" style="height:12.2rem" preview-classes="single" :attachments="logo" :v-model="logo">
</akaunting-dropzone-file-upload>
<div v-if="onFailErrorGet('logo')" class="text-red text-sm mt-1 block" v-html="onFailErrorGet('logo')"></div>
</div>
</div>
<div class="flex items-center justify-center mt-5 gap-x-10">
<base-button class="w-1/2 flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100" @click="next()">{{ translations.company.skip }}</base-button>
<base-button class="w-1/2 flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100" @click="next()">
{{ translations.company.skip }}
</base-button>
<button
type="submit"
id="button"
:disabled="button_loading"
:disabled="button_loading_company"
class="w-1/2 relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100"
@click="onEditSave($event)"
>
<i v-if="button_loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': button_loading}]">
<i v-if="button_loading_company" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': button_loading_company}]">
{{ translations.company.save }}
</span>
</button>
@ -156,6 +186,7 @@ export default {
real_date: "",
lang_data: '',
sorted_countries: [],
button_loading_company: false
};
},
@ -250,6 +281,7 @@ export default {
size: company.logo.size,
downloadPath: false,
}];
this.logo.push(logo_arr);
}
}
@ -257,6 +289,8 @@ export default {
onEditSave(event) {
event.preventDefault();
this.button_loading_company = true;
FormData.prototype.appendRecursive = function (data, wrapper = null) {
for (var name in data) {
@ -331,8 +365,11 @@ export default {
this.onSuccessMessage(response);
this.$router.push("/wizard/currencies");
this.button_loading_company = false;
}, this)
.catch((error) => {
this.onFailError(error);
this.button_loading_company = false;
}, this);
},

View File

@ -61,9 +61,9 @@
<td class="w-full p-0 current-tab" v-if="current_tab == index">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 py-3">
<base-input name="name" data-name="name"
form-classes="sm:col-span-2"
v-model="model.name"
:error="onFailErrorGet('name')"
form-classes="sm:col-span-2"
v-model="model.name"
:error="onFailErrorGet('name')"
/>
<base-input class="sm:col-span-2" :error="onFailErrorGet('code')">
@ -79,9 +79,9 @@
</base-input>
<base-input name="rate" data-name="rate" :placeholder="translations.currencies.rate"
form-classes="sm:col-span-2"
v-model="model.rate"
:error="onFailErrorGet('rate')"
form-classes="sm:col-span-2"
v-model="model.rate"
:error="onFailErrorGet('rate')"
/>
<div class="flex justify-end items-center sm:col-span-6">

View File

@ -15,23 +15,28 @@
<h1 class="sm:col-span-6 text-black-300 mb-2">
{{ translations.finish.recommended_apps }}
</h1>
<div v-for="(item, index) in modules" :key="index" class="sm:col-span-6 mb-6">
<a :href="route_url + '/apps/' + item.slug" class="flex items-center">
<div class="w-1/4">
<img v-for="(file, indis) in item.files" :key="indis" v-if="file.media_type == 'image' && file.pivot.zone == 'thumbnail'"
:src="file.path_string"
:alt="item.name"
class="rounded-lg object-cover"
:src="file.path_string"
:alt="item.name"
class="rounded-lg object-cover"
/>
</div>
<div class="w-3/4 ltr:pl-8 rtl:pr-8">
<span class="font-medium">{{ item.name }}</span>
<div class="text-black-300 text-sm my-2 line-clamp-2 h-10"
v-html="item.description"></div>
<span class="font-medium">
{{ item.name }}
</span>
<div class="text-black-300 text-sm my-2 line-clamp-2 h-10" v-html="item.description"></div>
</div>
</a>
</div>
</div>
<div class="lg:hidden">
<base-button class="btn flex items-center justify-center text-base disabled:opacity-50 relative mt-5 mx-auto bg-green hover:bg-gray-100 text-white rounded-md py-3 px-5 font-semibold" @click="finish()">
{{ translations.finish.create_first_invoice }}
@ -44,14 +49,16 @@
<div class="w-48 text-white rtl:float-left rtl:text-left text-2xl font-semibold leading-9">
{{ translations.finish.apps_managing }}
</div>
<div style="width:372px; height:372px;"></div>
<img :src="image_src" class="absolute top-0 right-2" alt="" />
</div>
<base-button class="flex items-center justify-center text-base rounded-lg disabled:opacity-50 relative m-auto bottom-48 bg-white hover:bg-gray-100 text-purple rounded-md py-3 px-5 font-semibold btn-default" @click="finish()">
{{ translations.finish.create_first_invoice }}
</base-button>
</div>
</div>
</div>
</div>
@ -123,9 +130,9 @@ export default {
</script>
<style scoped>
@media only screen and (max-width: 991px) {
[modal-container] {
height: 100% !important;
}
}
@media only screen and (max-width: 991px) {
[modal-container] {
height: 100% !important;
}
}
</style>

View File

@ -1,72 +1,88 @@
<template>
<div>
<nav aria-label="Progress">
<ol role="list" class="flex mb-10">
<li class="w-1/4">
<span class="pr-6 flex flex-col">
<span
:class="[{'bg-purple': active_state > 0}, {'bg-purple': active_state == 0}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 0}, {'font-bold': active_state > 0}]" class="text-sm font-normal mt-2">{{ translations.company.title }}</span>
</span>
</li>
<div>
<nav aria-label="Progress">
<ol role="list" class="flex mb-10">
<li class="w-1/4">
<span class="pr-6 flex flex-col">
<span
:class="[{'bg-purple': active_state > 0}, {'bg-purple': active_state == 0}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent"
>Text</span>
<li class="w-1/4">
<span class="px-3 flex flex-col">
<span
:class="[{'bg-purple': active_state > 1}, {'bg-purple': active_state == 1}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 1}, {'font-bold': active_state > 1}]" class="text-sm font-normal mt-2">{{ translations.currencies.title }}</span>
</span>
</li>
<span :class="[{'font-bold': active_state == 0}, {'font-bold': active_state > 0}]" class="text-sm font-normal mt-2">
{{ translations.company.title }}
</span>
</span>
</li>
<li class="w-1/4">
<span class="px-3 flex flex-col">
<span
:class="[{'bg-purple': active_state > 2}, {'bg-purple': active_state == 2}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 2}, {'font-bold': active_state > 2}]" class="text-sm font-normal mt-2">{{ translations.taxes.title }}</span>
</span>
</li>
<li class="w-1/4">
<span class="px-3 flex flex-col">
<span
:class="[{'bg-purple': active_state > 1}, {'bg-purple': active_state == 1}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent"
>Text</span>
<li class="w-1/4">
<span class="pl-6 flex flex-col">
<span
:class="[{'bg-purple': active_state == 3}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent">Text</span>
<span :class="[{'font-bold': active_state == 3}]" class="text-sm font-normal mt-2">{{ translations.finish.title }}</span>
</span>
</li>
</ol>
</nav>
</div>
<span :class="[{'font-bold': active_state == 1}, {'font-bold': active_state > 1}]" class="text-sm font-normal mt-2">
{{ translations.currencies.title }}
</span>
</span>
</li>
<li class="w-1/4">
<span class="px-3 flex flex-col">
<span
:class="[{'bg-purple': active_state > 2}, {'bg-purple': active_state == 2}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent"
>Text</span>
<span :class="[{'font-bold': active_state == 2}, {'font-bold': active_state > 2}]" class="text-sm font-normal mt-2">
{{ translations.taxes.title }}
</span>
</span>
</li>
<li class="w-1/4">
<span class="pl-6 flex flex-col">
<span
:class="[{'bg-purple': active_state == 3}]"
class="w-full h-1 bg-gray-300 rounded-xl text-transparent"
>Text</span>
<span :class="[{'font-bold': active_state == 3}]" class="text-sm font-normal mt-2">
{{ translations.finish.title }}
</span>
</span>
</li>
</ol>
</nav>
</div>
</template>
<script>
export default {
name: "Steps",
export default {
name: "Steps",
components: {},
components: {},
props: {
active_state: {
type: [Boolean, String, Number],
}
},
props: {
active_state: {
type: [Boolean, String, Number],
}
},
created() {
this.translations = wizard_translations;
},
created() {
this.translations = wizard_translations;
},
data() {
return {
translations: {
company: {},
currencies: {},
taxes: {},
finish: {},
},
};
},
};
</script>
data() {
return {
translations: {
company: {},
currencies: {},
taxes: {},
finish: {},
},
};
},
};
</script>

View File

@ -87,6 +87,13 @@ L\'actualització de :alias des de :current_version a :new_version ha fallat al
],
'import_failed' => [
'subject' => 'Ha fallat la importació',
'description' => 'No s\'ha pogut importar l\'arxiu per vàries raons. Pots mirar el teu correu per tenir-ne més detalls.',
],
'new_apps' => [
'title' => 'Nova App',

View File

@ -2,27 +2,36 @@
<div class="flex items-center">
@if ($file->aggregate_type == 'image')
<span class="material-icons text-base">image</span>
@else
<span class="material-icons text-base">attach_file</span>
@else
<span class="material-icons text-base">attach_file</span>
@endif
<div class="flex flex-col text-gray-500 ltr:ml-3 rtl:mr-3 gap-y-1">
<span class="w-64 text-sm truncate">{{ $file->basename }}</span>
<span class="text-xs mb-0">{{ $file->readableSize() }}</span>
<span class="w-64 text-sm truncate">
{{ $file->basename }}
</span>
<span class="text-xs mb-0">
{{ $file->readableSize() }}
</span>
</div>
</div>
<div class="flex flex-row lg:flex-col gap-x-1">
@can('delete-common-uploads')
<x-link href="javascript:void();" id="remove-{{ $column_name }}" @click="onDeleteFile('{{ $file->id }}', '{{ route('uploads.destroy', $file->id) }}', '{{ trans('general.title.delete', ['type' => $column_name]) }}', '{{ trans('general.delete_confirm', ['name' => $file->basename, 'type' => $column_name]) }} ', '{{ trans('general.cancel') }}', '{{ trans('general.delete') }}')" type="button" class="group" override="class">
<span class="material-icons text-base text-red px-1.5 py-1 rounded-lg group-hover:bg-gray-100">delete</span>
</x-link>
</x-link>
@if ($options)
<input type="hidden" name="page_{{ $file->id}}" id="file-page-{{ $file->id}}" value="{{ $options['page'] }}" />
<input type="hidden" name="key_{{ $file->id}}" id="file-key-{{ $file->id}}" value="{{ $options['key'] }}" />
<input type="hidden" name="value_{{ $file->id}}" id="file-value-{{ $file->id}}" value="{{ $file->id }}" />
@endif
<x-link href="{{ route('uploads.download', $file->id) }}" type="button" class="group" override="class">
<span class="material-icons text-base text-purple px-1.5 py-1 rounded-lg group-hover:bg-gray-100">download</span>
</x-link>
@endcan
<x-link href="{{ route('uploads.download', $file->id) }}" type="button" class="group" override="class">
<span class="material-icons text-base text-purple px-1.5 py-1 rounded-lg group-hover:bg-gray-100">download</span>
</x-link>
</div>
</div>