Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Oct 15, 2024
1 parent 4e80bdd commit c6c8ec7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
1 change: 0 additions & 1 deletion app/Http/Controllers/ClientPortal/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public function show(ShowInvoiceRequest $request, Invoice $invoice, ?string $has

return auth()->guard('contact')->user()->client->getSetting('payment_flow') == 'default' ? $this->render('invoices.show', $data) : $this->render('invoices.show_smooth', $data);

// return $this->render('invoices.show_smooth', $data);
}

public function showBlob($hash)
Expand Down
1 change: 0 additions & 1 deletion app/Http/Middleware/CheckClientExistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function handle(Request $request, Closure $next)
}

session()->put('multiple_contacts', $multiple_contacts);

session()->put('is_silent', request()->has('silent'));

return $next($request);
Expand Down
15 changes: 6 additions & 9 deletions app/Livewire/Flow2/InvoicePay.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,12 @@ public function handleContext(string $property, $value): self
#[On('terms-accepted')]
public function termsAccepted()
{
nlog("Terms accepted");
// $this->invite = \App\Models\InvoiceInvitation::withTrashed()->find($this->invitation_id)->withoutRelations();
$this->terms_accepted = true;
}

#[On('signature-captured')]
public function signatureCaptured($base64)
{
nlog("signature captured");

$this->signature_accepted = true;
$invite = \App\Models\InvoiceInvitation::withTrashed()->find($this->invitation_id);
Expand Down Expand Up @@ -141,7 +138,6 @@ public function paymentMethodSelected($company_gateway_id, $gateway_type_id, $am
$this->setContext('amount', $amount);
$this->setContext('pre_payment', false);
$this->setContext('is_recurring', false);
$this->setContext('invitation_id', $this->invitation_id);

$this->payment_method_accepted = true;

Expand Down Expand Up @@ -178,9 +174,7 @@ private function checkRequiredFields(CompanyGateway $company_gateway)
empty($contact->client->{$_field})
|| is_null($contact->client->{$_field}) //@phpstan-ignore-line
) {

return $this->required_fields = true;

}
}

Expand All @@ -190,7 +184,7 @@ private function checkRequiredFields(CompanyGateway $company_gateway)
}
}
}

return $this->required_fields = false;

}
Expand Down Expand Up @@ -231,17 +225,20 @@ public function componentUniqueId(): string

public function mount()
{

$this->resetContext();

MultiDB::setDb($this->db);

// @phpstan-ignore-next-line
$invite = \App\Models\InvoiceInvitation::with('contact.client', 'company')->withTrashed()->find($this->invitation_id);

$client = $invite->contact->client;
$settings = $client->getMergedSettings();
$this->setContext('contact', $invite->contact); // $this->context['contact'] = $invite->contact;
$this->setContext('settings', $settings); // $this->context['settings'] = $settings;
$this->setContext('db', $this->db); // $this->context['db'] = $this->db;
$this->setContext('invitation_id', $this->invitation_id);

if(is_array($this->invoices))
$this->invoices = Invoice::find($this->transformKeys($this->invoices));
Expand Down Expand Up @@ -292,9 +289,9 @@ public function render(): \Illuminate\Contracts\View\Factory|\Illuminate\View\Vi

public function exception($e, $stopPropagation)
{


app('sentry')->captureException($e);
nlog($e->getMessage());

$stopPropagation();

}
Expand Down
4 changes: 1 addition & 3 deletions app/Livewire/Flow2/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ public function render(): \Illuminate\Contracts\View\Factory|\Illuminate\View\Vi

public function exception($e, $stopPropagation)
{

nlog($e->getMessage());
app('sentry')->captureException($e);
$stopPropagation();

}
}
2 changes: 2 additions & 0 deletions app/Livewire/Flow2/ProcessPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public function render(): \Illuminate\Contracts\View\Factory|string|\Illuminate\
public function exception($e, $stopPropagation)
{

app('sentry')->captureException($e);

$errors = session()->get('errors', new \Illuminate\Support\ViewErrorBag());

$bag = new \Illuminate\Support\MessageBag();
Expand Down
9 changes: 4 additions & 5 deletions app/Livewire/Flow2/RequiredFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public function mount(): void

$this->fields = $this->getContext()['fields'];

$contact = auth()->guard('contact')->user();

$this->company_gateway = CompanyGateway::withTrashed()
->with('company')
->find($this->getContext()['company_gateway_id']);

$contact = auth()->guard('contact')->user();


$this->client_name = $contact->client->name;
$this->contact_first_name = $contact->first_name;
$this->contact_last_name = $contact->last_name;
Expand Down Expand Up @@ -138,9 +138,8 @@ public function render(): \Illuminate\Contracts\View\Factory|\Illuminate\View\Vi

public function exception($e, $stopPropagation)
{

app('sentry')->captureException($e);
nlog($e->getMessage());

$stopPropagation();

}
Expand Down

0 comments on commit c6c8ec7

Please sign in to comment.