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

Working on fees

This commit is contained in:
David Bomba 2020-08-28 11:06:46 +10:00
parent a5248f7a93
commit 36c54d8cc3
5 changed files with 22 additions and 5 deletions

View File

@ -238,8 +238,13 @@ class CompanySettings extends BaseSettings
public $client_portal_terms = '';
public $client_portal_privacy_policy = '';
public $client_portal_enable_uploads = false;
public $client_portal_allow_under_payment = false;
public $client_portal_allow_over_payment = false;
public static $casts = [
'client_portal_allow_under_payment' => 'bool',
'client_portal_allow_over_payment' => 'bool',
'auto_bill' => 'string',
'lock_invoices' => 'string',
'client_portal_terms' => 'string',

View File

@ -31,7 +31,6 @@ class MigrationController extends BaseController
parent::__construct();
}
/**
*
* Purge Company

View File

@ -227,6 +227,14 @@ class Import implements ShouldQueue
unset($data['account_id']);
}
if(isset($data['referral_code'])) {
$account = $this->company->account;
$account->referral_code = $data['referral_code'];
$account->save();
unset($data['referral_code']);
}
$company_repository = new CompanyRepository();
$company_repository->save($data, $this->company);

View File

@ -201,7 +201,12 @@ class CompanyGateway extends BaseModel
return floatval($this->fee_amount) || floatval($this->fee_percent);
}
public function isTestMode()
/**
* Returns the current test mode of the gateway
*
* @return boolean whether the gateway is in testmode or not.
*/
public function isTestMode() :bool
{
$config = $this->getConfig();

View File

@ -47,9 +47,9 @@ class AddIsPublicToDocumentsTable extends Migration
$table->string('auto_bill');
});
Schema::table('recurring_expenses', function ($table) {
$table->table('auto_bill');
});
// Schema::table('recurring_expenses', function ($table) {
// $table->string('auto_bill');
// });
Schema::table('companies', function ($table) {
$table->enum('default_auto_bill', ['off', 'always','optin','optout'])->default('off');