diff --git a/app/Http/Requests/Invoice/BulkInvoiceRequest.php b/app/Http/Requests/Invoice/BulkInvoiceRequest.php index d56396196c..6f0fc1ce29 100644 --- a/app/Http/Requests/Invoice/BulkInvoiceRequest.php +++ b/app/Http/Requests/Invoice/BulkInvoiceRequest.php @@ -44,7 +44,7 @@ class BulkInvoiceRequest extends Request throw new DuplicatePaymentException('Action still processing, please wait. ', 429); } - $delay = $this->input('action', 'delete') == 'delete' ? (ceil(count($this->input('ids', 4)))) : 1; + $delay = $this->input('action', 'delete') == 'delete' ? (ceil(count($this->input('ids', 2)))) : 1; \Illuminate\Support\Facades\Cache::put(($this->ip()."|".$this->input('action', 0)."|".$user->company()->company_key), true, $delay); } diff --git a/app/Services/Client/Statement.php b/app/Services/Client/Statement.php index e2b609b9c1..9fe51761bf 100644 --- a/app/Services/Client/Statement.php +++ b/app/Services/Client/Statement.php @@ -160,6 +160,7 @@ class Statement private function templateStatement($variables) { + if (isset($this->options['template'])) { $statement_design_id = $this->options['template']; } else { @@ -221,12 +222,10 @@ class Statement $this->entity = $this->getInvoices()->first();//@phpstan-ignore-line } else { - nlog("fall back to any invoice/invitation"); $this->entity = $this->client->invoices()->whereHas('invitations')->first(); } if(\is_null($this->entity)){ - $settings = new \stdClass(); $settings->entity = \App\Models\Client::class; $settings->currency_id = '1'; @@ -419,13 +418,12 @@ class Statement protected function getInvitation() { if($this->entity instanceof Invoice) { - // if ($this->entity instanceof Invoice || $this->entity instanceof Payment) { - $invitation = $this->entity->whereHas('invitations')->first()->invitations->first(); + $invitation = $this->entity->invitations->first(); if($invitation) return $invitation; - $invitation = $this->client->invoice()->whereHas('invitations')->first()->invitations->first(); + $invitation = $this->client->invoices()->whereHas('invitations')->first()->invitations->first(); if ($invitation) return $invitation; diff --git a/app/Services/PdfMaker/PdfMaker.php b/app/Services/PdfMaker/PdfMaker.php index c42a54951b..269fb1aedc 100644 --- a/app/Services/PdfMaker/PdfMaker.php +++ b/app/Services/PdfMaker/PdfMaker.php @@ -29,8 +29,6 @@ class PdfMaker private $options; - public $xpath; - /** @var CommonMarkConverter */ protected $commonmark;