From ccfc2f7bfc73873f9365489d8712f752b442f124 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Nov 2022 17:27:10 +1100 Subject: [PATCH 1/2] Cleanup logging --- app/Observers/InvoiceObserver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Observers/InvoiceObserver.php b/app/Observers/InvoiceObserver.php index 8844ba53610f..249aa23866f8 100644 --- a/app/Observers/InvoiceObserver.php +++ b/app/Observers/InvoiceObserver.php @@ -45,8 +45,8 @@ class InvoiceObserver * @return void */ public function updated(Invoice $invoice) - {nlog("updated"); - $subscriptions = Webhook::where('company_id', $invoice->company_id) + { + $subscriptions = Webhook::where('company_id', $invoice->company_id) ->where('event_id', Webhook::EVENT_UPDATE_INVOICE) ->exists(); From f1d6283a94bca5f224067eed652b35f5be14f1ee Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Nov 2022 17:28:17 +1100 Subject: [PATCH 2/2] Clean up for logging --- app/Helpers/Epc/EpcQrGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Helpers/Epc/EpcQrGenerator.php b/app/Helpers/Epc/EpcQrGenerator.php index 25a5ee9a833e..fe4fcbd84878 100644 --- a/app/Helpers/Epc/EpcQrGenerator.php +++ b/app/Helpers/Epc/EpcQrGenerator.php @@ -13,6 +13,7 @@ namespace App\Helpers\Epc; use App\Models\Company; use App\Models\Invoice; +use App\Utils\Ninja; use BaconQrCode\Renderer\ImageRenderer; use BaconQrCode\Renderer\Image\SvgImageBackEnd; use BaconQrCode\Renderer\RendererStyle\RendererStyle; @@ -77,10 +78,10 @@ class EpcQrGenerator private function validateFields() { - if(isset($this->company?->custom_fields?->company2)) + if(Ninja::isSelfHost() && isset($this->company?->custom_fields?->company2)) nlog('The BIC field is not present and _may_ be a required fields for EPC QR codes'); - if(isset($this->company?->custom_fields?->company1)) + if(Ninja::isSelfHost() && isset($this->company?->custom_fields?->company1)) nlog('The IBAN field is required'); }