mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 14:14:44 -04:00
Disable gateway refund options for GoCardless
This commit is contained in:
parent
e7aedf1270
commit
654bf7a23f
@ -271,8 +271,10 @@ class CompanySettings extends BaseSettings
|
|||||||
public $use_credits_payment = 'off'; //always, option, off //@implemented
|
public $use_credits_payment = 'off'; //always, option, off //@implemented
|
||||||
public $hide_empty_columns_on_pdf = false;
|
public $hide_empty_columns_on_pdf = false;
|
||||||
public $email_from_name = '';
|
public $email_from_name = '';
|
||||||
|
public $auto_archive_invoice_cancelled = false;
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
|
'auto_archive_invoice_cancelled' => 'bool',
|
||||||
'email_from_name' => 'string',
|
'email_from_name' => 'string',
|
||||||
'show_all_tasks_client_portal' => 'string',
|
'show_all_tasks_client_portal' => 'string',
|
||||||
'entity_send_time' => 'int',
|
'entity_send_time' => 'int',
|
||||||
|
@ -107,6 +107,8 @@ class ClientController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function index(ClientFilters $filters)
|
public function index(ClientFilters $filters)
|
||||||
{
|
{
|
||||||
|
set_time_limit(45);
|
||||||
|
|
||||||
$clients = Client::filter($filters);
|
$clients = Client::filter($filters);
|
||||||
|
|
||||||
return $this->listResponse($clients);
|
return $this->listResponse($clients);
|
||||||
|
@ -119,6 +119,8 @@ class InvoiceController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function index(InvoiceFilters $filters)
|
public function index(InvoiceFilters $filters)
|
||||||
{
|
{
|
||||||
|
set_time_limit(45);
|
||||||
|
|
||||||
$invoices = Invoice::filter($filters);
|
$invoices = Invoice::filter($filters);
|
||||||
|
|
||||||
return $this->listResponse($invoices);
|
return $this->listResponse($invoices);
|
||||||
|
@ -569,8 +569,6 @@ class BaseImport
|
|||||||
'company' => $this->company,
|
'company' => $this->company,
|
||||||
];
|
];
|
||||||
|
|
||||||
nlog($this->company->company_users);
|
|
||||||
|
|
||||||
$nmo = new NinjaMailerObject;
|
$nmo = new NinjaMailerObject;
|
||||||
$nmo->mailable = new ImportCompleted($this->company, $data);
|
$nmo->mailable = new ImportCompleted($this->company, $data);
|
||||||
$nmo->company = $this->company;
|
$nmo->company = $this->company;
|
||||||
|
@ -159,7 +159,7 @@ class Gateway extends StaticModel
|
|||||||
break;
|
break;
|
||||||
case 52:
|
case 52:
|
||||||
return [
|
return [
|
||||||
GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => [' ']], // GoCardless
|
GatewayType::BANK_TRANSFER => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']], // GoCardless
|
||||||
GatewayType::DIRECT_DEBIT => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
GatewayType::DIRECT_DEBIT => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
||||||
GatewayType::SEPA => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
GatewayType::SEPA => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
||||||
GatewayType::INSTANT_BANK_PAY => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
GatewayType::INSTANT_BANK_PAY => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
||||||
|
@ -186,7 +186,7 @@ class PaymentRepository extends BaseRepository {
|
|||||||
|
|
||||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_MADE, $transaction, $payment->company->db);
|
TransactionLog::dispatch(TransactionEvent::PAYMENT_MADE, $transaction, $payment->company->db);
|
||||||
|
|
||||||
return $payment->fresh();
|
return $payment->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,6 +52,8 @@ class HandleCancellation extends AbstractService
|
|||||||
//adjust client balance
|
//adjust client balance
|
||||||
$this->invoice->client->service()->updateBalance($adjustment)->save();
|
$this->invoice->client->service()->updateBalance($adjustment)->save();
|
||||||
|
|
||||||
|
$this->invoice->service()->workFlow()->save();
|
||||||
|
|
||||||
event(new InvoiceWasCancelled($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new InvoiceWasCancelled($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
|
||||||
$transaction = [
|
$transaction = [
|
||||||
|
@ -546,6 +546,19 @@ class InvoiceService
|
|||||||
event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->invoice->status_id == Invoice::STATUS_CANCELLED && $this->invoice->client->getSetting('auto_archive_invoice_cancelled')) {
|
||||||
|
/* Throws: Payment amount xxx does not match invoice totals. */
|
||||||
|
|
||||||
|
if ($this->invoice->trashed())
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
$this->invoice->delete();
|
||||||
|
|
||||||
|
event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user