mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 11:04:41 -04:00
Merge pull request #4666 from beganovich/v5-show-only-credits-in-amount-exceed
(v5) Show "Apply credits" only
This commit is contained in:
commit
3e6f330643
@ -544,6 +544,14 @@ class Client extends BaseModel implements HasLocalePreference
|
||||
}
|
||||
|
||||
if (($this->getSetting('use_credits_payment') == 'option' || $this->getSetting('use_credits_payment') == 'always') && $this->service()->getCreditBalance() > 0) {
|
||||
|
||||
// Show credits as only payment option if both statements are true.
|
||||
if (
|
||||
$this->service()->getCreditBalance() > $amount
|
||||
&& $this->getSetting('use_credits_payment') == 'always') {
|
||||
$payment_urls = [];
|
||||
}
|
||||
|
||||
$payment_urls[] = [
|
||||
'label' => ctrans('texts.apply_credit'),
|
||||
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,
|
||||
|
Loading…
x
Reference in New Issue
Block a user