mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 02:57:33 -05:00 
			
		
		
		
	
						commit
						dcd5e878a8
					
				@ -1 +1 @@
 | 
			
		||||
5.3.84
 | 
			
		||||
5.3.85
 | 
			
		||||
@ -217,6 +217,9 @@ class LoginController extends BaseController
 | 
			
		||||
            $cu = CompanyUser::query()
 | 
			
		||||
                  ->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->setCompanyUser($cu->first());
 | 
			
		||||
@ -320,6 +323,9 @@ class LoginController extends BaseController
 | 
			
		||||
        $cu = CompanyUser::query()
 | 
			
		||||
                          ->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){
 | 
			
		||||
 | 
			
		||||
            if($company->tokens()->where('is_system', true)->count() == 0)
 | 
			
		||||
@ -390,6 +396,8 @@ class LoginController extends BaseController
 | 
			
		||||
                $cu = CompanyUser::query()
 | 
			
		||||
                                  ->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->setCompanyUser($cu->first());
 | 
			
		||||
@ -441,6 +449,9 @@ class LoginController extends BaseController
 | 
			
		||||
                $cu = CompanyUser::query()
 | 
			
		||||
                                  ->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->setCompanyUser($cu->first());
 | 
			
		||||
                    $truth->setUser($existing_login_user);
 | 
			
		||||
@ -496,6 +507,9 @@ class LoginController extends BaseController
 | 
			
		||||
                $cu = CompanyUser::query()
 | 
			
		||||
                                  ->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->setCompanyUser($cu->first());
 | 
			
		||||
                $truth->setUser($existing_login_user);
 | 
			
		||||
@ -555,6 +569,8 @@ class LoginController extends BaseController
 | 
			
		||||
 | 
			
		||||
            $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->setCompanyUser($cu->first());
 | 
			
		||||
 | 
			
		||||
@ -92,7 +92,6 @@ class NinjaPlanController extends Controller
 | 
			
		||||
        ]);
 | 
			
		||||
 | 
			
		||||
        $data['intent'] = $setupIntent;
 | 
			
		||||
        // $data['account'] = $account;
 | 
			
		||||
        $data['client'] =  Auth::guard('contact')->user()->client;
 | 
			
		||||
 | 
			
		||||
        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->trial_started = now();
 | 
			
		||||
            $account->trial_plan = 'pro';
 | 
			
		||||
            $account->plan = 'pro';
 | 
			
		||||
            $account->plan_expires = now()->addDays(14);
 | 
			
		||||
            $account->save();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -232,7 +232,7 @@ class CompanyController extends BaseController
 | 
			
		||||
            '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]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -38,9 +38,9 @@ class CreateAccountRequest extends Request
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        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
 | 
			
		||||
            $email_rules = ['required', 'email:rfc,dns', new NewUniqueUserRule];
 | 
			
		||||
            $email_rules = ['bail','required', 'email:rfc,dns', new NewUniqueUserRule];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        return [
 | 
			
		||||
 | 
			
		||||
@ -192,7 +192,7 @@ class CompanyExport implements ShouldQueue
 | 
			
		||||
 | 
			
		||||
        })->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']);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -490,6 +490,7 @@ class CompanyImport implements ShouldQueue
 | 
			
		||||
 | 
			
		||||
        foreach($this->company_properties as $value){
 | 
			
		||||
 | 
			
		||||
            if(property_exists($tmp_company, $value))
 | 
			
		||||
                $this->company->{$value} = $tmp_company->{$value};    
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
@ -1119,6 +1120,12 @@ class CompanyImport implements ShouldQueue
 | 
			
		||||
            unset($cu_array['id']);
 | 
			
		||||
            unset($cu_array['company_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(
 | 
			
		||||
                ['user_id' => $user_id, 'company_id' => $this->company->id],
 | 
			
		||||
 | 
			
		||||
@ -111,7 +111,7 @@ class PaymentFailedMailer implements ShouldQueue
 | 
			
		||||
 | 
			
		||||
        //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();
 | 
			
		||||
 | 
			
		||||
@ -428,10 +428,13 @@ class Account extends BaseModel
 | 
			
		||||
 | 
			
		||||
    public function gmailCredentialNotification() :bool
 | 
			
		||||
    {
 | 
			
		||||
        nlog("checking if gmail credential notification has already been sent");
 | 
			
		||||
 | 
			
		||||
        if(is_null(Cache::get($this->key)))
 | 
			
		||||
            return false;
 | 
			
		||||
 | 
			
		||||
        nlog("Sending notification");
 | 
			
		||||
        
 | 
			
		||||
        try {
 | 
			
		||||
 | 
			
		||||
            if(is_null(Cache::get("gmail_credentials_notified:{$this->key}"))) {
 | 
			
		||||
 | 
			
		||||
@ -43,38 +43,6 @@ class InvoiceInvitation extends BaseModel
 | 
			
		||||
        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()
 | 
			
		||||
    {
 | 
			
		||||
        return Invoice::class;
 | 
			
		||||
 | 
			
		||||
@ -253,7 +253,7 @@ class AuthorizeCreditCard
 | 
			
		||||
        $response = $data['response'];
 | 
			
		||||
        $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";
 | 
			
		||||
 | 
			
		||||
        if ($response && $response->getErrors() != null) {
 | 
			
		||||
 | 
			
		||||
@ -185,7 +185,7 @@ class PayPalExpressPaymentDriver extends BaseDriver
 | 
			
		||||
            'currency' => $this->client->getCurrencyCode(),
 | 
			
		||||
            'transactionType' => 'Purchase',
 | 
			
		||||
            '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', [
 | 
			
		||||
                'company_gateway_id' => $this->company_gateway->id,
 | 
			
		||||
                'payment_hash' => $this->payment_hash->hash,
 | 
			
		||||
 | 
			
		||||
@ -85,6 +85,7 @@ class AccountTransformer extends EntityTransformer
 | 
			
		||||
            'is_migrated' => (bool) $account->is_migrated,
 | 
			
		||||
            'hosted_client_count' => (int) $account->hosted_client_count,
 | 
			
		||||
            'hosted_company_count' => (int) $account->hosted_company_count,
 | 
			
		||||
            'is_hosted' => (bool) Ninja::isHosted(),
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -631,7 +631,7 @@ trait GeneratesConvertedQuoteCounter
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $search = ['{$year}'];
 | 
			
		||||
        $replace = [date('Y')];
 | 
			
		||||
        $replace = [Carbon::now($entity->company->timezone()->name)->format('Y')];
 | 
			
		||||
 | 
			
		||||
        $search[] = '{$counter}';
 | 
			
		||||
        $replace[] = $counter;
 | 
			
		||||
@ -646,7 +646,7 @@ trait GeneratesConvertedQuoteCounter
 | 
			
		||||
        $replace[] = $counter;
 | 
			
		||||
 | 
			
		||||
        $search[] = '{$year}';
 | 
			
		||||
        $replace[] = date('Y');
 | 
			
		||||
        $replace[] = Carbon::now($entity->company->timezone()->name)->format('Y');
 | 
			
		||||
                
 | 
			
		||||
        if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) {
 | 
			
		||||
            $user_id = $entity->user_id ? $entity->user_id : 0;
 | 
			
		||||
 | 
			
		||||
@ -642,8 +642,8 @@ trait GeneratesCounter
 | 
			
		||||
            return $counter;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $search = ['{$year}'];
 | 
			
		||||
        $replace = [date('Y')];
 | 
			
		||||
        $search = [];
 | 
			
		||||
        $replace = [];
 | 
			
		||||
        
 | 
			
		||||
        $search[] = '{$counter}';
 | 
			
		||||
        $replace[] = $counter;
 | 
			
		||||
@ -658,7 +658,7 @@ trait GeneratesCounter
 | 
			
		||||
        $replace[] = $counter;
 | 
			
		||||
 | 
			
		||||
        $search[] = '{$year}';
 | 
			
		||||
        $replace[] = date('Y');
 | 
			
		||||
        $replace[] = Carbon::now($entity->company->timezone()->name)->format('Y');
 | 
			
		||||
        
 | 
			
		||||
        if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) {
 | 
			
		||||
            $user_id = $entity->user_id ? $entity->user_id : 0;
 | 
			
		||||
 | 
			
		||||
@ -14,8 +14,8 @@ return [
 | 
			
		||||
    'require_https' => env('REQUIRE_HTTPS', true),
 | 
			
		||||
    'app_url' => rtrim(env('APP_URL', ''), '/'),
 | 
			
		||||
    'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
 | 
			
		||||
    'app_version' => '5.3.84',
 | 
			
		||||
    'app_tag' => '5.3.84',
 | 
			
		||||
    'app_version' => '5.3.85',
 | 
			
		||||
    'app_tag' => '5.3.85',
 | 
			
		||||
    'minimum_client_version' => '5.0.16',
 | 
			
		||||
    'terms_version' => '1.0.1',
 | 
			
		||||
    '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.',
 | 
			
		||||
    'token_expired' => 'Validation token was expired. Please try again.',
 | 
			
		||||
    'invoice_link' => 'Invoice Link',
 | 
			
		||||
    'button_confirmation_message' => 'Click to confirm your email.',
 | 
			
		||||
    'button_confirmation_message' => 'Confirm your email.',
 | 
			
		||||
    'confirm' => 'Confirm',
 | 
			
		||||
    'email_preferences' => 'Email Preferences',
 | 
			
		||||
    'created_invoices' => 'Successfully created :count invoice(s)',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user