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

This commit is contained in:
Cüneyt Şentürk 2023-05-08 10:06:35 +03:00
commit 1295cbd0e8
4 changed files with 24 additions and 8 deletions

View File

@ -7,7 +7,6 @@ use App\Exports\Purchases\Bills as Export;
use App\Http\Requests\Common\Import as ImportRequest; use App\Http\Requests\Common\Import as ImportRequest;
use App\Http\Requests\Document\Document as Request; use App\Http\Requests\Document\Document as Request;
use App\Imports\Purchases\Bills as Import; use App\Imports\Purchases\Bills as Import;
use App\Jobs\Banking\CreateBankingDocumentTransaction;
use App\Jobs\Document\CreateDocument; use App\Jobs\Document\CreateDocument;
use App\Jobs\Document\DeleteDocument; use App\Jobs\Document\DeleteDocument;
use App\Jobs\Document\DuplicateDocument; use App\Jobs\Document\DuplicateDocument;
@ -31,7 +30,7 @@ class Bills extends Controller
*/ */
public function index() public function index()
{ {
$bills = Document::bill()->with('contact', 'items', 'last_history', 'transactions')->collect(['issued_at' => 'desc']); $bills = Document::bill()->with('contact', 'items', 'item_taxes', 'last_history', 'transactions')->collect(['issued_at' => 'desc']);
return $this->response('purchases.bills.index', compact('bills')); return $this->response('purchases.bills.index', compact('bills'));
} }

View File

@ -13,7 +13,6 @@ use App\Jobs\Document\DuplicateDocument;
use App\Jobs\Document\SendDocument; use App\Jobs\Document\SendDocument;
use App\Jobs\Document\UpdateDocument; use App\Jobs\Document\UpdateDocument;
use App\Models\Document\Document; use App\Models\Document\Document;
use App\Notifications\Sale\Invoice as Notification;
use App\Traits\Documents; use App\Traits\Documents;
class Invoices extends Controller class Invoices extends Controller
@ -32,7 +31,7 @@ class Invoices extends Controller
*/ */
public function index() public function index()
{ {
$invoices = Document::invoice()->with('contact', 'items', 'last_history', 'transactions')->collect(['document_number'=> 'desc']); $invoices = Document::invoice()->with('contact', 'items', 'item_taxes', 'last_history', 'transactions')->collect(['document_number'=> 'desc']);
return $this->response('sales.invoices.index', compact('invoices')); return $this->response('sales.invoices.index', compact('invoices'));
} }

View File

@ -6,6 +6,7 @@ use App\Models\Auth\User;
use App\Models\Common\Company; use App\Models\Common\Company;
use App\Models\Common\Contact; use App\Models\Common\Contact;
use App\Models\Document\Document; use App\Models\Document\Document;
use App\Traits\Cloud;
use Composer\InstalledVersions; use Composer\InstalledVersions;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@ -13,7 +14,15 @@ class Info
{ {
public static function all() public static function all()
{ {
return array_merge(static::versions(), [ static $info = [];
$is_cloud = (new class { use Cloud; })->isCloud();
if (! empty($info) || $is_cloud) {
return $info;
}
$info = array_merge(static::versions(), [
'api_key' => setting('apps.api_key'), 'api_key' => setting('apps.api_key'),
'ip' => static::ip(), 'ip' => static::ip(),
'companies' => Company::count(), 'companies' => Company::count(),
@ -22,11 +31,19 @@ class Info
'customers' => Contact::customer()->count(), 'customers' => Contact::customer()->count(),
'php_extensions' => static::phpExtensions(), 'php_extensions' => static::phpExtensions(),
]); ]);
return $info;
} }
public static function versions() public static function versions()
{ {
return [ static $versions = [];
if (! empty($versions)) {
return $versions;
}
$versions = [
'akaunting' => version('short'), 'akaunting' => version('short'),
'laravel' => InstalledVersions::getPrettyVersion('laravel/framework'), 'laravel' => InstalledVersions::getPrettyVersion('laravel/framework'),
'php' => static::phpVersion(), 'php' => static::phpVersion(),
@ -35,6 +52,8 @@ class Info
'livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'), 'livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'),
'omnipay' => InstalledVersions::getPrettyVersion('league/omnipay'), 'omnipay' => InstalledVersions::getPrettyVersion('league/omnipay'),
]; ];
return $versions;
} }
public static function phpVersion() public static function phpVersion()

View File

@ -3,7 +3,6 @@
namespace App\View\Components\Documents\Form; namespace App\View\Components\Documents\Form;
use App\Abstracts\View\Components\Documents\Form as Component; use App\Abstracts\View\Components\Documents\Form as Component;
use App\Models\Common\Company as Model;
class Company extends Component class Company extends Component
{ {
@ -14,7 +13,7 @@ class Company extends Component
*/ */
public function render() public function render()
{ {
$company = Model::find(company_id()); $company = company();
$inputNameType = config('type.document.' . $this->type . '.route.parameter'); $inputNameType = config('type.document.' . $this->type . '.route.parameter');