Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk 2021-04-26 18:37:27 +03:00
commit 178eeece18
14 changed files with 42 additions and 69 deletions

View File

@ -410,7 +410,7 @@ abstract class Report
public function getUrl($action = 'print') public function getUrl($action = 'print')
{ {
$url = 'common/reports/' . $this->model->id . '/' . $action; $url = company_id() . '/common/reports/' . $this->model->id . '/' . $action;
$search = request('search'); $search = request('search');

View File

@ -3,7 +3,6 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Events\Install\UpdateFinished; use App\Events\Install\UpdateFinished;
use App\Models\Common\Company;
use Illuminate\Console\Command; use Illuminate\Console\Command;
class FinishUpdate extends Command class FinishUpdate extends Command
@ -48,16 +47,18 @@ class FinishUpdate extends Command
throw new \Exception(trans('modules.errors.finish', ['module' => $alias])); throw new \Exception(trans('modules.errors.finish', ['module' => $alias]));
} }
// Set locale for modules $company = company($company_id);
if ($alias != 'core') {
$company = Company::find($company_id);
if (!empty($company->locale)) { if (empty($company)) {
return;
}
$company->makeCurrent();
// Set locale for modules
if (($alias != 'core') && !empty($company->locale)) {
app()->setLocale($company->locale); app()->setLocale($company->locale);
} }
}
company($company_id)->makeCurrent();
// Disable model cache during update // Disable model cache during update
config(['laravel-model-caching.enabled' => false]); config(['laravel-model-caching.enabled' => false]);

View File

@ -21,6 +21,6 @@ class CanInstall
} }
// Already installed, redirect to login // Already installed, redirect to login
redirect('auth/login')->send(); return redirect()->route('login');
} }
} }

View File

@ -10,11 +10,6 @@ class ItemTaxes extends Import
{ {
public function model(array $row) public function model(array $row)
{ {
// @todo remove after laravel-excel 3.2 release
if ($row['item_name'] === $this->empty_field) {
return null;
}
return new Model($row); return new Model($row);
} }

View File

@ -11,11 +11,6 @@ class BillHistories extends Import
{ {
public function model(array $row) public function model(array $row)
{ {
// @todo remove after laravel-excel 3.2 release
if ($row['bill_number'] === $this->empty_field) {
return null;
}
return new Model($row); return new Model($row);
} }

View File

@ -13,11 +13,6 @@ class BillItemTaxes extends Import
{ {
public function model(array $row) public function model(array $row)
{ {
// @todo remove after laravel-excel 3.2 release
if ($row['bill_number'] === $this->empty_field) {
return null;
}
return new Model($row); return new Model($row);
} }

View File

@ -11,11 +11,6 @@ class InvoiceHistories extends Import
{ {
public function model(array $row) public function model(array $row)
{ {
// @todo remove after laravel-excel 3.2 release
if ($row['invoice_number'] === $this->empty_field) {
return null;
}
return new Model($row); return new Model($row);
} }

View File

@ -13,11 +13,6 @@ class InvoiceItemTaxes extends Import
{ {
public function model(array $row) public function model(array $row)
{ {
// @todo remove after laravel-excel 3.2 release
if ($row['invoice_number'] === $this->empty_field) {
return null;
}
return new Model($row); return new Model($row);
} }

View File

@ -3,7 +3,7 @@
namespace App\Traits; namespace App\Traits;
use Exception; use Exception;
use Illuminate\Bus\Dispatcher; use Illuminate\Contracts\Bus\Dispatcher;
use Throwable; use Throwable;
trait Jobs trait Jobs

41
composer.lock generated
View File

@ -344,16 +344,16 @@
}, },
{ {
"name": "akaunting/laravel-setting", "name": "akaunting/laravel-setting",
"version": "1.2.5", "version": "1.2.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/akaunting/laravel-setting.git", "url": "https://github.com/akaunting/laravel-setting.git",
"reference": "6faedfebd866c3f30efeda58e8a142979ed554b2" "reference": "10186327e3b93fca56eaa9e4d8ee2ead189f0332"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/akaunting/laravel-setting/zipball/6faedfebd866c3f30efeda58e8a142979ed554b2", "url": "https://api.github.com/repos/akaunting/laravel-setting/zipball/10186327e3b93fca56eaa9e4d8ee2ead189f0332",
"reference": "6faedfebd866c3f30efeda58e8a142979ed554b2", "reference": "10186327e3b93fca56eaa9e4d8ee2ead189f0332",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -405,9 +405,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/akaunting/laravel-setting/issues", "issues": "https://github.com/akaunting/laravel-setting/issues",
"source": "https://github.com/akaunting/laravel-setting/tree/1.2.5" "source": "https://github.com/akaunting/laravel-setting/tree/1.2.7"
}, },
"time": "2021-03-05T12:10:57+00:00" "time": "2021-04-23T22:38:26+00:00"
}, },
{ {
"name": "akaunting/laravel-version", "name": "akaunting/laravel-version",
@ -1814,40 +1814,39 @@
}, },
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
"version": "1.10.2", "version": "1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/cache.git", "url": "https://github.com/doctrine/cache.git",
"reference": "13e3381b25847283a91948d04640543941309727" "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", "url": "https://api.github.com/repos/doctrine/cache/zipball/a9c1b59eba5a08ca2770a76eddb88922f504e8e0",
"reference": "13e3381b25847283a91948d04640543941309727", "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "~7.1 || ^8.0" "php": "~7.1 || ^8.0"
}, },
"conflict": { "conflict": {
"doctrine/common": ">2.2,<2.4" "doctrine/common": ">2.2,<2.4",
"psr/cache": ">=3"
}, },
"require-dev": { "require-dev": {
"alcaeus/mongo-php-adapter": "^1.1", "alcaeus/mongo-php-adapter": "^1.1",
"doctrine/coding-standard": "^6.0", "cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^8.0",
"mongodb/mongodb": "^1.1", "mongodb/mongodb": "^1.1",
"phpunit/phpunit": "^7.0", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"predis/predis": "~1.0" "predis/predis": "~1.0",
"psr/cache": "^1.0 || ^2.0",
"symfony/cache": "^4.4 || ^5.2"
}, },
"suggest": { "suggest": {
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
@ -1894,7 +1893,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/doctrine/cache/issues", "issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/1.10.x" "source": "https://github.com/doctrine/cache/tree/1.11.0"
}, },
"funding": [ "funding": [
{ {
@ -1910,7 +1909,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-07T18:54:01+00:00" "time": "2021-04-13T14:46:17+00:00"
}, },
{ {
"name": "doctrine/collections", "name": "doctrine/collections",

View File

@ -26,8 +26,6 @@ class Accounts extends Seeder
{ {
$company_id = $this->command->argument('company'); $company_id = $this->command->argument('company');
setting()->setExtraColumns(['company_id' => $company_id]);
$account = Account::create([ $account = Account::create([
'company_id' => $company_id, 'company_id' => $company_id,
'name' => trans('demo.accounts.cash'), 'name' => trans('demo.accounts.cash'),

View File

@ -64,26 +64,28 @@ class Categories extends Seeder
], ],
]; ];
$income_category = $expense_category = false; $income_category_id = $expense_category_id = 0;
foreach ($rows as $row) { foreach ($rows as $row) {
$category = Category::create($row); $category = Category::create($row);
switch ($category->type) { switch ($category->type) {
case 'income': case 'income':
if (empty($income_category)) { if (empty($income_category_id)) {
$income_category = $category; $income_category_id = $category->id;
} }
break; break;
case 'expense': case 'expense':
if (empty($expense_category)) { if (empty($expense_category_id)) {
$expense_category = $category; $expense_category_id = $category->id;
} }
break; break;
} }
} }
setting()->set('default.income_category', $income_category->id); setting()->set('default.income_category', $income_category_id);
setting()->set('default.expense_category', $expense_category->id); setting()->set('default.expense_category', $expense_category_id);
} }
} }

View File

@ -25,8 +25,6 @@ class Settings extends Seeder
{ {
$company_id = $this->command->argument('company'); $company_id = $this->command->argument('company');
setting()->setExtraColumns(['company_id' => $company_id]);
$offline_payments = [ $offline_payments = [
[ [
'code' => 'offline-payments.cash.1', 'code' => 'offline-payments.cash.1',

View File

@ -105,7 +105,7 @@
@stack('timeline_viewed_invoice_body_message_start') @stack('timeline_viewed_invoice_body_message_start')
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small> <small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
<small>{{ trans('invoices.messages.status.viewed') }}</small> <small>{{ trans('invoices.messages.status.viewed') }}</small>
@stack('timeline_viewed_invoice_body_message_end')) @stack('timeline_viewed_invoice_body_message_end')
@elseif($document->status == 'received') @elseif($document->status == 'received')
@stack('timeline_receive_bill_body_message_start') @stack('timeline_receive_bill_body_message_start')
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small> <small>{{ trans_choice('general.statuses', 1) . ':' }}</small>