mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:44:28 -04:00
add helper for Invoice payable amount
This commit is contained in:
parent
4b3e09faf8
commit
f7ff5d34df
@ -498,6 +498,20 @@ class Invoice extends BaseModel
|
|||||||
return $this->calc()->getTotal();
|
return $this->calc()->getTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPayableAmount()
|
||||||
|
{
|
||||||
|
if($this->partial > 0)
|
||||||
|
return $this->partial;
|
||||||
|
|
||||||
|
if($this->balance > 0)
|
||||||
|
return $this->balance;
|
||||||
|
|
||||||
|
if($this->status_id = 1)
|
||||||
|
return $this->amount;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public function entityEmailEvent($invitation, $reminder_template, $template)
|
public function entityEmailEvent($invitation, $reminder_template, $template)
|
||||||
{
|
{
|
||||||
switch ($reminder_template) {
|
switch ($reminder_template) {
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
@if($settings->client_portal_allow_under_payment || $settings->client_portal_allow_over_payment)
|
@if($settings->client_portal_allow_under_payment || $settings->client_portal_allow_over_payment)
|
||||||
<button class="button button-primary bg-primary">{{ ctrans('texts.pay_now') }}</button>
|
<button class="button button-primary bg-primary">{{ ctrans('texts.pay_now') }}</button>
|
||||||
@else
|
@else
|
||||||
@livewire('pay-now-dropdown', ['total' => $invoice->partial > 0 ? $invoice->partial : $invoice->balance, 'company' => $company])
|
@livewire('pay-now-dropdown', ['total' => $invoice->getPayableAmount(), 'company' => $company])
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user