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

Fixes for billing subscriptions

This commit is contained in:
David Bomba 2021-03-10 09:56:59 +11:00
parent ae8cf3b06a
commit e0b169b64b
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']);
});