1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00

Only show Bluevine to primary account

This commit is contained in:
Hillel Coren 2017-01-01 13:11:09 +02:00
parent 76ff810c42
commit 43b7c43e7c
2 changed files with 8 additions and 6 deletions

View File

@ -61,8 +61,9 @@ class BlueVineController extends BaseController {
}
}
$user->account->bluevine_status = 'signed_up';
$user->account->save();
$account = $user->primaryAccount();
$account->bluevine_status = 'signed_up';
$account->save();
$quote_data = json_decode( $response->getBody() );
@ -73,8 +74,9 @@ class BlueVineController extends BaseController {
$user = Auth::user();
if ( $user ) {
$user->account->bluevine_status = 'ignored';
$user->account->save();
$account = $user->primaryAccount();
$account->bluevine_status = 'ignored';
$account->save();
}
return 'success';
@ -85,4 +87,4 @@ class BlueVineController extends BaseController {
return Redirect::to( '/dashboard' );
}
}
}

View File

@ -43,7 +43,7 @@ class DashboardController extends BaseController
$expenses = $dashboardRepo->expenses($accountId, $userId, $viewAll);
$tasks = $dashboardRepo->tasks($accountId, $userId, $viewAll);
$showBlueVinePromo = ! $account->bluevine_status
$showBlueVinePromo = ! $user->primaryAccount()->bluevine_status
&& env('BLUEVINE_PARTNER_UNIQUE_ID')
&& $account->created_at <= date( 'Y-m-d', strtotime( '-1 month' ));