mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-10 01:54:36 -04:00
Merge pull request #9512 from turbo124/v5-develop
Fixes for client filters for synthetic props.
This commit is contained in:
commit
d9748a926f
@ -20,7 +20,7 @@ class ReactBuilder extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'ninja:react';
|
protected $signature = 'ninja:react {--type=}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
@ -46,31 +46,39 @@ class ReactBuilder extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
// $includes = '';
|
if($this->option('type') == 'local') {
|
||||||
|
|
||||||
// $directoryIterator = false;
|
|
||||||
|
|
||||||
// try {
|
$includes = '';
|
||||||
// $directoryIterator = new \RecursiveDirectoryIterator(public_path('react/v'.config('ninja.app_version').'/'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
|
||||||
// } catch (\Exception $e) {
|
|
||||||
// $this->error('React files not found');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
$directoryIterator = false;
|
||||||
// if ($file->getExtension() == 'js') {
|
|
||||||
// if (str_contains($file->getFileName(), 'index-')) {
|
|
||||||
// $includes .= '<script type="module" crossorigin src="/react/v'.config('ninja.app_version').'/'.$file->getFileName().'"></script>'."\n";
|
|
||||||
// } else {
|
|
||||||
// $includes .= '<link rel="modulepreload" href="/react/v'.config('ninja.app_version').'/'.$file->getFileName().'">'."\n";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (str_contains($file->getFileName(), '.css')) {
|
try {
|
||||||
// $includes .= '<link rel="stylesheet" href="/react/v'.config('ninja.app_version').'/'.$file->getFileName().'">'."\n";
|
$directoryIterator = new \RecursiveDirectoryIterator(public_path('react/v'.config('ninja.app_version').'/'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
||||||
// }
|
} catch (\Exception $e) {
|
||||||
// }
|
$this->error('React files not found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// file_put_contents(resource_path('views/react/head.blade.php'), $includes);
|
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
||||||
|
if ($file->getExtension() == 'js') {
|
||||||
|
if (str_contains($file->getFileName(), 'index-')) {
|
||||||
|
$includes .= '<script type="module" crossorigin src="/react/v'.config('ninja.app_version').'/'.$file->getFileName().'"></script>'."\n";
|
||||||
|
} else {
|
||||||
|
$includes .= '<link rel="modulepreload" href="/react/v'.config('ninja.app_version').'/'.$file->getFileName().'">'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str_contains($file->getFileName(), '.css')) {
|
||||||
|
$includes .= '<link rel="stylesheet" href="/react/v'.config('ninja.app_version').'/'.$file->getFileName().'">'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents(resource_path('views/react/head.blade.php'), $includes);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,9 @@ class ClientFilters extends QueryFilters
|
|||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($sort_col[0] == 'documents')
|
||||||
|
return $this->builder;
|
||||||
|
|
||||||
if ($sort_col[0] == 'display_name') {
|
if ($sort_col[0] == 'display_name') {
|
||||||
$sort_col[0] = 'name';
|
$sort_col[0] = 'name';
|
||||||
}
|
}
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
|
|
||||||
namespace App\Helpers\Invoice;
|
namespace App\Helpers\Invoice;
|
||||||
|
|
||||||
|
use App\Models\Quote;
|
||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\PurchaseOrder;
|
use App\Models\PurchaseOrder;
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\RecurringInvoice;
|
|
||||||
use App\Models\RecurringQuote;
|
use App\Models\RecurringQuote;
|
||||||
use App\Utils\Traits\NumberFormatter;
|
use App\Models\RecurringInvoice;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use App\Utils\Traits\NumberFormatter;
|
||||||
|
|
||||||
class InvoiceSumInclusive
|
class InvoiceSumInclusive
|
||||||
{
|
{
|
||||||
|
@ -11,17 +11,18 @@
|
|||||||
|
|
||||||
namespace App\Jobs\Report;
|
namespace App\Jobs\Report;
|
||||||
|
|
||||||
use App\Jobs\Mail\NinjaMailerJob;
|
use App\Models\User;
|
||||||
use App\Jobs\Mail\NinjaMailerObject;
|
use App\Models\Company;
|
||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
use App\Mail\DownloadReport;
|
use App\Mail\DownloadReport;
|
||||||
use App\Models\Company;
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
|
use App\Jobs\Mail\NinjaMailerJob;
|
||||||
|
use App\Jobs\Mail\NinjaMailerObject;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
|
|
||||||
class SendToAdmin implements ShouldQueue
|
class SendToAdmin implements ShouldQueue
|
||||||
{
|
{
|
||||||
@ -54,12 +55,18 @@ class SendToAdmin implements ShouldQueue
|
|||||||
MultiDB::setDb($this->company->db);
|
MultiDB::setDb($this->company->db);
|
||||||
$export = new $this->report_class($this->company, $this->request);
|
$export = new $this->report_class($this->company, $this->request);
|
||||||
$csv = $export->run();
|
$csv = $export->run();
|
||||||
|
$user = $this->company->owner();
|
||||||
|
|
||||||
|
if(isset($this->request['user_id']))
|
||||||
|
{
|
||||||
|
$user = User::find($this->request['user_id']) ?? $this->company->owner();
|
||||||
|
}
|
||||||
|
|
||||||
$nmo = new NinjaMailerObject();
|
$nmo = new NinjaMailerObject();
|
||||||
$nmo->mailable = new DownloadReport($this->company, $csv, $this->file_name);
|
$nmo->mailable = new DownloadReport($this->company, $csv, $this->file_name);
|
||||||
$nmo->company = $this->company;
|
$nmo->company = $this->company;
|
||||||
$nmo->settings = $this->company->settings;
|
$nmo->settings = $this->company->settings;
|
||||||
$nmo->to_user = $this->company->owner();
|
$nmo->to_user = $user;
|
||||||
|
|
||||||
NinjaMailerJob::dispatch($nmo);
|
NinjaMailerJob::dispatch($nmo);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user