close #2061 Fixed: Not showing company logo in invoice/bill page
This commit is contained in:
parent
f0f4e99bc2
commit
db966860f1
@ -596,7 +596,7 @@ abstract class DocumentShow extends Base
|
||||
if (!empty($media)) {
|
||||
$path = Storage::path($media->getDiskPath());
|
||||
|
||||
if (!is_file($path)) {
|
||||
if (!Storage::exists($path)) {
|
||||
return $logo;
|
||||
}
|
||||
} else {
|
||||
@ -604,11 +604,15 @@ abstract class DocumentShow extends Base
|
||||
}
|
||||
|
||||
try {
|
||||
$image = Image::cache(function($image) use ($path) {
|
||||
$image = Image::cache(function($image) use ($media, $path) {
|
||||
$width = setting('invoice.logo_size_width');
|
||||
$height = setting('invoice.logo_size_height');
|
||||
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
if ($media) {
|
||||
$image->make($media->stream())->resize($width, $height)->encode();
|
||||
} else {
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
}
|
||||
});
|
||||
} catch (NotReadableException | \Exception $e) {
|
||||
Log::info('Company ID: ' . company_id() . ' components/documentshow.php exception.');
|
||||
|
@ -198,7 +198,7 @@ abstract class DocumentTemplate extends Base
|
||||
if (!empty($media)) {
|
||||
$path = Storage::path($media->getDiskPath());
|
||||
|
||||
if (!is_file($path)) {
|
||||
if (!Storage::exists($path)) {
|
||||
return $logo;
|
||||
}
|
||||
} else {
|
||||
@ -206,11 +206,15 @@ abstract class DocumentTemplate extends Base
|
||||
}
|
||||
|
||||
try {
|
||||
$image = Image::cache(function($image) use ($path) {
|
||||
$image = Image::cache(function($image) use ($media, $path) {
|
||||
$width = setting('invoice.logo_size_width');
|
||||
$height = setting('invoice.logo_size_height');
|
||||
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
if ($media) {
|
||||
$image->make($media->stream())->resize($width, $height)->encode();
|
||||
} else {
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
}
|
||||
});
|
||||
} catch (NotReadableException | \Exception $e) {
|
||||
Log::info('Company ID: ' . company_id() . ' components/documentshow.php exception.');
|
||||
|
@ -27,7 +27,7 @@ class Logo
|
||||
if (!empty($media)) {
|
||||
$path = Storage::path($media->getDiskPath());
|
||||
|
||||
if (!is_file($path)) {
|
||||
if (!Storage::exists($path)) {
|
||||
return $logo;
|
||||
}
|
||||
} else {
|
||||
@ -35,11 +35,15 @@ class Logo
|
||||
}
|
||||
|
||||
try {
|
||||
$image = Image::cache(function($image) use ($path) {
|
||||
$image = Image::cache(function($image) use ($media, $path) {
|
||||
$width = setting('invoice.logo_size_width');
|
||||
$height = setting('invoice.logo_size_height');
|
||||
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
if ($media) {
|
||||
$image->make($media->stream())->resize($width, $height)->encode();
|
||||
} else {
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
}
|
||||
});
|
||||
} catch (NotReadableException | \Exception $e) {
|
||||
Log::info('Company ID: ' . company_id() . ' viewcomposer/logo.php exception.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user