Fixes for base64 encoding of PNG images

This commit is contained in:
David Bomba
2026-01-26 22:59:09 +11:00
parent 5814079ae9
commit 646e8b2522
3 changed files with 16 additions and 10 deletions

View File

@@ -65,7 +65,7 @@ class RecurringInvoiceItemExport extends BaseExport
if (count($this->input['report_keys']) == 0) {
$this->force_keys = true;
$this->input['report_keys'] = array_values($this->mergeItemsKeys('recurring_invoice_report_keys'));
nlog($this->input['report_keys']);
// nlog($this->input['report_keys']);
}
$this->input['report_keys'] = array_merge($this->input['report_keys'], array_diff($this->forced_client_fields, $this->input['report_keys']));

View File

@@ -118,7 +118,7 @@ class PreviewInvoiceRequest extends Request
};
if ($invitation) {
nlog($invitation->toArray());
// nlog($invitation->toArray());
return $invitation;
}

View File

@@ -12,19 +12,20 @@
namespace App\Utils;
use Exception;
use App\Utils\Ninja;
use App\Models\Account;
use App\Models\Country;
use App\Models\CreditInvitation;
use App\Models\InvoiceInvitation;
use App\Models\PurchaseOrderInvitation;
use App\Models\QuoteInvitation;
use App\Models\RecurringInvoiceInvitation;
use App\Utils\Traits\AppSetup;
use App\Utils\Traits\DesignCalculator;
use App\Models\QuoteInvitation;
use App\Models\CreditInvitation;
use App\Utils\Traits\MakesDates;
use Exception;
use App\Models\InvoiceInvitation;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
use App\Utils\Traits\DesignCalculator;
use App\Models\PurchaseOrderInvitation;
use App\Models\RecurringInvoiceInvitation;
/**
* Note the premise used here is that any currencies will be formatted back to the company currency and not
@@ -350,7 +351,12 @@ class VendorHtmlEngine
$data['$signature'] = ['value' => $this->settings->email_signature ?: ' ', 'label' => ''];
$data['$emailSignature'] = &$data['$signature'];
$logo = $this->company->present()->logo_base64($this->settings);
if (Ninja::isHosted()) {
$logo = $this->company->present()->logo($this->settings);
} else {
$logo = $this->company->present()->logo_base64($this->settings);
}
$data['$company.logo'] = ['value' => $logo ?: ' ', 'label' => ctrans('texts.logo')];
$data['$company_logo'] = &$data['$company.logo'];