mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add back credit options
This commit is contained in:
parent
fb6779095b
commit
9f1efeba99
@ -180,6 +180,21 @@ class PaymentMethod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (($this->client->getSetting('use_credits_payment') == 'option' || $this->client->getSetting('use_credits_payment') == 'always') && $this->client->service()->getCreditBalance() > 0) {
|
||||||
|
// Show credits as only payment option if both statements are true.
|
||||||
|
if (
|
||||||
|
$this->client->service()->getCreditBalance() > $this->amount
|
||||||
|
&& $this->client->getSetting('use_credits_payment') == 'always') {
|
||||||
|
$payment_urls = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->payment_urls[] = [
|
||||||
|
'label' => ctrans('texts.apply_credit'),
|
||||||
|
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,
|
||||||
|
'gateway_type_id' => GatewayType::CREDIT,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user