mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for whitelabel getter
This commit is contained in:
parent
c1e080acd5
commit
90494547c5
@ -93,7 +93,7 @@ class UserEmailChanged extends BaseMailerJob implements ShouldQueue
|
|||||||
'signature' => $this->company->owner()->signature,
|
'signature' => $this->company->owner()->signature,
|
||||||
'logo' => $this->company->present()->logo(),
|
'logo' => $this->company->present()->logo(),
|
||||||
'settings' => $this->settings,
|
'settings' => $this->settings,
|
||||||
'whitelabel' => $this->client->user->account->isPaid() ? true : false,
|
'whitelabel' => $this->company->account->isPaid() ? true : false,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,7 +524,7 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->company->use_credits_payment == 'option' && $this->service()->getCreditBalance() > 0) {
|
if(($this->company->use_credits_payment == 'option' || $this->company->use_credits_payment == 'always') && $this->service()->getCreditBalance() > 0) {
|
||||||
$payment_urls[] = [
|
$payment_urls[] = [
|
||||||
'label' => ctrans('texts.apply_credit'),
|
'label' => ctrans('texts.apply_credit'),
|
||||||
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,
|
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,
|
||||||
|
@ -74,7 +74,14 @@ class ApplyPayment
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->applyPaymentToCredit();
|
$this->credit->balance -= $this->amount_applied;
|
||||||
|
|
||||||
|
if((int)$this->credit->balance == 0)
|
||||||
|
$this->credit->status_id = Credit::STATUS_APPLIED;
|
||||||
|
else
|
||||||
|
$this->credit->status_id = Credit::STATUS_PARTIAL;
|
||||||
|
|
||||||
|
$this->credit->save();
|
||||||
|
|
||||||
$this->addPaymentToLedger();
|
$this->addPaymentToLedger();
|
||||||
|
|
||||||
|
@ -126,7 +126,10 @@ class AutoBillInvoice extends AbstractService
|
|||||||
{
|
{
|
||||||
$current_credit = Credit::find($credit['credit_id']);
|
$current_credit = Credit::find($credit['credit_id']);
|
||||||
$payment->credits()->attach($current_credit->id, ['amount' => $credit['amount']]);
|
$payment->credits()->attach($current_credit->id, ['amount' => $credit['amount']]);
|
||||||
$this->applyPaymentToCredit($current_credit, $credit['amount']);
|
|
||||||
|
$current_credit->balance -= $credit['amount'];
|
||||||
|
$current_credit->save();
|
||||||
|
// $this->applyPaymentToCredit($current_credit, $credit['amount']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$payment->ledger()
|
$payment->ledger()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user