Fixes for statement
This commit is contained in:
parent
8cb2f8ea19
commit
1d89e89148
|
|
@ -44,7 +44,7 @@ class BulkInvoiceRequest extends Request
|
||||||
throw new DuplicatePaymentException('Action still processing, please wait. ', 429);
|
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);
|
\Illuminate\Support\Facades\Cache::put(($this->ip()."|".$this->input('action', 0)."|".$user->company()->company_key), true, $delay);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ class Statement
|
||||||
|
|
||||||
private function templateStatement($variables)
|
private function templateStatement($variables)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (isset($this->options['template'])) {
|
if (isset($this->options['template'])) {
|
||||||
$statement_design_id = $this->options['template'];
|
$statement_design_id = $this->options['template'];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -221,12 +222,10 @@ class Statement
|
||||||
$this->entity = $this->getInvoices()->first();//@phpstan-ignore-line
|
$this->entity = $this->getInvoices()->first();//@phpstan-ignore-line
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nlog("fall back to any invoice/invitation");
|
|
||||||
$this->entity = $this->client->invoices()->whereHas('invitations')->first();
|
$this->entity = $this->client->invoices()->whereHas('invitations')->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(\is_null($this->entity)){
|
if(\is_null($this->entity)){
|
||||||
|
|
||||||
$settings = new \stdClass();
|
$settings = new \stdClass();
|
||||||
$settings->entity = \App\Models\Client::class;
|
$settings->entity = \App\Models\Client::class;
|
||||||
$settings->currency_id = '1';
|
$settings->currency_id = '1';
|
||||||
|
|
@ -419,13 +418,12 @@ class Statement
|
||||||
protected function getInvitation()
|
protected function getInvitation()
|
||||||
{
|
{
|
||||||
if($this->entity instanceof Invoice) {
|
if($this->entity instanceof Invoice) {
|
||||||
// if ($this->entity instanceof Invoice || $this->entity instanceof Payment) {
|
$invitation = $this->entity->invitations->first();
|
||||||
$invitation = $this->entity->whereHas('invitations')->first()->invitations->first();
|
|
||||||
|
|
||||||
if($invitation)
|
if($invitation)
|
||||||
return $invitation;
|
return $invitation;
|
||||||
|
|
||||||
$invitation = $this->client->invoice()->whereHas('invitations')->first()->invitations->first();
|
$invitation = $this->client->invoices()->whereHas('invitations')->first()->invitations->first();
|
||||||
|
|
||||||
if ($invitation)
|
if ($invitation)
|
||||||
return $invitation;
|
return $invitation;
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ class PdfMaker
|
||||||
|
|
||||||
private $options;
|
private $options;
|
||||||
|
|
||||||
public $xpath;
|
|
||||||
|
|
||||||
/** @var CommonMarkConverter */
|
/** @var CommonMarkConverter */
|
||||||
protected $commonmark;
|
protected $commonmark;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue