Merge pull request #7938 from turbo124/v5-develop

Logging
This commit is contained in:
David Bomba 2022-11-13 17:28:35 +11:00 committed by GitHub
commit 660e0e0d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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');
}

View File

@ -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();