1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Fixes for missing payments

This commit is contained in:
David Bomba 2023-10-06 22:21:58 +11:00
parent e56b14e8be
commit 02a85cfc5a

View File

@ -75,23 +75,23 @@ class TemplateAction implements ShouldQueue
$key = $this->resolveEntityString(); $key = $this->resolveEntityString();
$entity = new $this->entity(); $resource = $this->entity::query();
$template = Design::withTrashed()->find($this->decodePrimaryKey($this->template)); $template = Design::withTrashed()->find($this->decodePrimaryKey($this->template));
$template_service = new TemplateService($template); $template_service = new TemplateService($template);
$resource = $entity->query() if($this->entity == Invoice::class) {
->withTrashed() $resource->with('payments', 'client');
->whereIn('id', $this->transformKeys($this->ids)) }
->where('company_id', $this->company->id);
if($this->entity == Invoice::class) $resource->withTrashed()
$resource->with('payments','client'); ->whereIn('id', $this->transformKeys($this->ids))
->where('company_id', $this->company->id);
$resource->get(); $resource->get();
if(count($resource) <= 1) if($resource->count() <= 1)
$data[$key] = [$resource]; $data[$key] = [$resource];
else else
$data[$key] = $resource; $data[$key] = $resource;