mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
dcd5e878a8
@ -1 +1 @@
|
|||||||
5.3.84
|
5.3.85
|
@ -217,6 +217,9 @@ class LoginController extends BaseController
|
|||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
->where('user_id', auth()->user()->id);
|
->where('user_id', auth()->user()->id);
|
||||||
|
|
||||||
|
if($cu->count() == 0)
|
||||||
|
return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400);
|
||||||
|
|
||||||
$truth = app()->make(TruthSource::class);
|
$truth = app()->make(TruthSource::class);
|
||||||
|
|
||||||
$truth->setCompanyUser($cu->first());
|
$truth->setCompanyUser($cu->first());
|
||||||
@ -320,6 +323,9 @@ class LoginController extends BaseController
|
|||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
->where('user_id', $company_token->user_id);
|
->where('user_id', $company_token->user_id);
|
||||||
|
|
||||||
|
if($cu->count() == 0)
|
||||||
|
return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400);
|
||||||
|
|
||||||
$cu->first()->account->companies->each(function ($company) use($cu, $request){
|
$cu->first()->account->companies->each(function ($company) use($cu, $request){
|
||||||
|
|
||||||
if($company->tokens()->where('is_system', true)->count() == 0)
|
if($company->tokens()->where('is_system', true)->count() == 0)
|
||||||
@ -390,6 +396,8 @@ class LoginController extends BaseController
|
|||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
->where('user_id', auth()->user()->id);
|
->where('user_id', auth()->user()->id);
|
||||||
|
|
||||||
|
if($cu->count() == 0)
|
||||||
|
return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400);
|
||||||
|
|
||||||
$truth = app()->make(TruthSource::class);
|
$truth = app()->make(TruthSource::class);
|
||||||
$truth->setCompanyUser($cu->first());
|
$truth->setCompanyUser($cu->first());
|
||||||
@ -441,6 +449,9 @@ class LoginController extends BaseController
|
|||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
->where('user_id', auth()->user()->id);
|
->where('user_id', auth()->user()->id);
|
||||||
|
|
||||||
|
if($cu->count() == 0)
|
||||||
|
return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400);
|
||||||
|
|
||||||
$truth = app()->make(TruthSource::class);
|
$truth = app()->make(TruthSource::class);
|
||||||
$truth->setCompanyUser($cu->first());
|
$truth->setCompanyUser($cu->first());
|
||||||
$truth->setUser($existing_login_user);
|
$truth->setUser($existing_login_user);
|
||||||
@ -496,6 +507,9 @@ class LoginController extends BaseController
|
|||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
->where('user_id', auth()->user()->id);
|
->where('user_id', auth()->user()->id);
|
||||||
|
|
||||||
|
if($cu->count() == 0)
|
||||||
|
return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400);
|
||||||
|
|
||||||
$truth = app()->make(TruthSource::class);
|
$truth = app()->make(TruthSource::class);
|
||||||
$truth->setCompanyUser($cu->first());
|
$truth->setCompanyUser($cu->first());
|
||||||
$truth->setUser($existing_login_user);
|
$truth->setUser($existing_login_user);
|
||||||
@ -555,6 +569,8 @@ class LoginController extends BaseController
|
|||||||
|
|
||||||
$cu = CompanyUser::whereUserId(auth()->user()->id);
|
$cu = CompanyUser::whereUserId(auth()->user()->id);
|
||||||
|
|
||||||
|
if($cu->count() == 0)
|
||||||
|
return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400);
|
||||||
|
|
||||||
$truth = app()->make(TruthSource::class);
|
$truth = app()->make(TruthSource::class);
|
||||||
$truth->setCompanyUser($cu->first());
|
$truth->setCompanyUser($cu->first());
|
||||||
|
@ -92,7 +92,6 @@ class NinjaPlanController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$data['intent'] = $setupIntent;
|
$data['intent'] = $setupIntent;
|
||||||
// $data['account'] = $account;
|
|
||||||
$data['client'] = Auth::guard('contact')->user()->client;
|
$data['client'] = Auth::guard('contact')->user()->client;
|
||||||
|
|
||||||
return $this->render('plan.trial', $data);
|
return $this->render('plan.trial', $data);
|
||||||
@ -139,6 +138,8 @@ class NinjaPlanController extends Controller
|
|||||||
$account = Account::where('key', auth()->guard('contact')->user()->client->custom_value2)->first();
|
$account = Account::where('key', auth()->guard('contact')->user()->client->custom_value2)->first();
|
||||||
$account->trial_started = now();
|
$account->trial_started = now();
|
||||||
$account->trial_plan = 'pro';
|
$account->trial_plan = 'pro';
|
||||||
|
$account->plan = 'pro';
|
||||||
|
$account->plan_expires = now()->addDays(14);
|
||||||
$account->save();
|
$account->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ class CompanyController extends BaseController
|
|||||||
'notifications' => CompanySettings::notificationDefaults(),
|
'notifications' => CompanySettings::notificationDefaults(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if(auth()->user()->company()->account->companies()->where('is_large', 1)->exists())
|
if($company->account->companies()->where('is_large', 1)->exists())
|
||||||
{
|
{
|
||||||
$company->account->companies()->update(['is_large' => true]);
|
$company->account->companies()->update(['is_large' => true]);
|
||||||
}
|
}
|
||||||
|
@ -38,9 +38,9 @@ class CreateAccountRequest extends Request
|
|||||||
{
|
{
|
||||||
|
|
||||||
if(Ninja::isHosted())
|
if(Ninja::isHosted())
|
||||||
$email_rules = ['required', 'email:rfc,dns', new NewUniqueUserRule, new BlackListRule, new EmailBlackListRule];
|
$email_rules = ['bail','required', 'email:rfc,dns', new NewUniqueUserRule, new BlackListRule, new EmailBlackListRule];
|
||||||
else
|
else
|
||||||
$email_rules = ['required', 'email:rfc,dns', new NewUniqueUserRule];
|
$email_rules = ['bail','required', 'email:rfc,dns', new NewUniqueUserRule];
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@ -192,7 +192,7 @@ class CompanyExport implements ShouldQueue
|
|||||||
|
|
||||||
})->all();
|
})->all();
|
||||||
|
|
||||||
$this->export_data['company_users'] = $this->company->company_users->map(function ($company_user){
|
$this->export_data['company_users'] = $this->company->company_users()->without(['user','account'])->cursor()->map(function ($company_user){
|
||||||
|
|
||||||
$company_user = $this->transformArrayOfKeys($company_user, ['company_id', 'account_id', 'user_id']);
|
$company_user = $this->transformArrayOfKeys($company_user, ['company_id', 'account_id', 'user_id']);
|
||||||
|
|
||||||
|
@ -490,6 +490,7 @@ class CompanyImport implements ShouldQueue
|
|||||||
|
|
||||||
foreach($this->company_properties as $value){
|
foreach($this->company_properties as $value){
|
||||||
|
|
||||||
|
if(property_exists($tmp_company, $value))
|
||||||
$this->company->{$value} = $tmp_company->{$value};
|
$this->company->{$value} = $tmp_company->{$value};
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1119,6 +1120,12 @@ class CompanyImport implements ShouldQueue
|
|||||||
unset($cu_array['id']);
|
unset($cu_array['id']);
|
||||||
unset($cu_array['company_id']);
|
unset($cu_array['company_id']);
|
||||||
unset($cu_array['user_id']);
|
unset($cu_array['user_id']);
|
||||||
|
unset($cu_array['user']);
|
||||||
|
unset($cu_array['account']);
|
||||||
|
|
||||||
|
// $cu_array['settings'] = json_encode($cu_array['settings']);
|
||||||
|
// $cu_array['notifications'] = json_encode($cu_array['notifications']);
|
||||||
|
// $cu_array['permissions'] = json_encode($cu_array['permissions']);
|
||||||
|
|
||||||
$new_cu = CompanyUser::withTrashed()->firstOrNew(
|
$new_cu = CompanyUser::withTrashed()->firstOrNew(
|
||||||
['user_id' => $user_id, 'company_id' => $this->company->id],
|
['user_id' => $user_id, 'company_id' => $this->company->id],
|
||||||
|
@ -111,7 +111,7 @@ class PaymentFailedMailer implements ShouldQueue
|
|||||||
|
|
||||||
//add client payment failures here.
|
//add client payment failures here.
|
||||||
//
|
//
|
||||||
if($contact = $this->client->primary_contact()->first() && $this->payment_hash)
|
if($contact = $this->client->contacts()->first() && $this->payment_hash)
|
||||||
{
|
{
|
||||||
|
|
||||||
$mail_obj = (new ClientPaymentFailureObject($this->client, $this->error, $this->company, $this->payment_hash))->build();
|
$mail_obj = (new ClientPaymentFailureObject($this->client, $this->error, $this->company, $this->payment_hash))->build();
|
||||||
|
@ -428,10 +428,13 @@ class Account extends BaseModel
|
|||||||
|
|
||||||
public function gmailCredentialNotification() :bool
|
public function gmailCredentialNotification() :bool
|
||||||
{
|
{
|
||||||
|
nlog("checking if gmail credential notification has already been sent");
|
||||||
|
|
||||||
if(is_null(Cache::get($this->key)))
|
if(is_null(Cache::get($this->key)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
nlog("Sending notification");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if(is_null(Cache::get("gmail_credentials_notified:{$this->key}"))) {
|
if(is_null(Cache::get("gmail_credentials_notified:{$this->key}"))) {
|
||||||
|
@ -43,38 +43,6 @@ class InvoiceInvitation extends BaseModel
|
|||||||
return self::class;
|
return self::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function getSignatureDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function getSentDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function getViewedDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function getOpenedDateAttribute($value)
|
|
||||||
// {
|
|
||||||
// if (!$value) {
|
|
||||||
// return (new Carbon($value))->format('Y-m-d');
|
|
||||||
// }
|
|
||||||
// return $value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function entityType()
|
public function entityType()
|
||||||
{
|
{
|
||||||
return Invoice::class;
|
return Invoice::class;
|
||||||
|
@ -253,7 +253,7 @@ class AuthorizeCreditCard
|
|||||||
$response = $data['response'];
|
$response = $data['response'];
|
||||||
$amount = array_key_exists('amount_with_fee', $data) ? $data['amount_with_fee'] : 0;
|
$amount = array_key_exists('amount_with_fee', $data) ? $data['amount_with_fee'] : 0;
|
||||||
|
|
||||||
$code = "Error";
|
$code = 1;
|
||||||
$description = "There was an error processing the payment";
|
$description = "There was an error processing the payment";
|
||||||
|
|
||||||
if ($response && $response->getErrors() != null) {
|
if ($response && $response->getErrors() != null) {
|
||||||
|
@ -185,7 +185,7 @@ class PayPalExpressPaymentDriver extends BaseDriver
|
|||||||
'currency' => $this->client->getCurrencyCode(),
|
'currency' => $this->client->getCurrencyCode(),
|
||||||
'transactionType' => 'Purchase',
|
'transactionType' => 'Purchase',
|
||||||
'clientIp' => request()->getClientIp(),
|
'clientIp' => request()->getClientIp(),
|
||||||
'amount' => $data['total']['amount_with_fee'] + $this->fee,
|
'amount' => round(($data['total']['amount_with_fee'] + $this->fee),2),
|
||||||
'returnUrl' => route('client.payments.response', [
|
'returnUrl' => route('client.payments.response', [
|
||||||
'company_gateway_id' => $this->company_gateway->id,
|
'company_gateway_id' => $this->company_gateway->id,
|
||||||
'payment_hash' => $this->payment_hash->hash,
|
'payment_hash' => $this->payment_hash->hash,
|
||||||
|
@ -85,6 +85,7 @@ class AccountTransformer extends EntityTransformer
|
|||||||
'is_migrated' => (bool) $account->is_migrated,
|
'is_migrated' => (bool) $account->is_migrated,
|
||||||
'hosted_client_count' => (int) $account->hosted_client_count,
|
'hosted_client_count' => (int) $account->hosted_client_count,
|
||||||
'hosted_company_count' => (int) $account->hosted_company_count,
|
'hosted_company_count' => (int) $account->hosted_company_count,
|
||||||
|
'is_hosted' => (bool) Ninja::isHosted(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@ trait GeneratesConvertedQuoteCounter
|
|||||||
}
|
}
|
||||||
|
|
||||||
$search = ['{$year}'];
|
$search = ['{$year}'];
|
||||||
$replace = [date('Y')];
|
$replace = [Carbon::now($entity->company->timezone()->name)->format('Y')];
|
||||||
|
|
||||||
$search[] = '{$counter}';
|
$search[] = '{$counter}';
|
||||||
$replace[] = $counter;
|
$replace[] = $counter;
|
||||||
@ -646,7 +646,7 @@ trait GeneratesConvertedQuoteCounter
|
|||||||
$replace[] = $counter;
|
$replace[] = $counter;
|
||||||
|
|
||||||
$search[] = '{$year}';
|
$search[] = '{$year}';
|
||||||
$replace[] = date('Y');
|
$replace[] = Carbon::now($entity->company->timezone()->name)->format('Y');
|
||||||
|
|
||||||
if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) {
|
if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) {
|
||||||
$user_id = $entity->user_id ? $entity->user_id : 0;
|
$user_id = $entity->user_id ? $entity->user_id : 0;
|
||||||
|
@ -642,8 +642,8 @@ trait GeneratesCounter
|
|||||||
return $counter;
|
return $counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
$search = ['{$year}'];
|
$search = [];
|
||||||
$replace = [date('Y')];
|
$replace = [];
|
||||||
|
|
||||||
$search[] = '{$counter}';
|
$search[] = '{$counter}';
|
||||||
$replace[] = $counter;
|
$replace[] = $counter;
|
||||||
@ -658,7 +658,7 @@ trait GeneratesCounter
|
|||||||
$replace[] = $counter;
|
$replace[] = $counter;
|
||||||
|
|
||||||
$search[] = '{$year}';
|
$search[] = '{$year}';
|
||||||
$replace[] = date('Y');
|
$replace[] = Carbon::now($entity->company->timezone()->name)->format('Y');
|
||||||
|
|
||||||
if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) {
|
if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) {
|
||||||
$user_id = $entity->user_id ? $entity->user_id : 0;
|
$user_id = $entity->user_id ? $entity->user_id : 0;
|
||||||
|
@ -14,8 +14,8 @@ return [
|
|||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||||
'app_version' => '5.3.84',
|
'app_version' => '5.3.85',
|
||||||
'app_tag' => '5.3.84',
|
'app_tag' => '5.3.85',
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', ''),
|
'api_secret' => env('API_SECRET', ''),
|
||||||
|
@ -888,7 +888,7 @@ $LANG = array(
|
|||||||
'custom_invoice_charges_helps' => 'Add a field when creating an invoice and include the charge in the invoice subtotals.',
|
'custom_invoice_charges_helps' => 'Add a field when creating an invoice and include the charge in the invoice subtotals.',
|
||||||
'token_expired' => 'Validation token was expired. Please try again.',
|
'token_expired' => 'Validation token was expired. Please try again.',
|
||||||
'invoice_link' => 'Invoice Link',
|
'invoice_link' => 'Invoice Link',
|
||||||
'button_confirmation_message' => 'Click to confirm your email.',
|
'button_confirmation_message' => 'Confirm your email.',
|
||||||
'confirm' => 'Confirm',
|
'confirm' => 'Confirm',
|
||||||
'email_preferences' => 'Email Preferences',
|
'email_preferences' => 'Email Preferences',
|
||||||
'created_invoices' => 'Successfully created :count invoice(s)',
|
'created_invoices' => 'Successfully created :count invoice(s)',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user