diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index c5008f5471ab..b878949ce901 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -7,6 +7,7 @@ use App\Events\Invoice\InvoiceWasCreated; use App\Factory\InvoiceFactory; use App\Factory\InvoiceItemFactory; use App\Helpers\Invoice\InvoiceSum; +use App\Jobs\Util\VersionCheck; use App\Models\CompanyToken; use App\Models\Country; use App\Models\Product; @@ -77,6 +78,7 @@ class DemoMode extends Command $this->info("Seeding Random Data"); $this->createSmallAccount(); + VersionCheck::dispatchNow(); } diff --git a/app/Http/Controllers/ClientPortal/InvitationController.php b/app/Http/Controllers/ClientPortal/InvitationController.php index 8258c04f5840..ec613405a3b8 100644 --- a/app/Http/Controllers/ClientPortal/InvitationController.php +++ b/app/Http/Controllers/ClientPortal/InvitationController.php @@ -48,7 +48,7 @@ class InvitationController extends Controller if (!request()->has('silent')) { $invitation->markViewed(); - event(new InvitationWasViewed($entity, $invitation, $entity->company, Ninja::eventVars())); + event(new InvitationWasViewed($invitation->{$entity}, $invitation, $invitation->{$entity}->company, Ninja::eventVars())); } return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key})]); diff --git a/app/Listeners/Misc/InvitationViewedListener.php b/app/Listeners/Misc/InvitationViewedListener.php index 394474432058..6f6b74227d29 100644 --- a/app/Listeners/Misc/InvitationViewedListener.php +++ b/app/Listeners/Misc/InvitationViewedListener.php @@ -40,9 +40,9 @@ class InvitationViewedListener implements ShouldQueue */ public function handle($event) { - MultiDB::setDb($event->company->db); + MultiDB::setDb($event->company->db); - $entity_name = $event->entity; + $entity_name = lcfirst(class_basename($event->entity)); $invitation = $event->invitation; $notification = new EntityViewedNotification($invitation, $entity_name); diff --git a/app/Mail/Admin/EntityPaidObject.php b/app/Mail/Admin/EntityPaidObject.php index 449931c8db77..237fbc36eeb8 100644 --- a/app/Mail/Admin/EntityPaidObject.php +++ b/app/Mail/Admin/EntityPaidObject.php @@ -85,7 +85,8 @@ class EntityPaidObject 'invoice' => $invoice_texts, ] ), - 'url' => config('ninja.app_url') . '/payments/' . $this->payment->hashed_id, + 'url' => config('ninja.app_url'), + // 'url' => config('ninja.app_url') . '/payments/' . $this->payment->hashed_id, //because we have no deep linking we cannot use this 'button' => ctrans('texts.view_payment'), 'signature' => $settings->email_signature, 'logo' => $this->company->present()->logo(), diff --git a/app/PaymentDrivers/AuthorizePaymentDriver.php b/app/PaymentDrivers/AuthorizePaymentDriver.php index da502665b6f6..26df0695feea 100644 --- a/app/PaymentDrivers/AuthorizePaymentDriver.php +++ b/app/PaymentDrivers/AuthorizePaymentDriver.php @@ -14,6 +14,7 @@ namespace App\PaymentDrivers; use App\Models\ClientGatewayToken; use App\Models\GatewayType; +use App\Models\Invoice; use App\Models\Payment; use App\PaymentDrivers\Authorize\AuthorizeCreditCard; use App\PaymentDrivers\Authorize\AuthorizePaymentMethod; diff --git a/app/Utils/Traits/Inviteable.php b/app/Utils/Traits/Inviteable.php index 2a674d581541..42811e385485 100644 --- a/app/Utils/Traits/Inviteable.php +++ b/app/Utils/Traits/Inviteable.php @@ -55,14 +55,14 @@ trait Inviteable switch ($this->company->portal_mode) { case 'subdomain': - return $domain .'/client/'. $entity_type .'/'. $this->key; + return $domain .'client/'. $entity_type .'/'. $this->key; break; case 'iframe': - return $domain .'/client/'. $entity_type .'/'. $this->key; + return $domain .'client/'. $entity_type .'/'. $this->key; //return $domain . $entity_type .'/'. $this->contact->client->client_hash .'/'. $this->key; break; case 'domain': - return $domain .'/client/'. $entity_type .'/'. $this->key; + return $domain .'client/'. $entity_type .'/'. $this->key; break; }