mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Padding out Company Gateways - Default gateways per company and per client
This commit is contained in:
parent
cc1997b390
commit
d02e62e46f
@ -82,6 +82,7 @@ class ClientSettings extends BaseSettings
|
||||
public $recurring_invoice_number_prefix;
|
||||
|
||||
public $counter_padding;
|
||||
public $default_gateway;
|
||||
|
||||
/**
|
||||
* Settings which which are unique to client settings
|
||||
@ -89,6 +90,7 @@ class ClientSettings extends BaseSettings
|
||||
public $industry_id;
|
||||
public $size_id;
|
||||
|
||||
|
||||
/**
|
||||
* Cast object values and return entire class
|
||||
* prevents missing properties from not being returned
|
||||
|
@ -111,6 +111,7 @@ class CompanySettings extends BaseSettings
|
||||
public $reset_counter_date;
|
||||
public $counter_padding;
|
||||
|
||||
public $default_gateway;
|
||||
/**
|
||||
* Cast object values and return entire class
|
||||
* prevents missing properties from not being returned
|
||||
|
@ -13,8 +13,8 @@ namespace App\Models;
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Models\Account;
|
||||
use App\Models\AccountGateway;
|
||||
use App\Models\Client;
|
||||
use App\Models\CompanyGateway;
|
||||
use App\Models\CompanyUser;
|
||||
use App\Models\Country;
|
||||
use App\Models\Currency;
|
||||
@ -122,9 +122,9 @@ class Company extends BaseModel
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function account_gateways()
|
||||
public function company_gateways()
|
||||
{
|
||||
return $this->hasMany(AccountGateway::class);
|
||||
return $this->hasMany(CompanyGateway::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,8 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Gateway;
|
||||
use App\Models\GatewayType;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CompanyGateway extends Model
|
||||
@ -29,4 +31,14 @@ class CompanyGateway extends Model
|
||||
{
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
public function gateway()
|
||||
{
|
||||
return $this->hasOne(Gateway::class);
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
return $this->hasOne(GatewayType::class);
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GatewayType extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
public function gateway()
|
||||
{
|
||||
|
@ -879,6 +879,11 @@ class CreateUsersTable extends Migration
|
||||
$table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('gateway_types', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('alias');
|
||||
$table->string('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call('CountriesSeeder');
|
||||
$this->call('IndustrySeeder');
|
||||
$this->call('PaymentTypesSeeder');
|
||||
$this->call('GatewaySeeder');
|
||||
$this->call('GatewayTypesSeeder');
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\GatewayType;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class GatewayTypesSeeder extends Seeder
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user