mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #5105 from turbo124/v5-develop
Improve PDF creation performance
This commit is contained in:
commit
4f626ca90d
@ -25,7 +25,7 @@ DEMO_MODE=false
|
||||
BROADCAST_DRIVER=log
|
||||
LOG_CHANNEL=stack
|
||||
CACHE_DRIVER=file
|
||||
QUEUE_CONNECTION=database
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
@ -51,7 +51,7 @@ TRUSTED_PROXIES=
|
||||
|
||||
NINJA_ENVIRONMENT=selfhost
|
||||
|
||||
PHANTOMJS_PDF_GENERATION=false
|
||||
PHANTOMJS_PDF_GENERATION=true
|
||||
PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address'
|
||||
PHANTOMJS_SECRET=secret
|
||||
|
||||
|
@ -1 +1 @@
|
||||
5.1.18
|
||||
5.1.19
|
@ -157,21 +157,21 @@ class InvoiceSum
|
||||
{
|
||||
$this->total += $this->total_taxes;
|
||||
|
||||
if (is_numeric($this->invoice->custom_value1)) {
|
||||
$this->total += $this->invoice->custom_value1;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value1)) {
|
||||
// $this->total += $this->invoice->custom_value1;
|
||||
// }
|
||||
|
||||
if (is_numeric($this->invoice->custom_value2)) {
|
||||
$this->total += $this->invoice->custom_value2;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value2)) {
|
||||
// $this->total += $this->invoice->custom_value2;
|
||||
// }
|
||||
|
||||
if (is_numeric($this->invoice->custom_value3)) {
|
||||
$this->total += $this->invoice->custom_value3;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value3)) {
|
||||
// $this->total += $this->invoice->custom_value3;
|
||||
// }
|
||||
|
||||
if (is_numeric($this->invoice->custom_value4)) {
|
||||
$this->total += $this->invoice->custom_value4;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value4)) {
|
||||
// $this->total += $this->invoice->custom_value4;
|
||||
// }
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -166,21 +166,21 @@ class InvoiceSumInclusive
|
||||
{
|
||||
//$this->total += $this->total_taxes;
|
||||
|
||||
if (is_numeric($this->invoice->custom_value1)) {
|
||||
$this->total += $this->invoice->custom_value1;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value1)) {
|
||||
// $this->total += $this->invoice->custom_value1;
|
||||
// }
|
||||
|
||||
if (is_numeric($this->invoice->custom_value2)) {
|
||||
$this->total += $this->invoice->custom_value2;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value2)) {
|
||||
// $this->total += $this->invoice->custom_value2;
|
||||
// }
|
||||
|
||||
if (is_numeric($this->invoice->custom_value3)) {
|
||||
$this->total += $this->invoice->custom_value3;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value3)) {
|
||||
// $this->total += $this->invoice->custom_value3;
|
||||
// }
|
||||
|
||||
if (is_numeric($this->invoice->custom_value4)) {
|
||||
$this->total += $this->invoice->custom_value4;
|
||||
}
|
||||
// if (is_numeric($this->invoice->custom_value4)) {
|
||||
// $this->total += $this->invoice->custom_value4;
|
||||
// }
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -134,10 +134,9 @@ class ConnectedAccountController extends BaseController
|
||||
auth()->user()->save();
|
||||
|
||||
//$ct = CompanyUser::whereUserId(auth()->user()->id);
|
||||
$ct = CompanyUser::whereUserId(auth()->user()->id);
|
||||
//return $this->listResponse($ct);
|
||||
|
||||
return $this->listResponse($ct);
|
||||
// return $this->listResponse(auth()->user());
|
||||
return $this->listResponse(auth()->user());
|
||||
}
|
||||
|
||||
return response()
|
||||
|
@ -376,6 +376,8 @@ class CreditController extends BaseController
|
||||
|
||||
$credit = $this->credit_repository->save($request->all(), $credit);
|
||||
|
||||
$credit->service()->deletePdf();
|
||||
|
||||
event(new CreditWasUpdated($credit, $credit->company, Ninja::eventVars()));
|
||||
|
||||
return $this->itemResponse($credit);
|
||||
|
@ -387,6 +387,8 @@ class QuoteController extends BaseController
|
||||
|
||||
$quote = $this->quote_repo->save($request->all(), $quote);
|
||||
|
||||
$quote->service()->deletePdf();
|
||||
|
||||
event(new QuoteWasUpdated($quote, $quote->company, Ninja::eventVars()));
|
||||
|
||||
return $this->itemResponse($quote);
|
||||
|
@ -374,6 +374,8 @@ class RecurringInvoiceController extends BaseController
|
||||
|
||||
$recurring_invoice = $this->recurring_invoice_repo->save($request->all(), $recurring_invoice);
|
||||
|
||||
$recurring_invoice->service()->deletePdf()->save();
|
||||
|
||||
return $this->itemResponse($recurring_invoice);
|
||||
}
|
||||
|
||||
|
@ -96,22 +96,6 @@ class CreateAccount
|
||||
//todo implement SLACK notifications
|
||||
//$sp035a66->notification(new NewAccountCreated($spaa9f78, $sp035a66))->ninja();
|
||||
|
||||
// $nmo = new NinjaMailerObject;
|
||||
// $nmo->mailable = new NinjaMailer((new AccountCreatedObject($spaa9f78, $sp035a66))->build());
|
||||
// $nmo->company = $sp035a66;
|
||||
// $nmo->to_user = $spaa9f78;
|
||||
// $nmo->settings = $sp035a66->settings;
|
||||
|
||||
// $nmo = new NinjaMailerObject;
|
||||
// $nmo->mailable = new NinjaMailer((new VerifyUserObject($spaa9f78, $sp035a66))->build());
|
||||
// $nmo->company = $sp035a66;
|
||||
// $nmo->to_user = $spaa9f78;
|
||||
// $nmo->settings = $sp035a66->settings;
|
||||
|
||||
// NinjaMailerJob::dispatch($nmo);
|
||||
|
||||
// NinjaMailerJob::dispatchNow($nmo);
|
||||
|
||||
VersionCheck::dispatchNow();
|
||||
|
||||
LightLogs::create(new AnalyticsAccountCreated())
|
||||
|
@ -88,6 +88,8 @@ class CreditService
|
||||
{
|
||||
$this->credit = (new ApplyPayment($this->credit, $invoice, $amount, $payment))->run();
|
||||
|
||||
$this->deletePdf();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ class MarkSent
|
||||
->setStatus(Credit::STATUS_SENT)
|
||||
->applyNumber()
|
||||
->adjustBalance($this->credit->amount)
|
||||
->deletePdf()
|
||||
->save();
|
||||
|
||||
|
||||
|
@ -43,6 +43,7 @@ class MarkSent
|
||||
->service()
|
||||
->setStatus(Quote::STATUS_SENT)
|
||||
->applyNumber()
|
||||
->deletePdf()
|
||||
->save();
|
||||
|
||||
return $this->quote;
|
||||
|
@ -39,21 +39,6 @@ class QuoteService
|
||||
return $this;
|
||||
}
|
||||
|
||||
// public function markApproved()
|
||||
// {
|
||||
// $mark_approved = new MarkApproved($this->quote->client);
|
||||
// $this->quote = $mark_approved->run($this->quote);
|
||||
|
||||
// if ($this->quote->client->getSetting('auto_convert_quote') == true) {
|
||||
// $this->convert();
|
||||
// }
|
||||
|
||||
// $this->markSent()
|
||||
// ->createInvitations();
|
||||
|
||||
// return $this;
|
||||
// }
|
||||
|
||||
public function convert() :self
|
||||
{
|
||||
if ($this->quote->invoice_id) {
|
||||
@ -127,6 +112,7 @@ class QuoteService
|
||||
->service()
|
||||
->markSent()
|
||||
->createInvitations()
|
||||
->deletePdf()
|
||||
->save();
|
||||
|
||||
}
|
||||
|
@ -65,7 +65,7 @@
|
||||
"predis/predis": "^1.1",
|
||||
"sentry/sentry-laravel": "^2",
|
||||
"stripe/stripe-php": "^7.50",
|
||||
"turbo124/beacon": "^1",
|
||||
"turbo124/beacon": "^1.0",
|
||||
"webpatser/laravel-countries": "dev-master#75992ad",
|
||||
"wildbit/swiftmailer-postmark": "^3.3"
|
||||
},
|
||||
|
713
composer.lock
generated
713
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,7 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', ''),
|
||||
'app_version' => '5.1.18',
|
||||
'app_version' => '5.1.19',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', false),
|
||||
|
@ -45,7 +45,7 @@ class BillingSubscriptionApiTest extends TestCase
|
||||
Model::reguard();
|
||||
}
|
||||
|
||||
public function testExpenseGet()
|
||||
public function testBillingSubscriptionsGet()
|
||||
{
|
||||
$product = Product::factory()->create([
|
||||
'company_id' => $this->company->id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user