mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 16:31:33 +02: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,
|
||||
'logo' => $this->company->present()->logo(),
|
||||
'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[] = [
|
||||
'label' => ctrans('texts.apply_credit'),
|
||||
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,
|
||||
|
@ -74,8 +74,15 @@ 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();
|
||||
|
||||
return $this->credit;
|
||||
|
@ -126,7 +126,10 @@ class AutoBillInvoice extends AbstractService
|
||||
{
|
||||
$current_credit = Credit::find($credit['credit_id']);
|
||||
$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()
|
||||
|
Loading…
Reference in New Issue
Block a user