mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for FPX mailer and multi company selector in Client Portal
This commit is contained in:
parent
d9655de72f
commit
4b4b4cf60c
@ -37,14 +37,13 @@ class CheckClientExistence
|
|||||||
->where('email', auth()->guard('contact')->user()->email)
|
->where('email', auth()->guard('contact')->user()->email)
|
||||||
->whereNotNull('email')
|
->whereNotNull('email')
|
||||||
->where('email', '<>', '')
|
->where('email', '<>', '')
|
||||||
->distinct('company_id')
|
->distinct('client_id')
|
||||||
->distinct('email')
|
|
||||||
->whereNotNull('company_id')
|
->whereNotNull('company_id')
|
||||||
->whereHas('client', function ($query) {
|
->whereHas('client', function ($query) {
|
||||||
return $query->where('is_deleted', false);
|
return $query->where('is_deleted', false);
|
||||||
})
|
})
|
||||||
->whereHas('company', function ($query){
|
->whereHas('company', function ($query){
|
||||||
return $query->where('id', auth()->guard('contact')->user()->client->company_id);
|
return $query->where('companies.account_id', auth()->guard('contact')->user()->company->account_id);
|
||||||
})
|
})
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
@ -82,6 +82,9 @@ class PaymentFailureMailer implements ShouldQueue
|
|||||||
//determine if this user has the right permissions
|
//determine if this user has the right permissions
|
||||||
$methods = $this->findCompanyUserNotificationType($company_user, ['payment_failure_all','payment_failure', 'payment_failure_user', 'all_notifications']);
|
$methods = $this->findCompanyUserNotificationType($company_user, ['payment_failure_all','payment_failure', 'payment_failure_user', 'all_notifications']);
|
||||||
|
|
||||||
|
if(!is_string($this->error))
|
||||||
|
$this->error = "Undefined error. Please contact the administrator for further information.";
|
||||||
|
|
||||||
//if mail is a method type -fire mail!!
|
//if mail is a method type -fire mail!!
|
||||||
if (($key = array_search('mail', $methods)) !== false) {
|
if (($key = array_search('mail', $methods)) !== false) {
|
||||||
unset($methods[$key]);
|
unset($methods[$key]);
|
||||||
|
@ -141,6 +141,6 @@ class FPX
|
|||||||
$this->stripe->client->company,
|
$this->stripe->client->company,
|
||||||
);
|
);
|
||||||
|
|
||||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
throw new PaymentFailed('Failed to process the payment.', 400);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user