mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Make recurring invoice editable again #1840
This commit is contained in:
parent
746c3fe69a
commit
6c105d5978
@ -1642,6 +1642,14 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isLocked()
|
||||||
|
{
|
||||||
|
if (! config('ninja.lock_sent_invoices')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->isSent() && ! $this->is_recurring;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Invoice::creating(function ($invoice) {
|
Invoice::creating(function ($invoice) {
|
||||||
|
@ -403,7 +403,7 @@ class InvoiceRepository extends BaseRepository
|
|||||||
|
|
||||||
if ($invoice->is_deleted) {
|
if ($invoice->is_deleted) {
|
||||||
return $invoice;
|
return $invoice;
|
||||||
} elseif ($invoice->isSent() && config('ninja.lock_sent_invoices')) {
|
} elseif ($invoice->isLocked()) {
|
||||||
return $invoice;
|
return $invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@
|
|||||||
@if (Auth::user()->canCreateOrEdit(ENTITY_INVOICE, $invoice))
|
@if (Auth::user()->canCreateOrEdit(ENTITY_INVOICE, $invoice))
|
||||||
@if ($invoice->isClientTrashed())
|
@if ($invoice->isClientTrashed())
|
||||||
<!-- do nothing -->
|
<!-- do nothing -->
|
||||||
@elseif ($invoice->isSent() && config('ninja.lock_sent_invoices'))
|
@elseif ($invoice->isLocked())
|
||||||
@if (! $invoice->trashed())
|
@if (! $invoice->trashed())
|
||||||
{!! Button::info(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'emailButton', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!}
|
{!! Button::info(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'emailButton', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!}
|
||||||
{!! DropdownButton::normal(trans('texts.more_actions'))->withContents($invoice->present()->moreActions())->dropup() !!}
|
{!! DropdownButton::normal(trans('texts.more_actions'))->withContents($invoice->present()->moreActions())->dropup() !!}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user