mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Enable viewing draft invoices with link
This commit is contained in:
parent
b34c5724de
commit
854b13de19
@ -194,7 +194,7 @@ class InvoiceController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the invitation data on the client's contacts
|
// Set the invitation data on the client's contacts
|
||||||
if ($invoice->is_public && ! $clone) {
|
if ( ! $clone) {
|
||||||
$clients = $data['clients'];
|
$clients = $data['clients'];
|
||||||
foreach ($clients as $client) {
|
foreach ($clients as $client) {
|
||||||
if ($client->id != $invoice->client->id) {
|
if ($client->id != $invoice->client->id) {
|
||||||
|
@ -196,7 +196,7 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
if ($this->getRawAdjustment() != 0) {
|
if ($this->getRawAdjustment() != 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ([
|
foreach ([
|
||||||
'invoice_number',
|
'invoice_number',
|
||||||
'po_number',
|
'po_number',
|
||||||
@ -566,7 +566,7 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
|
|
||||||
public function canBePaid()
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function calcStatusLabel($status, $class, $entityType, $quoteInvoiceId)
|
public static function calcStatusLabel($status, $class, $entityType, $quoteInvoiceId)
|
||||||
|
@ -797,7 +797,7 @@ class InvoiceRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
$invoice = $invitation->invoice;
|
$invoice = $invitation->invoice;
|
||||||
if (!$invoice || $invoice->is_deleted || ! $invoice->is_public) {
|
if (!$invoice || $invoice->is_deleted) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,6 +116,8 @@
|
|||||||
@if ($showApprove)
|
@if ($showApprove)
|
||||||
{!! Button::success(trans('texts.approve'))->asLinkTo(URL::to('/approve/' . $invitation->invitation_key))->large() !!}
|
{!! Button::success(trans('texts.approve'))->asLinkTo(URL::to('/approve/' . $invitation->invitation_key))->large() !!}
|
||||||
@endif
|
@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)
|
@elseif ($invoice->client->account->isGatewayConfigured() && floatval($invoice->balance) && !$invoice->is_recurring)
|
||||||
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
|
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
|
||||||
@if (count($paymentTypes) > 1)
|
@if (count($paymentTypes) > 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user