mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 05:34:34 -04:00
Minor fixes
This commit is contained in:
parent
dbbd86063d
commit
cea49c43fc
@ -39,6 +39,10 @@ class Request extends FormRequest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//01-02-2022 needed for CSV Imports
|
||||||
|
if(!$merge_rules)
|
||||||
|
return $rules;
|
||||||
|
|
||||||
return array_merge($merge_rules, $rules);
|
return array_merge($merge_rules, $rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Http\ValidationRules\Company;
|
namespace App\Http\ValidationRules\Company;
|
||||||
|
|
||||||
|
use App\Utils\Ninja;
|
||||||
use Illuminate\Contracts\Validation\Rule;
|
use Illuminate\Contracts\Validation\Rule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,7 +26,12 @@ class ValidCompanyQuantity implements Rule
|
|||||||
*/
|
*/
|
||||||
public function passes($attribute, $value)
|
public function passes($attribute, $value)
|
||||||
{
|
{
|
||||||
return auth()->user()->company()->account->companies->count() <= 10;
|
if(Ninja::isSelfHost())
|
||||||
|
return auth()->user()->company()->account->companies->count() < 10;
|
||||||
|
|
||||||
|
|
||||||
|
return auth()->user()->company()->account->companies->count() < auth()->user()->company()->account->hosted_company_count;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +35,7 @@ class CanStoreClientsRule implements Rule
|
|||||||
{
|
{
|
||||||
$company = Company::find($this->company_id);
|
$company = Company::find($this->company_id);
|
||||||
|
|
||||||
return $company->clients->count() < config('ninja.quotas.free.clients');
|
return $company->clients->count() < $company->account->hosted_client_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,6 +43,6 @@ class CanStoreClientsRule implements Rule
|
|||||||
*/
|
*/
|
||||||
public function message()
|
public function message()
|
||||||
{
|
{
|
||||||
return ctrans('texts.limit_clients', ['count' => config('ninja.quotas.free.clients')]);
|
return ctrans('texts.limit_clients', ['count' => $company->account->hosted_client_count]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ class AuthorizeCreateCustomer
|
|||||||
$this->authorize->init();
|
$this->authorize->init();
|
||||||
// Create the Bill To info for new payment type
|
// Create the Bill To info for new payment type
|
||||||
|
|
||||||
$contact = $this->client->primary_contact()->first();
|
$contact = $this->client->primary_contact()->first() ?: $this->client->contacts()->first();
|
||||||
$refId = 'ref'.time();
|
$refId = 'ref'.time();
|
||||||
|
|
||||||
// Create a new CustomerProfileType and add the payment profile object
|
// Create a new CustomerProfileType and add the payment profile object
|
||||||
|
@ -62,7 +62,7 @@ trait Utilities
|
|||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'payment_method' => $_payment->source['id'],
|
'payment_method' => $_payment->source['id'],
|
||||||
'payment_type' => PaymentType::parseCardType(strtolower($_payment->source['scheme'])),
|
'payment_type' => 12,
|
||||||
'amount' => $this->getParent()->payment_hash->data->raw_value,
|
'amount' => $this->getParent()->payment_hash->data->raw_value,
|
||||||
'transaction_reference' => $_payment->id,
|
'transaction_reference' => $_payment->id,
|
||||||
'gateway_type_id' => GatewayType::CREDIT_CARD,
|
'gateway_type_id' => GatewayType::CREDIT_CARD,
|
||||||
|
@ -54,7 +54,7 @@ class ActivityRepository extends BaseRepository
|
|||||||
$activity->token_id = $token_id;
|
$activity->token_id = $token_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$activity->ip = $event_vars['ip'];
|
$activity->ip = $event_vars['ip'] ?: ' ';
|
||||||
$activity->is_system = $event_vars['is_system'];
|
$activity->is_system = $event_vars['is_system'];
|
||||||
|
|
||||||
$activity->save();
|
$activity->save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user