mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Enable viewing draft invoices with link
This commit is contained in:
parent
7a2ff46c89
commit
dc763eb6f7
@ -192,7 +192,7 @@ class InvoiceController extends BaseController
|
||||
}
|
||||
|
||||
// Set the invitation data on the client's contacts
|
||||
if ($invoice->is_public && ! $clone) {
|
||||
if ( ! $clone) {
|
||||
$clients = $data['clients'];
|
||||
foreach ($clients as $client) {
|
||||
if ($client->id != $invoice->client->id) {
|
||||
|
@ -550,7 +550,7 @@ class Invoice extends EntityModel implements BalanceAffecting
|
||||
|
||||
public function canBePaid()
|
||||
{
|
||||
return floatval($this->balance) > 0 && ! $this->is_deleted && $this->isInvoice();
|
||||
return floatval($this->balance) > 0 && ! $this->is_deleted && $this->isInvoice() && $this->is_public;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -797,7 +797,7 @@ class InvoiceRepository extends BaseRepository
|
||||
}
|
||||
|
||||
$invoice = $invitation->invoice;
|
||||
if (!$invoice || $invoice->is_deleted || ! $invoice->is_public) {
|
||||
if (!$invoice || $invoice->is_deleted) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,8 @@
|
||||
@if ($showApprove)
|
||||
{!! Button::success(trans('texts.approve'))->asLinkTo(URL::to('/approve/' . $invitation->invitation_key))->large() !!}
|
||||
@endif
|
||||
@elseif ( ! $invoice->canBePaid())
|
||||
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
|
||||
@elseif ($invoice->client->account->isGatewayConfigured() && floatval($invoice->balance) && !$invoice->is_recurring)
|
||||
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
|
||||
@if (count($paymentTypes) > 1)
|
||||
|
Loading…
Reference in New Issue
Block a user