diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index 811d5f7eb..9fafb8340 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -56,6 +56,10 @@ abstract class Report public $loaded = false; + public $bar_formatter_type = 'money'; + + public $donut_formatter_type = 'percent'; + public $chart = [ 'bar' => [ 'colors' => [ @@ -158,27 +162,6 @@ abstract class Report return $this->icon; } - public function getGrandTotal() - { - if (!$this->loaded) { - $this->load(); - } - - if (!empty($this->footer_totals)) { - $sum = 0; - - foreach ($this->footer_totals as $total) { - $sum += is_array($total) ? array_sum($total) : $total; - } - - $total = $this->has_money ? money($sum, default_currency(), true)->format() : $sum; - } else { - $total = trans('general.na'); - } - - return $total; - } - public function getCharts($table_key) { return [ @@ -310,12 +293,12 @@ abstract class Report continue; } - $this->chart[$table_key]['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter(); - $this->chart[$table_key]['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter('percent'); + $this->chart[$table_key]['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->bar_formatter_type); + $this->chart[$table_key]['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->donut_formatter_type); } } else { - $this->chart['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter(); - $this->chart['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter('percent'); + $this->chart['bar']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->bar_formatter_type); + $this->chart['donut']['yaxis']['labels']['formatter'] = $this->getChartLabelFormatter($this->donut_formatter_type); } } diff --git a/app/Events/Common/CompanyCreated.php b/app/Events/Common/CompanyCreated.php index dc0a6f4fc..612cba4ee 100644 --- a/app/Events/Common/CompanyCreated.php +++ b/app/Events/Common/CompanyCreated.php @@ -8,13 +8,16 @@ class CompanyCreated extends Event { public $company; + public $request; + /** * Create a new event instance. * * @param $company */ - public function __construct($company) + public function __construct($company, $request = null) { $this->company = $company; + $this->request = $request; } } diff --git a/app/Http/Controllers/Common/Companies.php b/app/Http/Controllers/Common/Companies.php index 821a9e53e..a31c0ddb3 100644 --- a/app/Http/Controllers/Common/Companies.php +++ b/app/Http/Controllers/Common/Companies.php @@ -10,6 +10,7 @@ use App\Jobs\Common\UpdateCompany; use App\Models\Common\Company; use App\Traits\Uploads; use App\Traits\Users; +use Akaunting\Money\Currency as MoneyCurrency; class Companies extends Controller { @@ -44,7 +45,15 @@ class Companies extends Controller */ public function create() { - return view('common.companies.create'); + $money_currencies = MoneyCurrency::getCurrencies(); + + $currencies = []; + + foreach ($money_currencies as $key => $item) { + $currencies[$key] = $key . ' - ' . $item['name']; + } + + return view('common.companies.create', compact('currencies')); } /** @@ -61,7 +70,7 @@ class Companies extends Controller $response = $this->ajaxDispatch(new CreateCompany($request)); if ($response['success']) { - $response['redirect'] = route('companies.index'); + $response['redirect'] = route('companies.switch', $response['data']->id); $message = trans('messages.success.added', ['type' => trans_choice('general.companies', 1)]); @@ -92,7 +101,15 @@ class Companies extends Controller return redirect()->route('companies.index'); } - return view('common.companies.edit', compact('company')); + $money_currencies = MoneyCurrency::getCurrencies(); + + $currencies = []; + + foreach ($money_currencies as $key => $item) { + $currencies[$key] = $key . ' - ' . $item['name']; + } + + return view('common.companies.edit', compact('company', 'currencies')); } /** diff --git a/app/Http/Controllers/Wizard/Taxes.php b/app/Http/Controllers/Wizard/Taxes.php deleted file mode 100644 index 80a81c4f5..000000000 --- a/app/Http/Controllers/Wizard/Taxes.php +++ /dev/null @@ -1,117 +0,0 @@ -middleware('permission:create-settings-taxes')->only('create', 'store', 'duplicate', 'import'); - $this->middleware('permission:read-settings-taxes')->only('index', 'show', 'edit', 'export'); - $this->middleware('permission:update-settings-taxes')->only('update', 'enable', 'disable'); - $this->middleware('permission:delete-settings-taxes')->only('destroy'); - } - - /** - * Show the form for editing the specified resource. - * - * @return Response - */ - public function index() - { - $taxes = Tax::collect(); - - return $this->response('wizard.taxes.index', compact('taxes')); - } - - /** - * Show the form for viewing the specified resource. - * - * @return Response - */ - public function show() - { - return redirect()->route('wizard.taxes.index'); - } - - /** - * Store a newly created resource in storage. - * - * @param Request $request - * - * @return Response - */ - public function store(Request $request) - { - $response = $this->ajaxDispatch(new CreateTax($request)); - - if ($response['success']) { - $message = trans('messages.success.added', ['type' => trans_choice('general.taxes', 1)]); - } else { - $message = $response['message']; - } - - $response['message'] = $message; - - return response()->json($response); - } - - /** - * Update the specified resource in storage. - * - * @param Tax $tax - * @param Request $request - * - * @return Response - */ - public function update(Tax $tax, Request $request) - { - $response = $this->ajaxDispatch(new UpdateTax($tax, $request)); - - if ($response['success']) { - $message = trans('messages.success.updated', ['type' => $tax->name]); - } else { - $message = $response['message']; - } - - $response['message'] = $message; - - return response()->json($response); - } - - /** - * Remove the specified resource from storage. - * - * @param Tax $tax - * - * @return Response - */ - public function destroy(Tax $tax) - { - $tax_id = $tax->id; - - $response = $this->ajaxDispatch(new DeleteTax($tax)); - - if ($response['success']) { - $message = trans('messages.success.deleted', ['type' => $tax->name]); - } else { - $message = $response['message']; - } - - $response['tax_id'] = $tax_id; - $response['message'] = $message; - - return response()->json($response); - } -} diff --git a/app/Jobs/Auth/UpdateUser.php b/app/Jobs/Auth/UpdateUser.php index 859691e41..3ebc4dc41 100644 --- a/app/Jobs/Auth/UpdateUser.php +++ b/app/Jobs/Auth/UpdateUser.php @@ -89,26 +89,28 @@ class UpdateUser extends Job implements ShouldUpdate } // Can't unassigned company, The company must be assigned at least one user. - $companies = (array) $this->request->get('companies', []); - $user_companies = $this->model->companies()->pluck('id')->toArray(); + if ($this->request->has('companies')) { + $companies = (array) $this->request->get('companies', []); + $user_companies = $this->model->companies()->pluck('id')->toArray(); - $company_diff = array_diff($user_companies, $companies); + $company_diff = array_diff($user_companies, $companies); - if ($company_diff) { - $errors = []; + if ($company_diff) { + $errors = []; - foreach ($company_diff as $company_id) { - $company = Company::withCount('users')->find($company_id); + foreach ($company_diff as $company_id) { + $company = Company::withCount('users')->find($company_id); - if ($company->users_count < 2) { - $errors[] = trans('auth.error.unassigned', ['company' => $company->name]); + if ($company->users_count < 2) { + $errors[] = trans('auth.error.unassigned', ['company' => $company->name]); + } } - } - if ($errors) { - $message = implode('\n', $errors); + if ($errors) { + $message = implode('\n', $errors); - throw new \Exception($message); + throw new \Exception($message); + } } } } diff --git a/app/Jobs/Common/CreateCompany.php b/app/Jobs/Common/CreateCompany.php index 17807df7c..10c31c6ae 100644 --- a/app/Jobs/Common/CreateCompany.php +++ b/app/Jobs/Common/CreateCompany.php @@ -8,8 +8,12 @@ use App\Events\Common\CompanyCreating; use App\Interfaces\Job\HasOwner; use App\Interfaces\Job\HasSource; use App\Interfaces\Job\ShouldCreate; +use App\Models\Banking\Account; use App\Models\Common\Company; +use App\Models\Setting\Currency; +use Akaunting\Money\Currency as MoneyCurrency; use Illuminate\Support\Facades\Artisan; +use OutOfBoundsException; class CreateCompany extends Job implements HasOwner, HasSource, ShouldCreate { @@ -26,15 +30,17 @@ class CreateCompany extends Job implements HasOwner, HasSource, ShouldCreate $this->callSeeds(); + $this->updateCurrency(); + $this->updateSettings(); }); - event(new CompanyCreated($this->model)); - - if (!empty($current_company_id)) { + if (! empty($current_company_id)) { company($current_company_id)->makeCurrent(); } + event(new CompanyCreated($this->model, $this->request)); + return $this->model; } @@ -99,4 +105,42 @@ class CreateCompany extends Job implements HasOwner, HasSource, ShouldCreate setting()->save(); } + + protected function updateCurrency() + { + $currency_code = $this->request->get('currency'); + + if ($currency_code == 'USD') { + return; + } + + $currency = Currency::where('company_id', $this->model->id) + ->where('code', $currency_code) + ->first(); + + if ($currency) { + $currency->rate = '1'; + $currency->enabled = '1'; + + $currency->save(); + } else { + try { + $data = (new MoneyCurrency($currency_code))->toArray()[$currency_code]; + $data['rate'] = '1'; + $data['enabled'] = '1'; + $data['company_id'] = $this->model->id; + $data['code'] = $currency_code; + $data['created_from'] = 'core::ui'; + $data['created_by'] = user_id(); + + $currency = Currency::create($data); + } catch (OutOfBoundsException $e) { + } + } + + $account = Account::where('company_id', $this->model->id)->first(); + + $account->currency_code = $currency_code; + $account->save(); + } } diff --git a/app/Jobs/Common/UpdateCompany.php b/app/Jobs/Common/UpdateCompany.php index 901766769..db325a4eb 100644 --- a/app/Jobs/Common/UpdateCompany.php +++ b/app/Jobs/Common/UpdateCompany.php @@ -7,7 +7,10 @@ use App\Events\Common\CompanyUpdated; use App\Events\Common\CompanyUpdating; use App\Interfaces\Job\ShouldUpdate; use App\Models\Common\Company; +use App\Models\Setting\Currency; use App\Traits\Users; +use Akaunting\Money\Currency as MoneyCurrency; +use OutOfBoundsException; class UpdateCompany extends Job implements ShouldUpdate { @@ -86,6 +89,8 @@ class UpdateCompany extends Job implements ShouldUpdate } setting()->save(); + + $this->updateCurrency(); }); event(new CompanyUpdated($this->model, $this->request)); @@ -116,4 +121,37 @@ class UpdateCompany extends Job implements ShouldUpdate throw new \Exception($message); } } + + protected function updateCurrency() + { + $currency_code = $this->request->get('currency'); + + if (empty($currency_code)) { + return; + } + + $currency = Currency::where('company_id', $this->model->id) + ->where('code', $currency_code) + ->first(); + + if ($currency) { + $currency->rate = '1'; + $currency->enabled = '1'; + + $currency->save(); + } else { + try { + $data = (new MoneyCurrency($currency_code))->toArray()[$currency_code]; + $data['rate'] = '1'; + $data['enabled'] = '1'; + $data['company_id'] = $this->model->id; + $data['code'] = $currency_code; + $data['created_from'] = 'core::ui'; + $data['created_by'] = user_id(); + + $currency = Currency::create($data); + } catch (OutOfBoundsException $e) { + } + } + } } diff --git a/app/Models/Document/Document.php b/app/Models/Document/Document.php index 9928ff50b..5847368bc 100644 --- a/app/Models/Document/Document.php +++ b/app/Models/Document/Document.php @@ -542,35 +542,20 @@ class Document extends Model ], ]; } catch (\Exception $e) {} - } else { - try { - $actions[] = [ - 'title' => trans('general.print'), - 'icon' => 'print', - 'url' => route($prefix . '.print', $this->id), - 'permission' => 'read-' . $group . '-' . $permission_prefix, - 'attributes' => [ - 'id' => 'index-line-actions-print-' . $this->type . '-' . $this->id, - 'target' => '_blank', - ], - ]; - } catch (\Exception $e) {} } - if (($actions[1]['icon'] != 'print') && ($actions[2]['icon'] != 'print')) { - try { - $actions[] = [ - 'title' => trans('general.print'), - 'icon' => 'print', - 'url' => route($prefix . '.print', $this->id), - 'permission' => 'read-' . $group . '-' . $permission_prefix, - 'attributes' => [ - 'id' => 'index-line-actions-print-' . $this->type . '-' . $this->id, - 'target' => '_blank', - ], - ]; - } catch (\Exception $e) {} - } + try { + $actions[] = [ + 'title' => trans('general.print'), + 'icon' => 'print', + 'url' => route($prefix . '.print', $this->id), + 'permission' => 'read-' . $group . '-' . $permission_prefix, + 'attributes' => [ + 'id' => 'index-line-actions-print-' . $this->type . '-' . $this->id, + 'target' => '_blank', + ], + ]; + } catch (\Exception $e) {} try { $actions[] = [ diff --git a/app/View/Components/Form/Group/Currency.php b/app/View/Components/Form/Group/Currency.php index 3b9a58e6c..007063492 100644 --- a/app/View/Components/Form/Group/Currency.php +++ b/app/View/Components/Form/Group/Currency.php @@ -35,6 +35,10 @@ class Currency extends Form $this->currencies = Model::enabled()->orderBy('name')->pluck('name', 'code'); + if (! empty($this->options)) { + $this->currencies = $this->options; + } + $currency_id = old('currency.id', old('currency_id', null)); if (! empty($currency_id)) { diff --git a/app/View/Components/Layouts/Wizard/Scripts.php b/app/View/Components/Layouts/Wizard/Scripts.php index a2ec25253..24a1bf99c 100644 --- a/app/View/Components/Layouts/Wizard/Scripts.php +++ b/app/View/Components/Layouts/Wizard/Scripts.php @@ -6,7 +6,6 @@ use Akaunting\Money\Currency as MoneyCurrency; use App\Abstracts\View\Component; use App\Models\Common\Media; use App\Models\Setting\Currency; -use App\Models\Setting\Tax; use App\Traits\Modules; class Scripts extends Component @@ -21,8 +20,6 @@ class Scripts extends Component public $currency_codes; - public $taxes; - public $modules; /** @@ -41,8 +38,6 @@ class Scripts extends Component // Prepare codes $this->currency_codes = $this->getCurrencyCodes(); - $this->taxes = $this->getTaxes(); - $this->modules = $this->getFeaturedModules([ 'query' => [ 'limit' => 5 @@ -122,29 +117,6 @@ class Scripts extends Component 'cancel' => trans('general.cancel'), ], - 'taxes' => [ - 'title' => trans_choice('general.taxes', 2), - 'add_new' => trans('general.add_new'), - 'no_taxes' => trans('taxes.no_taxes'), - 'create_task' => trans('taxes.create_task'), - 'new_tax' => trans('taxes.new_tax'), - 'name' => trans('general.name'), - 'rate_percent' => trans('taxes.rate_percent'), - 'enabled' => trans('general.enabled'), - 'actions' => trans('general.actions'), - 'yes' => trans('general.yes'), - 'no' => trans('general.no'), - 'edit' => trans('general.edit'), - 'delete' => trans('general.delete'), - 'name' => trans('general.name'), - 'rate' => trans('currencies.rate'), - 'enabled' => trans('general.enabled'), - 'save' => trans('general.save'), - 'previous' => trans('pagination.previous'), - 'next' => trans('pagination.next'), - 'cancel' => trans('general.cancel'), - ], - 'finish' => [ 'title' => trans('modules.ready'), 'recommended_apps' => trans('modules.recommended_apps'), @@ -185,9 +157,4 @@ class Scripts extends Component return $codes; } - - protected function getTaxes() - { - return Tax::all(); - } } diff --git a/composer.json b/composer.json index 708d9e036..253384010 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "akaunting/laravel-debugbar-collector": "^2.0", "akaunting/laravel-firewall": "^2.0", "akaunting/laravel-language": "^1.0", - "akaunting/laravel-menu": "^2.0", + "akaunting/laravel-menu": "^3.0", "akaunting/laravel-module": "^2.0", "akaunting/laravel-money": "^3.0", "akaunting/laravel-mutable-observer": "^1.0", diff --git a/composer.lock b/composer.lock index f1363e19a..c1017c43c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8c3e839574009ba27f0d0cdf0b8d8f0c", + "content-hash": "05d1711a45b021377c4ae35714cfb7ea", "packages": [ { "name": "akaunting/laravel-apexcharts", @@ -271,30 +271,30 @@ }, { "name": "akaunting/laravel-menu", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/akaunting/laravel-menu.git", - "reference": "4b5faf3929e2198725619ef7d313d2c582ea348f" + "reference": "9f7ac7fc67f1d7918281fe872472a79c9789d3e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/akaunting/laravel-menu/zipball/4b5faf3929e2198725619ef7d313d2c582ea348f", - "reference": "4b5faf3929e2198725619ef7d313d2c582ea348f", + "url": "https://api.github.com/repos/akaunting/laravel-menu/zipball/9f7ac7fc67f1d7918281fe872472a79c9789d3e1", + "reference": "9f7ac7fc67f1d7918281fe872472a79c9789d3e1", "shasum": "" }, "require": { - "illuminate/config": ">=5.5", - "illuminate/support": ">=5.5", - "illuminate/view": ">=5.5", - "laravelcollective/html": ">=5.5", - "php": ">=7.3" + "illuminate/config": "^9.0", + "illuminate/support": "^9.0", + "illuminate/view": "^9.0", + "laravelcollective/html": "^6.3", + "php": "^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": ">=3.4", - "mockery/mockery": ">=1.4", - "orchestra/testbench": ">=6.0", - "phpunit/phpunit": ">=9.0" + "friendsofphp/php-cs-fixer": "^3.12", + "mockery/mockery": "^1.5", + "orchestra/testbench": "^7.11", + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { @@ -337,9 +337,9 @@ ], "support": { "issues": "https://github.com/akaunting/laravel-menu/issues", - "source": "https://github.com/akaunting/laravel-menu/tree/2.0.3" + "source": "https://github.com/akaunting/laravel-menu/tree/3.0.0" }, - "time": "2022-02-04T14:26:16+00:00" + "time": "2022-10-25T14:52:51+00:00" }, { "name": "akaunting/laravel-module", @@ -907,16 +907,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.239.0", + "version": "3.240.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "33ae76381b77a1a2580817996dcc7b9e931ae5f4" + "reference": "34c6bf82f337cadf31475c88ca70e8302afc624b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/33ae76381b77a1a2580817996dcc7b9e931ae5f4", - "reference": "33ae76381b77a1a2580817996dcc7b9e931ae5f4", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/34c6bf82f337cadf31475c88ca70e8302afc624b", + "reference": "34c6bf82f337cadf31475c88ca70e8302afc624b", "shasum": "" }, "require": { @@ -995,9 +995,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.239.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.240.1" }, - "time": "2022-10-18T18:17:00+00:00" + "time": "2022-10-24T19:03:23+00:00" }, { "name": "balping/json-raw-encoder", @@ -1469,16 +1469,16 @@ }, { "name": "bugsnag/bugsnag", - "version": "v3.28.0", + "version": "v3.29.0", "source": { "type": "git", "url": "https://github.com/bugsnag/bugsnag-php.git", - "reference": "44fc93cac95e44741e0a5f9100f2a0958372e792" + "reference": "362b93bb4b1318bb4bfe3a9e553413e6c2c1f382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bugsnag/bugsnag-php/zipball/44fc93cac95e44741e0a5f9100f2a0958372e792", - "reference": "44fc93cac95e44741e0a5f9100f2a0958372e792", + "url": "https://api.github.com/repos/bugsnag/bugsnag-php/zipball/362b93bb4b1318bb4bfe3a9e553413e6c2c1f382", + "reference": "362b93bb4b1318bb4bfe3a9e553413e6c2c1f382", "shasum": "" }, "require": { @@ -1526,30 +1526,30 @@ ], "support": { "issues": "https://github.com/bugsnag/bugsnag-php/issues", - "source": "https://github.com/bugsnag/bugsnag-php/tree/v3.28.0" + "source": "https://github.com/bugsnag/bugsnag-php/tree/v3.29.0" }, - "time": "2022-05-18T14:13:46+00:00" + "time": "2022-10-19T09:54:15+00:00" }, { "name": "bugsnag/bugsnag-laravel", - "version": "v2.24.0", + "version": "v2.25.0", "source": { "type": "git", "url": "https://github.com/bugsnag/bugsnag-laravel.git", - "reference": "1853d8335e2c29412abd14e3522fbca0a4351d84" + "reference": "64546d9171b6645b5e5c4c12195193cf8ec61aad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bugsnag/bugsnag-laravel/zipball/1853d8335e2c29412abd14e3522fbca0a4351d84", - "reference": "1853d8335e2c29412abd14e3522fbca0a4351d84", + "url": "https://api.github.com/repos/bugsnag/bugsnag-laravel/zipball/64546d9171b6645b5e5c4c12195193cf8ec61aad", + "reference": "64546d9171b6645b5e5c4c12195193cf8ec61aad", "shasum": "" }, "require": { - "bugsnag/bugsnag": "^3.28.0", + "bugsnag/bugsnag": "^3.29.0", "bugsnag/bugsnag-psr-logger": "^1.4|^2.0", "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0", "illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0", - "monolog/monolog": "^1.12|^2.0", + "monolog/monolog": "^1.12|^2.0|^3.0", "php": ">=5.5" }, "require-dev": { @@ -1589,9 +1589,9 @@ ], "support": { "issues": "https://github.com/bugsnag/bugsnag-laravel/issues", - "source": "https://github.com/bugsnag/bugsnag-laravel/tree/v2.24.0" + "source": "https://github.com/bugsnag/bugsnag-laravel/tree/v2.25.0" }, - "time": "2022-05-20T14:12:51+00:00" + "time": "2022-10-25T10:33:03+00:00" }, { "name": "bugsnag/bugsnag-psr-logger", @@ -2103,23 +2103,23 @@ }, { "name": "doctrine/dbal", - "version": "3.4.5", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "a5a58773109c0abb13e658c8ccd92aeec8d07f9e" + "reference": "f38ee8aaca2d58ee88653cb34a6a3880c23f38a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/a5a58773109c0abb13e658c8ccd92aeec8d07f9e", - "reference": "a5a58773109c0abb13e658c8ccd92aeec8d07f9e", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/f38ee8aaca2d58ee88653cb34a6a3880c23f38a5", + "reference": "f38ee8aaca2d58ee88653cb34a6a3880c23f38a5", "shasum": "" }, "require": { "composer-runtime-api": "^2", "doctrine/cache": "^1.11|^2.0", "doctrine/deprecations": "^0.5.3|^1", - "doctrine/event-manager": "^1.0", + "doctrine/event-manager": "^1|^2", "php": "^7.4 || ^8.0", "psr/cache": "^1|^2|^3", "psr/log": "^1|^2|^3" @@ -2127,14 +2127,14 @@ "require-dev": { "doctrine/coding-standard": "10.0.0", "jetbrains/phpstorm-stubs": "2022.2", - "phpstan/phpstan": "1.8.3", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "9.5.24", + "phpstan/phpstan": "1.8.10", + "phpstan/phpstan-strict-rules": "^1.4", + "phpunit/phpunit": "9.5.25", "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.27.0" + "vimeo/psalm": "4.29.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -2194,7 +2194,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.4.5" + "source": "https://github.com/doctrine/dbal/tree/3.5.1" }, "funding": [ { @@ -2210,7 +2210,7 @@ "type": "tidelift" } ], - "time": "2022-09-23T17:48:57+00:00" + "time": "2022-10-24T07:26:18+00:00" }, { "name": "doctrine/deprecations", @@ -2349,23 +2349,23 @@ }, { "name": "doctrine/inflector", - "version": "2.0.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "ade2b3bbfb776f27f0558e26eed43b5d9fe1b392" + "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/ade2b3bbfb776f27f0558e26eed43b5d9fe1b392", - "reference": "ade2b3bbfb776f27f0558e26eed43b5d9fe1b392", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", + "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^10", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", @@ -2420,7 +2420,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.5" + "source": "https://github.com/doctrine/inflector/tree/2.0.6" }, "funding": [ { @@ -2436,7 +2436,7 @@ "type": "tidelift" } ], - "time": "2022-09-07T09:01:28+00:00" + "time": "2022-10-20T09:10:12+00:00" }, { "name": "doctrine/lexer", @@ -3397,16 +3397,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.4.1", + "version": "2.4.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379" + "reference": "3148458748274be1546f8f2809a6c09fe66f44aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/3148458748274be1546f8f2809a6c09fe66f44aa", + "reference": "3148458748274be1546f8f2809a6c09fe66f44aa", "shasum": "" }, "require": { @@ -3496,7 +3496,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.1" + "source": "https://github.com/guzzle/psr7/tree/2.4.2" }, "funding": [ { @@ -3512,7 +3512,7 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:45:39+00:00" + "time": "2022-10-25T13:49:28+00:00" }, { "name": "hoa/compiler", @@ -4858,16 +4858,16 @@ }, { "name": "laravel/framework", - "version": "v9.36.2", + "version": "v9.36.4", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "0bcd350eec1974c9f912f129368587ef7e43722b" + "reference": "15ce569fd93124e8e2257c24e3ed85b9ef9951d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/0bcd350eec1974c9f912f129368587ef7e43722b", - "reference": "0bcd350eec1974c9f912f129368587ef7e43722b", + "url": "https://api.github.com/repos/laravel/framework/zipball/15ce569fd93124e8e2257c24e3ed85b9ef9951d6", + "reference": "15ce569fd93124e8e2257c24e3ed85b9ef9951d6", "shasum": "" }, "require": { @@ -4879,7 +4879,7 @@ "fruitcake/php-cors": "^1.2", "laravel/serializable-closure": "^1.2.2", "league/commonmark": "^2.2", - "league/flysystem": "^3.0.16", + "league/flysystem": "^3.8.0", "monolog/monolog": "^2.0", "nesbot/carbon": "^2.62.1", "nunomaduro/termwind": "^1.13", @@ -4956,7 +4956,7 @@ "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.8", + "orchestra/testbench-core": "^7.11", "pda/pheanstalk": "^4.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^9.5.8", @@ -5040,7 +5040,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-10-18T18:46:20+00:00" + "time": "2022-10-20T16:11:03+00:00" }, { "name": "laravel/sanctum", @@ -5619,16 +5619,16 @@ }, { "name": "league/flysystem", - "version": "3.9.0", + "version": "3.10.2", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "60f3760352fe08e918bc3b1acae4e91af092ebe1" + "reference": "b9bd194b016114d6ff6765c09d40c7d427e4e3f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/60f3760352fe08e918bc3b1acae4e91af092ebe1", - "reference": "60f3760352fe08e918bc3b1acae4e91af092ebe1", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b9bd194b016114d6ff6765c09d40c7d427e4e3f6", + "reference": "b9bd194b016114d6ff6765c09d40c7d427e4e3f6", "shasum": "" }, "require": { @@ -5644,7 +5644,7 @@ }, "require-dev": { "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.0", + "async-aws/simple-s3": "^1.1", "aws/aws-sdk-php": "^3.198.1", "composer/semver": "^3.0", "ext-fileinfo": "*", @@ -5690,7 +5690,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.9.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.10.2" }, "funding": [ { @@ -5706,25 +5706,25 @@ "type": "tidelift" } ], - "time": "2022-10-18T21:02:43+00:00" + "time": "2022-10-25T07:01:47+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "3.8.0", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "192c0e7f36fe4e5a79cce94f8359076630b641f8" + "reference": "95825edc5463006853e64338a4d96a977e8a10ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/192c0e7f36fe4e5a79cce94f8359076630b641f8", - "reference": "192c0e7f36fe4e5a79cce94f8359076630b641f8", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/95825edc5463006853e64338a4d96a977e8a10ca", + "reference": "95825edc5463006853e64338a4d96a977e8a10ca", "shasum": "" }, "require": { "aws/aws-sdk-php": "^3.132.4", - "league/flysystem": "^3.8.0", + "league/flysystem": "^3.10.0", "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" }, @@ -5760,7 +5760,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", - "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.8.0" + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.10.0" }, "funding": [ { @@ -5776,7 +5776,7 @@ "type": "tidelift" } ], - "time": "2022-10-18T06:40:06+00:00" + "time": "2022-10-20T21:00:57+00:00" }, { "name": "league/mime-type-detection", @@ -9524,16 +9524,16 @@ }, { "name": "sentry/sentry", - "version": "3.9.1", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "45b618b2265d11bc9b5a15f31bcc573a2dc3b956" + "reference": "2fdbda9b3569df08dd4a300db8a563d0ec7241f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/45b618b2265d11bc9b5a15f31bcc573a2dc3b956", - "reference": "45b618b2265d11bc9b5a15f31bcc573a2dc3b956", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/2fdbda9b3569df08dd4a300db8a563d0ec7241f9", + "reference": "2fdbda9b3569df08dd4a300db8a563d0ec7241f9", "shasum": "" }, "require": { @@ -9578,7 +9578,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.9.x-dev" + "dev-master": "3.10.x-dev" } }, "autoload": { @@ -9612,7 +9612,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.9.1" + "source": "https://github.com/getsentry/sentry-php/tree/3.10.0" }, "funding": [ { @@ -9624,7 +9624,7 @@ "type": "custom" } ], - "time": "2022-10-11T09:00:25+00:00" + "time": "2022-10-19T09:28:02+00:00" }, { "name": "sentry/sentry-laravel", @@ -15350,16 +15350,16 @@ }, { "name": "spatie/laravel-ignition", - "version": "1.5.2", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "f2336fc79d99aab5cf27fa4aebe5e9c9ecf3808a" + "reference": "c21309ebf6657e0c38083afac8af9baa12885676" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/f2336fc79d99aab5cf27fa4aebe5e9c9ecf3808a", - "reference": "f2336fc79d99aab5cf27fa4aebe5e9c9ecf3808a", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/c21309ebf6657e0c38083afac8af9baa12885676", + "reference": "c21309ebf6657e0c38083afac8af9baa12885676", "shasum": "" }, "require": { @@ -15436,7 +15436,7 @@ "type": "github" } ], - "time": "2022-10-14T12:24:21+00:00" + "time": "2022-10-25T08:38:04+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/type.php b/config/type.php index 6092fad27..ef5ac138d 100644 --- a/config/type.php +++ b/config/type.php @@ -346,6 +346,31 @@ return [ ], ], + Transaction::INCOME_SPLIT_TYPE => [ + 'group' => 'banking', + 'route' => [ + 'prefix' => 'transactions', // core use with group + prefix, module ex. estimates + 'parameter' => 'transaction', // banking/transactions/{parameter}/edit + //'create' => 'transactions.create', // if you change route, you can write full path + ], + 'permission' => [ + 'prefix' => 'transactions', + //'create' => 'create-banking-transactions', + ], + 'translation' => [ + 'prefix' => 'transactions', // this translation file name. + 'related_document_amount' => 'invoices.invoice_amount', + 'transactions' => 'general.incomes', + ], + 'contact_type' => 'customer', + 'document_type' => 'invoice', + 'email_template' => 'payment_received_customer', + 'script' => [ + 'folder' => 'banking', + 'file' => 'transactions', + ], + ], + Transaction::INCOME_RECURRING_TYPE => [ 'group' => 'banking', 'route' => [ @@ -424,6 +449,30 @@ return [ ], ], + Transaction::EXPENSE_SPLIT_TYPE => [ + 'group' => 'banking', + 'route' => [ + 'prefix' => 'transactions', // core use with group + prefix, module ex. estimates + 'parameter' => 'transaction', // banking/transactions/{parameter}/edit + //'create' => 'transactions.create', // if you change route, you can write full path + ], + 'permission' => [ + 'prefix' => 'transactions', + //'create' => 'create-banking-transactions', + ], + 'translation' => [ + 'prefix' => 'transactions', // this translation file name. + 'related_document_amount' => 'bills.bill_amount', + ], + 'contact_type' => 'vendor', + 'document_type' => 'bill', + 'email_template' => 'payment_made_vendor', + 'script' => [ + 'folder' => 'banking', + 'file' => 'transactions', + ], + ], + Transaction::EXPENSE_RECURRING_TYPE => [ 'group' => 'banking', 'route' => [ diff --git a/presets.js b/presets.js index 7e6644b78..1dc888a48 100644 --- a/presets.js +++ b/presets.js @@ -252,6 +252,14 @@ module.exports = { '0%': { boxShadow: '0 28px 0 -28px #55588b' }, '100%': { boxShadow: '0 28px 0 #55588b' }, }, + marquee: { + '0%': { transform: 'translateX(0%)' }, + '100%': { transform: 'translateX(-100%)' }, + }, + marquee_long: { + '0%': { transform: 'translateX(0%)' }, + '100%': { transform: 'translateX(-350%)' }, + } }, animation: { @@ -260,7 +268,9 @@ module.exports = { pulsate: 'pulsate 1500ms ease infinite;', spin: 'spin 1000ms infinite', submit: 'submit 0.7s ease alternate infinite', - submit_second: 'submit_second 0.7s ease alternate infinite' + submit_second: 'submit_second 0.7s ease alternate infinite', + marquee: 'marquee 9s linear infinite', + marquee_long: 'marquee_long 14s linear infinite' }, transitionProperty: { diff --git a/public/akaunting-js/generalAction.js b/public/akaunting-js/generalAction.js index 994b4eb15..f76732771 100644 --- a/public/akaunting-js/generalAction.js +++ b/public/akaunting-js/generalAction.js @@ -99,7 +99,7 @@ function expandSub(key, event) { //collapse accordion // run dropdown and tooltip functions for Virtual DOM -document.addEventListener("DOMContentLoaded", () => { +document.addEventListener("DOMContentLoaded", () => { const triggers = [ { event: "mouseover", checker: isHoverable }, { event: "mouseout", checker: isHoverable }, @@ -357,3 +357,84 @@ if (navigator.userAgent.search("Firefox") >= 0) { } } //Firefox show modal for icon set + +//margue animation for truncated text +function marqueeAnimation(truncate) { + if (truncate.closest('[disable-marquee]') !== null) { + truncate.parentElement.classList.add('truncate'); + truncate.closest('[disable-marquee]').setAttribute('disable-marquee', 'data-disable-marquee'); + return; + } + // offsetwidth = width of the text, clientWidth = width of parent text (div) + // because some index page has icons, we use two time parent element + + if (truncate.children.length < 1 && truncate.offsetWidth > truncate.parentElement.clientWidth || truncate.offsetWidth > truncate.parentElement.parentElement.parentElement.clientWidth) { + truncate.addEventListener('mouseover', function () { + truncate.parentElement.style.animationPlayState = 'running'; + + if (truncate.offsetWidth > 400 && truncate.parentElement.clientWidth < 150) { + truncate.parentElement.classList.remove('animate-marquee'); + truncate.parentElement.classList.add('animate-marquee_long'); + } else { + truncate.parentElement.classList.remove('animate-marquee_long'); + truncate.parentElement.classList.add('animate-marquee'); + } + + if (truncate.parentElement.classList.contains('truncate')) { + truncate.parentElement.classList.remove('truncate'); + } + }); + + truncate.addEventListener('mouseout', function () { + truncate.parentElement.style.animationPlayState = 'paused'; + truncate.parentElement.classList.remove('animate-marquee'); + truncate.parentElement.classList.remove('animate-marquee_long'); + truncate.parentElement.classList.add('truncate'); + }); + + truncate.classList.add('truncate'); + + // if truncate has truncate class, text marquee animate doesn't pretty work + if (truncate.querySelector('.truncate') !== null && truncate.querySelector('.truncate').classList.contains('truncate')) { + let old_element = truncate.querySelector('.truncate'); + let parent = old_element.parentNode; + + let new_element = document.createElement('span'); + new_element.innerHTML = old_element.innerHTML; + new_element.classList = old_element.classList; + + parent.replaceChild(new_element, old_element); + } + // if truncate has truncate class, text marquee animate doesn't pretty work + + // There needs to be two div for disable/enable icons. If I don't create this div, animation will work with disable/enable icons.--> + let animate_element = document.createElement('div'); + animate_element.classList.add('truncate'); + truncate.parentElement.append(animate_element); + animate_element.append(truncate); + // There needs to be two div for disable/enable icons. If I don't create this div, animation will work with disable/enable icons.--> + + //there is overflow class for the animation does not overflow the width + truncate.parentElement.parentElement.classList.add('overflow-x-hidden'); + } +} + +document.querySelectorAll('[data-truncate-marquee]').forEach((truncate) => { + marqueeAnimation(truncate); +}); + +//disable/enable icons ejected from data-truncate-marquee, HTML of icons ejected from parent element (data-truncate-marquee) +document.querySelectorAll('[data-index-icon]').forEach((defaultText) => { + let icon_parents_element = defaultText.parentElement.parentElement.parentElement; + + if (icon_parents_element.classList.contains('flex')) { + icon_parents_element.appendChild(defaultText); + } else { + icon_parents_element.parentElement.appendChild(defaultText); + } + + // defaultText.parentElement.parentElement.parentElement.parentElement.appendChild(defaultText); +}); +//disable/enable icons ejected from data-truncate-marquee + +//margue animation for truncated text diff --git a/public/css/app.css b/public/css/app.css index 88f9f7283..ae46d5bbb 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -1618,6 +1618,36 @@ input[type="date"]::-webkit-inner-spin-button, height: 4rem; } +/* widget container name will change as lg:px-12 on database. When container class name change on database, this code will clean */ + +.dashboard .px-12{ + padding-left: 0px; + padding-right: 0px; +} + +@media (min-width: 1024px){ + + .dashboard .px-12{ + padding-left: 3rem; + padding-right: 3rem; + } +} + +.dashboard .px-6{ + padding-left: 0px; + padding-right: 0px; +} + +@media (min-width: 1024px){ + + .dashboard .px-6{ + padding-left: 1.5rem; + padding-right: 1.5rem; + } +} + +/* widget container name will change as lg:px-12 on database. When container class name change on database, this code will clean */ + *, ::before, ::after{ --tw-translate-x: 0; --tw-translate-y: 0; @@ -10273,6 +10303,62 @@ input[type="date"]::-webkit-inner-spin-button, -webkit-animation: submit_second 0.7s ease alternate infinite; animation: submit_second 0.7s ease alternate infinite; } +@-webkit-keyframes marquee{ + + 0%{ + -webkit-transform: translateX(0%); + transform: translateX(0%); + } + + 100%{ + -webkit-transform: translateX(-100%); + transform: translateX(-100%); + } +} +@keyframes marquee{ + + 0%{ + -webkit-transform: translateX(0%); + transform: translateX(0%); + } + + 100%{ + -webkit-transform: translateX(-100%); + transform: translateX(-100%); + } +} +.animate-marquee{ + -webkit-animation: marquee 9s linear infinite; + animation: marquee 9s linear infinite; +} +@-webkit-keyframes marquee_long{ + + 0%{ + -webkit-transform: translateX(0%); + transform: translateX(0%); + } + + 100%{ + -webkit-transform: translateX(-350%); + transform: translateX(-350%); + } +} +@keyframes marquee_long{ + + 0%{ + -webkit-transform: translateX(0%); + transform: translateX(0%); + } + + 100%{ + -webkit-transform: translateX(-350%); + transform: translateX(-350%); + } +} +.animate-marquee_long{ + -webkit-animation: marquee_long 14s linear infinite; + animation: marquee_long 14s linear infinite; +} .cursor-auto{ cursor: auto; } @@ -51760,105 +51846,138 @@ body{ } @media (min-width: 1024px){ + .dashboard .lg\:px-12{ + padding-left: 0px; + padding-right: 0px; + } + @media (min-width: 1024px){ - .lg\:absolute{ + .dashboard .lg\:px-12{ + padding-left: 3rem; + padding-right: 3rem; + } + } + + .dashboard .lg\:px-6{ + padding-left: 0px; + padding-right: 0px; + } + + @media (min-width: 1024px){ + + .dashboard .lg\:px-6{ + padding-left: 1.5rem; + padding-right: 1.5rem; + } + } + + .lg\:absolute{ position: absolute; } - .lg\:relative{ + .lg\:relative{ position: relative; } - .lg\:right-0{ + .lg\:right-0{ right: 0px; } +<<<<<<< HEAD .lg\:top-7{ top: 1.75rem; } .lg\:right-24{ +======= + .lg\:right-24{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 right: 6rem; } - .lg\:top-2{ + .lg\:top-2{ top: 0.5rem; } - .lg\:col-span-5{ + .lg\:col-span-5{ grid-column: span 5 / span 5; } - .lg\:my-12{ + .lg\:my-12{ margin-top: 3rem; margin-bottom: 3rem; } - .lg\:-mx-12{ + .lg\:-mx-12{ margin-left: -3rem; margin-right: -3rem; } +<<<<<<< HEAD .lg\:my-16{ margin-top: 4rem; margin-bottom: 4rem; } .lg\:my-0{ +======= + .lg\:my-0{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 margin-top: 0px; margin-bottom: 0px; } - .lg\:mt-2{ + .lg\:mt-2{ margin-top: 0.5rem; } - .lg\:mt-4{ + .lg\:mt-4{ margin-top: 1rem; } - .lg\:mt-11{ + .lg\:mt-11{ margin-top: 2.75rem; } - .lg\:mt-60{ + .lg\:mt-60{ margin-top: 15rem; } - .lg\:mt-8{ + .lg\:mt-8{ margin-top: 2rem; } - .lg\:mt-0{ + .lg\:mt-0{ margin-top: 0px; } - .lg\:-mt-16{ + .lg\:-mt-16{ margin-top: -4rem; } - .lg\:mb-0{ + .lg\:mb-0{ margin-bottom: 0px; } - .lg\:mt-20{ + .lg\:mt-20{ margin-top: 5rem; } - .lg\:block{ + .lg\:block{ display: block; } - .lg\:flex{ + .lg\:flex{ display: -webkit-box; display: -ms-flexbox; display: flex; } - .lg\:hidden{ + .lg\:hidden{ display: none; } +<<<<<<< HEAD .lg\:h-6{ height: 1.5rem; } @@ -51872,141 +51991,153 @@ body{ } .lg\:h-64{ +======= + .lg\:h-64{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 height: 16rem; } - .lg\:h-auto{ + .lg\:h-auto{ height: auto; } - .lg\:h-48{ + .lg\:h-48{ height: 12rem; } - .lg\:h-60{ + .lg\:h-60{ height: 15rem; } - .lg\:h-4{ + .lg\:h-4{ height: 1rem; } - .lg\:h-12{ + .lg\:h-12{ height: 3rem; } - .lg\:w-9{ + .lg\:w-9{ width: 2.25rem; } - .lg\:w-96{ + .lg\:w-96{ width: 24rem; } +<<<<<<< HEAD .lg\:w-18{ width: 4.5rem; } .lg\:w-1\/2{ +======= + .lg\:w-1\/2{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 width: 50%; } - .lg\:w-11\/12{ + .lg\:w-11\/12{ width: 91.666667%; } - .lg\:w-1\/12{ + .lg\:w-1\/12{ width: 8.333333%; } - .lg\:w-3\/12{ + .lg\:w-3\/12{ width: 25%; } - .lg\:w-2\/12{ + .lg\:w-2\/12{ width: 16.666667%; } - .lg\:w-80{ + .lg\:w-80{ width: 20rem; } - .lg\:w-8\/12{ + .lg\:w-8\/12{ width: 66.666667%; } - .lg\:w-46{ + .lg\:w-46{ width: 46.875rem; } - .lg\:w-4\/5{ + .lg\:w-4\/5{ width: 80%; } - .lg\:w-3\/5{ + .lg\:w-3\/5{ width: 60%; } - .lg\:w-7\/12{ + .lg\:w-7\/12{ width: 58.333333%; } - .lg\:w-5\/12{ + .lg\:w-5\/12{ width: 41.666667%; } - .lg\:w-full{ + .lg\:w-full{ width: 100%; } - .lg\:w-1\/3{ + .lg\:w-1\/3{ width: 33.333333%; } - .lg\:w-2\/3{ + .lg\:w-2\/3{ width: 66.666667%; } - .lg\:w-auto{ + .lg\:w-auto{ width: auto; } - .lg\:w-1\/4{ + .lg\:w-1\/4{ width: 25%; } - .lg\:w-6\/12{ + .lg\:w-6\/12{ width: 50%; } - .lg\:w-4\/12{ + .lg\:w-4\/12{ width: 33.333333%; } - .lg\:w-4{ + .lg\:w-4{ width: 1rem; } - .lg\:w-2\/4{ + .lg\:w-2\/4{ width: 50%; } - .lg\:w-3\/4{ + .lg\:w-3\/4{ width: 75%; } +<<<<<<< HEAD .lg\:max-w-lg{ max-width: 32rem; } .lg\:max-w-7xl{ +======= + .lg\:max-w-7xl{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 max-width: 80rem; } - .lg\:max-w-6xl{ + .lg\:max-w-6xl{ max-width: 72rem; } +<<<<<<< HEAD .lg\:grid-cols-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); } @@ -52016,58 +52147,62 @@ body{ } .lg\:flex-row{ +======= + .lg\:flex-row{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; } - .lg\:flex-row-reverse{ + .lg\:flex-row-reverse{ -webkit-box-orient: horizontal; -webkit-box-direction: reverse; -ms-flex-direction: row-reverse; flex-direction: row-reverse; } - .lg\:flex-col{ + .lg\:flex-col{ -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; } - .lg\:flex-nowrap{ + .lg\:flex-nowrap{ -ms-flex-wrap: nowrap; flex-wrap: nowrap; } - .lg\:items-center{ + .lg\:items-center{ -webkit-box-align: center; -ms-flex-align: center; align-items: center; } - .lg\:justify-end{ + .lg\:justify-end{ -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; } - .lg\:justify-center{ + .lg\:justify-center{ -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; } - .lg\:justify-around{ + .lg\:justify-around{ -ms-flex-pack: distribute; justify-content: space-around; } - .lg\:gap-16{ + .lg\:gap-16{ gap: 4rem; } +<<<<<<< HEAD .lg\:space-x-8 > :not([hidden]) ~ :not([hidden]){ --tw-space-x-reverse: 0; margin-right: calc(2rem * var(--tw-space-x-reverse)); @@ -52075,95 +52210,103 @@ body{ } .lg\:space-y-0 > :not([hidden]) ~ :not([hidden]){ +======= + .lg\:space-y-0 > :not([hidden]) ~ :not([hidden]){ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 --tw-space-y-reverse: 0; margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(0px * var(--tw-space-y-reverse)); } - .lg\:space-x-24 > :not([hidden]) ~ :not([hidden]){ + .lg\:space-x-24 > :not([hidden]) ~ :not([hidden]){ --tw-space-x-reverse: 0; margin-right: calc(6rem * var(--tw-space-x-reverse)); margin-left: calc(6rem * calc(1 - var(--tw-space-x-reverse))); } - .lg\:divide-y-0 > :not([hidden]) ~ :not([hidden]){ + .lg\:divide-y-0 > :not([hidden]) ~ :not([hidden]){ --tw-divide-y-reverse: 0; border-top-width: calc(0px * calc(1 - var(--tw-divide-y-reverse))); border-bottom-width: calc(0px * var(--tw-divide-y-reverse)); } - .lg\:divide-x > :not([hidden]) ~ :not([hidden]){ + .lg\:divide-x > :not([hidden]) ~ :not([hidden]){ --tw-divide-x-reverse: 0; border-right-width: calc(1px * var(--tw-divide-x-reverse)); border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))); } - .lg\:overflow-visible{ + .lg\:overflow-visible{ overflow: visible; } +<<<<<<< HEAD .lg\:overflow-x-hidden{ overflow-x: hidden; } .lg\:border-r{ +======= + .lg\:border-r{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 border-right-width: 1px; } - .lg\:px-3{ + .lg\:px-3{ padding-left: 0.75rem; padding-right: 0.75rem; } - .lg\:px-4{ + .lg\:px-4{ padding-left: 1rem; padding-right: 1rem; } - .lg\:px-6{ + .lg\:px-6{ padding-left: 1.5rem; padding-right: 1.5rem; } - .lg\:px-12{ + .lg\:px-12{ padding-left: 3rem; padding-right: 3rem; } - .lg\:px-24{ + .lg\:px-24{ padding-left: 6rem; padding-right: 6rem; } - .lg\:py-0{ + .lg\:py-0{ padding-top: 0px; padding-bottom: 0px; } - .lg\:pl-24{ + .lg\:pl-24{ padding-left: 6rem; } - .lg\:pl-6{ + .lg\:pl-6{ padding-left: 1.5rem; } - .lg\:pl-12{ + .lg\:pl-12{ padding-left: 3rem; } - .lg\:pt-0{ + .lg\:pt-0{ padding-top: 0px; } - .lg\:pl-8{ + .lg\:pl-8{ padding-left: 2rem; } - .lg\:pr-0{ + .lg\:pr-0{ padding-right: 0px; } +<<<<<<< HEAD .lg\:text-6xl{ font-size: 2.5rem; line-height: 2.75rem; @@ -52180,30 +52323,34 @@ body{ } .lg\:text-8xl{ +======= + .lg\:text-8xl{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 font-size: 3rem; line-height: 3.25rem; } - .lg\:text-7xl{ + .lg\:text-7xl{ font-size: 2.75rem; line-height: 3rem; } - .lg\:text-2xl{ + .lg\:text-2xl{ font-size: 1.375rem; line-height: 1.5rem; } - .lg\:text-5xl{ + .lg\:text-5xl{ font-size: 2.25rem; line-height: 2.5rem; } - .lg\:text-lg{ + .lg\:text-lg{ font-size: 1.125rem; line-height: 1.75rem; } +<<<<<<< HEAD .lg\:leading-4{ line-height: 1rem; } @@ -52217,42 +52364,53 @@ body{ } [dir="ltr"] .lg\:ltr\:pr-12{ +======= + [dir="ltr"] .lg\:ltr\:right-0{ + right: 0px; + } + + [dir="ltr"] .lg\:ltr\:pr-12{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 padding-right: 3rem; } - [dir="ltr"] .lg\:ltr\:pl-12{ + [dir="ltr"] .lg\:ltr\:pl-12{ padding-left: 3rem; } - [dir="ltr"] .ltr\:lg\:pl-8{ + [dir="ltr"] .ltr\:lg\:pl-8{ padding-left: 2rem; } - [dir="ltr"] .lg\:ltr\:pl-24{ + [dir="ltr"] .lg\:ltr\:pl-24{ padding-left: 6rem; } - [dir="rtl"] .lg\:rtl\:left-0{ + [dir="rtl"] .lg\:rtl\:left-0{ left: 0px; } +<<<<<<< HEAD [dir="rtl"] .lg\:rtl\:mr-72{ margin-right: 18rem; } [dir="rtl"] .lg\:rtl\:pl-12{ +======= + [dir="rtl"] .lg\:rtl\:pl-12{ +>>>>>>> a4ea448ef90c7eafacea3700bc7c83bdbb963165 padding-left: 3rem; } - [dir="rtl"] .lg\:rtl\:pr-12{ + [dir="rtl"] .lg\:rtl\:pr-12{ padding-right: 3rem; } - [dir="rtl"] .rtl\:lg\:pr-8{ + [dir="rtl"] .rtl\:lg\:pr-8{ padding-right: 2rem; } - [dir="rtl"] .lg\:rtl\:pr-24{ + [dir="rtl"] .lg\:rtl\:pr-24{ padding-right: 6rem; } } diff --git a/resources/assets/js/Wizard.vue b/resources/assets/js/Wizard.vue index 9a61e052e..fe2e1f90a 100644 --- a/resources/assets/js/Wizard.vue +++ b/resources/assets/js/Wizard.vue @@ -2,7 +2,6 @@ { @@ -36,14 +34,12 @@ translations: { company: {}, currencies: {}, - taxes: {}, finish: {}, }, company: {}, countries: {}, currencies: [], currency_codes: [], - taxes: [], modules: {}, page_loaded: true }; diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index 90db6c7be..e6050b8b2 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -842,7 +842,8 @@ export default { if (!check) { this.sorted_options.push({ key: option.id.toString(), - value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name + value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name, + level: (option.parent_id) ? 1 : 0 // 0: parent, 1: child. Level data get 0 via backend. This control will refactor. }); } diff --git a/resources/assets/js/components/AkauntingWidget.vue b/resources/assets/js/components/AkauntingWidget.vue index baa02eba9..e88944260 100644 --- a/resources/assets/js/components/AkauntingWidget.vue +++ b/resources/assets/js/components/AkauntingWidget.vue @@ -165,19 +165,19 @@ export default { widthOptions: [ { label: '25%', - value: 'w-full lg:w-1/4 px-6' + value: 'w-full lg:w-1/4 lg:px-6' }, { label: '33%', - value: 'w-full lg:w-1/3 px-6' + value: 'w-full lg:w-1/3 lg:px-6' }, { label: '50%', - value: 'w-full lg:w-2/4 px-12' + value: 'w-full lg:w-2/4 lg:px-12' }, { label: '100%', - value: 'w-full px-12' + value: 'w-full lg:px-12' } ], form: { diff --git a/resources/assets/js/views/wizard/Currencies.vue b/resources/assets/js/views/wizard/Currencies.vue index 3f3b16c39..cf4a39509 100644 --- a/resources/assets/js/views/wizard/Currencies.vue +++ b/resources/assets/js/views/wizard/Currencies.vue @@ -414,7 +414,7 @@ next() { if (this.active++ > 2); - this.$router.push("/wizard/taxes"); + this.$router.push("/wizard/finish"); }, }, }; diff --git a/resources/assets/js/views/wizard/Finish.vue b/resources/assets/js/views/wizard/Finish.vue index db142ff03..7085e4565 100644 --- a/resources/assets/js/views/wizard/Finish.vue +++ b/resources/assets/js/views/wizard/Finish.vue @@ -128,7 +128,7 @@ export default { prev() { if (this.active-- > 2); - this.$router.push("/wizard/taxes"); + this.$router.push("/wizard/currencies"); }, finish() { diff --git a/resources/assets/js/views/wizard/Steps.vue b/resources/assets/js/views/wizard/Steps.vue index 846b2620b..b27e01376 100644 --- a/resources/assets/js/views/wizard/Steps.vue +++ b/resources/assets/js/views/wizard/Steps.vue @@ -28,19 +28,6 @@ -
  • - - Text - - - {{ translations.taxes.title }} - - -
  • -
  • -
    - - -
    -
    - data_usage -
    - - - -
    - - {{ translations.taxes.previous }} - - - - {{ translations.taxes.next }} - -
    -
    - - - -
    - - -
    - - - diff --git a/resources/assets/js/wizard.js b/resources/assets/js/wizard.js index 633aa7dce..72b267044 100644 --- a/resources/assets/js/wizard.js +++ b/resources/assets/js/wizard.js @@ -10,7 +10,6 @@ Vue.use(VueRouter); import Wizard from './Wizard.vue'; import Company from './views/wizard/Company.vue'; import Currencies from './views/wizard/Currencies.vue'; -import Taxes from './views/wizard/Taxes.vue'; import Finish from './views/wizard/Finish.vue'; var global_path = new URL(url).protocol + '//' + window.location.host; @@ -18,7 +17,9 @@ var base_path = url.replace(global_path, ''); const router = new VueRouter({ mode: 'history', + base: base_path, + routes: [ { path: '/wizard', @@ -35,18 +36,15 @@ const router = new VueRouter({ name: 'Currencies', component: Currencies }, - { - path: '/wizard/taxes', - name: 'Taxes', - component: Taxes - }, { path: '/wizard/finish', name: 'Finish', component: Finish } ], + linkActiveClass: 'active', + scrollBehavior: (to, from ,savedPosition) => { if (savedPosition) { return savedPosition; diff --git a/resources/assets/sass/app.css b/resources/assets/sass/app.css index a030dfbe4..2cc58c3d3 100644 --- a/resources/assets/sass/app.css +++ b/resources/assets/sass/app.css @@ -203,6 +203,15 @@ overflow: hidden; height: 4rem; } + /* widget container name will change as lg:px-12 on database. When container class name change on database, this code will clean */ + .dashboard .px-12 { + @apply px-0 lg:pl-12 lg:pr-12; + } + + .dashboard .px-6 { + @apply px-0 lg:pl-6 lg:pr-6; + } + /* widget container name will change as lg:px-12 on database. When container class name change on database, this code will clean */ } /* menu */ diff --git a/resources/views/auth/users/index.blade.php b/resources/views/auth/users/index.blade.php index c9520ef0c..4ae639573 100644 --- a/resources/views/auth/users/index.blade.php +++ b/resources/views/auth/users/index.blade.php @@ -58,11 +58,11 @@
    @if (setting('default.use_gravatar', '0') == '1') - + @elseif (is_object($item->picture)) - + @else - + @endif {{ !empty($item->name) ? $item->name : trans('general.na') }} diff --git a/resources/views/banking/accounts/index.blade.php b/resources/views/banking/accounts/index.blade.php index d961ce33c..d86e3d743 100644 --- a/resources/views/banking/accounts/index.blade.php +++ b/resources/views/banking/accounts/index.blade.php @@ -64,9 +64,7 @@ -
    - {{ $item->name }} -
    + {{ $item->name }} @if (! $item->enabled) diff --git a/resources/views/banking/reconciliations/edit.blade.php b/resources/views/banking/reconciliations/edit.blade.php index 65b342118..e18c402ab 100644 --- a/resources/views/banking/reconciliations/edit.blade.php +++ b/resources/views/banking/reconciliations/edit.blade.php @@ -82,13 +82,18 @@ @php + $reconciliation_transactions = []; $type = $item->isIncome() ? 'income' : 'expense'; $name = $type . '_' . $item->id; $checked = $item->reconciled; - if (! $reconciliation->reconciled && array_key_exists($name, $reconciliation->transactions)) { - $checked = (empty($reconciliation->transactions[$name]) || $reconciliation->transactions[$name] === 'false') ? 0 : 1; + if (! empty($reconciliation->transactions)) { + $reconciliation_transactions = $reconciliation->transactions; + } + + if (! $reconciliation->reconciled && array_key_exists($name, $reconciliation_transactions)) { + $checked = (empty($reconciliation_transactions[$name]) || $reconciliation_transactions[$name] === 'false') ? 0 : 1; } @endphp diff --git a/resources/views/common/companies/create.blade.php b/resources/views/common/companies/create.blade.php index 272842883..ee3d9f445 100644 --- a/resources/views/common/companies/create.blade.php +++ b/resources/views/common/companies/create.blade.php @@ -1,5 +1,7 @@ - {{ trans('general.title.new', ['type' => trans_choice('general.companies', 1)]) }} + + {{ trans('general.title.new', ['type' => trans_choice('general.companies', 1)]) }} + @@ -10,47 +12,11 @@ -
    - + - + - -
    - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/resources/views/common/companies/edit.blade.php b/resources/views/common/companies/edit.blade.php index db24f1977..65a18c600 100644 --- a/resources/views/common/companies/edit.blade.php +++ b/resources/views/common/companies/edit.blade.php @@ -10,47 +10,11 @@
    -
    - + - + - -
    - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/resources/views/common/items/index.blade.php b/resources/views/common/items/index.blade.php index b7fb34935..f4cf11ea8 100644 --- a/resources/views/common/items/index.blade.php +++ b/resources/views/common/items/index.blade.php @@ -84,16 +84,14 @@
    - -
    - {{ $item->name }} -
    - + + {{ $item->name }} + @if (! $item->enabled) @endif - + {{ $item->description }}
    diff --git a/resources/views/components/documents/form/company.blade.php b/resources/views/components/documents/form/company.blade.php index bfb5b93f7..215908423 100644 --- a/resources/views/components/documents/form/company.blade.php +++ b/resources/views/components/documents/form/company.blade.php @@ -1,4 +1,4 @@ - + - -{{ $name }} +
    + + + {{ $name }} +
    diff --git a/resources/views/components/index/default.blade.php b/resources/views/components/index/default.blade.php index d972ae1aa..f6ffc1d28 100644 --- a/resources/views/components/index/default.blade.php +++ b/resources/views/components/index/default.blade.php @@ -1,5 +1,7 @@ - - - {{ $icon }} - - +
    + + + {{ $icon }} + + +
    diff --git a/resources/views/components/index/disable.blade.php b/resources/views/components/index/disable.blade.php index c2efd9fa0..c169e6c34 100644 --- a/resources/views/components/index/disable.blade.php +++ b/resources/views/components/index/disable.blade.php @@ -1,5 +1,7 @@ - - - {{ $icon }} - - +
    + + + {{ $icon }} + + +
    diff --git a/resources/views/components/layouts/admin/menu.blade.php b/resources/views/components/layouts/admin/menu.blade.php index 328aecfb9..79fb48b3f 100644 --- a/resources/views/components/layouts/admin/menu.blade.php +++ b/resources/views/components/layouts/admin/menu.blade.php @@ -40,9 +40,9 @@ @if (setting('default.use_gravatar', '0') == '1') - {{ user()->name }} + {{ user()->name }} @elseif (is_object(user()->picture)) - {{ user()->name }} + {{ user()->name }} @else account_circle diff --git a/resources/views/components/layouts/portal/menu.blade.php b/resources/views/components/layouts/portal/menu.blade.php index 40965da02..054eb2ac0 100644 --- a/resources/views/components/layouts/portal/menu.blade.php +++ b/resources/views/components/layouts/portal/menu.blade.php @@ -24,9 +24,9 @@ @if (setting('default.use_gravatar', '0') == '1') - {{ user()->name }} + {{ user()->name }} @elseif (is_object(user()->picture)) - {{ user()->name }} + {{ user()->name }} @else account_circle diff --git a/resources/views/components/layouts/wizard/scripts.blade.php b/resources/views/components/layouts/wizard/scripts.blade.php index 0f0a2ab25..02294861e 100644 --- a/resources/views/components/layouts/wizard/scripts.blade.php +++ b/resources/views/components/layouts/wizard/scripts.blade.php @@ -10,7 +10,6 @@ var wizard_countries = {!! json_encode(trans('countries')) !!}; var wizard_currencies = {!! json_encode($currencies) !!}; var wizard_currency_codes = {!! json_encode($currency_codes) !!}; - var wizard_taxes = {!! json_encode($taxes) !!}; var wizard_modules = {!! json_encode($modules) !!}; diff --git a/resources/views/components/table/index.blade.php b/resources/views/components/table/index.blade.php index 6c0f1907a..91d311568 100644 --- a/resources/views/components/table/index.blade.php +++ b/resources/views/components/table/index.blade.php @@ -1,6 +1,6 @@
    - +
    {{ $slot }}
    diff --git a/resources/views/components/table/td.blade.php b/resources/views/components/table/td.blade.php index d6ae64e37..92ea7ca84 100644 --- a/resources/views/components/table/td.blade.php +++ b/resources/views/components/table/td.blade.php @@ -8,7 +8,13 @@ } @endphp
    - {!! $first !!} + +
    + + + {!! $first !!} + +
    @endif @@ -21,9 +27,18 @@ } @endphp
    - {!! $second !!} +
    + + {!! $second !!} + +
    +
    @endif - {{ $slot }} +
    + + {{ $slot }} + +
    diff --git a/resources/views/components/table/th.blade.php b/resources/views/components/table/th.blade.php index e3d79db3f..ee0ad3350 100644 --- a/resources/views/components/table/th.blade.php +++ b/resources/views/components/table/th.blade.php @@ -8,7 +8,13 @@ } @endphp
    - {!! $first !!} + +
    + + + {!! $first !!} + +
    @endif @@ -21,9 +27,17 @@ } @endphp
    - {!! $second !!} +
    + + {!! $second !!} + +
    @endif - {{ $slot }} +
    + + {{ $slot }} + +
    diff --git a/resources/views/settings/currencies/index.blade.php b/resources/views/settings/currencies/index.blade.php index 92d94b8b4..330df7153 100644 --- a/resources/views/settings/currencies/index.blade.php +++ b/resources/views/settings/currencies/index.blade.php @@ -57,7 +57,7 @@ - +
    {{ $item->name }}
    diff --git a/resources/views/wizard/taxes/index.blade.php b/resources/views/wizard/taxes/index.blade.php deleted file mode 100644 index 2d9c051b8..000000000 --- a/resources/views/wizard/taxes/index.blade.php +++ /dev/null @@ -1,7 +0,0 @@ - - - {{ trans('general.wizard') }} - - - - diff --git a/routes/wizard.php b/routes/wizard.php index a746cfb07..b4999ea78 100644 --- a/routes/wizard.php +++ b/routes/wizard.php @@ -16,10 +16,6 @@ Route::group(['as' => 'wizard.'], function () { Route::get('currencies/{currency}/disable', 'Settings\Currencies@disable')->name('currencies.disable'); Route::resource('currencies', 'Wizard\Currencies'); - Route::get('taxes/{tax}/enable', 'Settings\Taxes@enable')->name('taxes.enable'); - Route::get('taxes/{tax}/disable', 'Settings\Taxes@disable')->name('taxes.disable'); - Route::resource('taxes', 'Wizard\Taxes'); - Route::get('finish', 'Wizard\Finish@index')->name('finish.index'); Route::patch('finish', 'Wizard\Finish@update')->name('finish.update'); }); diff --git a/tests/Feature/Wizard/TaxesTest.php b/tests/Feature/Wizard/TaxesTest.php deleted file mode 100644 index f01fb8863..000000000 --- a/tests/Feature/Wizard/TaxesTest.php +++ /dev/null @@ -1,79 +0,0 @@ -loginAs() - ->get(route('wizard.taxes.index')) - ->assertStatus(200) - ->assertSeeText(trans('general.wizard')); - } - - public function testItShouldCreateTax() - { - $request = $this->getRequest(); - - $message = trans('messages.success.added', ['type' => trans_choice('general.taxes', 1)]); - - $this->loginAs() - ->post(route('wizard.taxes.store'), $request) - ->assertStatus(200) - ->assertJson([ - 'success' => true, - 'message' => $message, - ]); - - $this->assertDatabaseHas('taxes', $request); - } - - public function testItShouldUpdateTax() - { - $request = $this->getRequest(); - - $tax = $this->dispatch(new CreateTax($request)); - - $request['name'] = $this->faker->text(15); - - $message = trans('messages.success.updated', ['type' => $request['name']]); - - $this->loginAs() - ->patch(route('wizard.taxes.update', $tax->id), $request) - ->assertStatus(200) - ->assertJson([ - 'success' => true, - 'message' => $message, - ]); - - $this->assertDatabaseHas('taxes', $request); - } - - public function testItShouldDeleteTax() - { - $request = $this->getRequest(); - - $tax = $this->dispatch(new CreateTax($request)); - - $message = trans('messages.success.deleted', ['type' => $tax->name]); - - $this->loginAs() - ->delete(route('wizard.taxes.destroy', $tax->id)) - ->assertStatus(200) - ->assertJson([ - 'success' => true, - 'message' => $message, - ]); - - $this->assertDatabaseHas('taxes', $request); - } - - public function getRequest() - { - return Tax::factory()->enabled()->raw(); - } -}