From 43a29c2bb08095e02b998726760fbd75171d54b2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 14 Sep 2022 09:48:25 +1000 Subject: [PATCH] Minor fixes for zip documents --- app/Jobs/Document/ZipDocuments.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Document/ZipDocuments.php b/app/Jobs/Document/ZipDocuments.php index aa05eb1f7d17..7cb8a3e2f3ed 100644 --- a/app/Jobs/Document/ZipDocuments.php +++ b/app/Jobs/Document/ZipDocuments.php @@ -126,6 +126,12 @@ class ZipDocuments implements ShouldQueue $number = '_'.$document->documentable->number; } - return "{$date}_{$document->documentable->translate_entity()}{$number}_{$filename}"; + $entity = ctrans('texts.document'); + + if(isset($document->documentable)){ + $entity = $document->documentable->translate_entity(); + } + + return "{$date}_{$entity}{$number}_{$filename}"; } }