1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00

Merge pull request #5083 from turbo124/v5-develop

Fixes for billing subscriptions
This commit is contained in:
David Bomba 2021-03-10 09:57:26 +11:00 committed by GitHub
commit c863a2defd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 3 deletions

View File

@ -13,12 +13,18 @@ namespace App\Http\Controllers;
use App\Libraries\MultiDB;
use App\Libraries\OAuth\Providers\Google;
use Illuminate\Http\Request;
use App\Models\CompanyUser;
use App\Transformers\CompanyUserTransformer;
use Google_Client;
use Illuminate\Http\Request;
class ConnectedAccountController extends BaseController
{
protected $entity_type = CompanyUser::class;
protected $entity_transformer = CompanyUserTransformer::class;
public function __construct()
{
parent::__construct();
@ -128,8 +134,10 @@ class ConnectedAccountController extends BaseController
auth()->user()->save();
//$ct = CompanyUser::whereUserId(auth()->user()->id);
$ct = CompanyUser::whereUserId(auth()->user()->id);
return $this->listResponse(auth()->user());
return $this->listResponse($ct);
// return $this->listResponse(auth()->user());
}
return response()

View File

@ -16,6 +16,7 @@
* @OA\Property(property="is_amount_discount", type="boolean", example="true", description="______"),
* @OA\Property(property="allow_cancellation", type="boolean", example="true", description="______"),
* @OA\Property(property="per_seat_enabled", type="boolean", example="true", description="______"),
* @OA\Property(property="currency_id", type="integer", example="1", description="______"),
* @OA\Property(property="min_seats_limit", type="integer", example="1", description="______"),
* @OA\Property(property="max_seats_limit", type="integer", example="100", description="______"),
* @OA\Property(property="trial_enabled", type="boolean", example="true", description="______"),

View File

@ -155,6 +155,7 @@ class SetupController extends Controller
return redirect('/');
} catch (Exception $e) {
nlog($e->getMessage());
return redirect()

View File

@ -39,7 +39,7 @@ class CreateBillingSubscriptionsTable extends Migration
$table->softDeletes('deleted_at', 6);
$table->boolean('is_deleted')->default(false);
$table->timestamps();
$table->foreign('product_id')->references('id')->on('products');
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->index(['company_id', 'deleted_at']);
});