From 62c4275660507454008703ab70a5941f505b2e19 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 14 Feb 2018 18:09:05 +0200 Subject: [PATCH] Can't mark paid/enter payment on locked invoices #1801 --- app/Http/Controllers/InvoiceController.php | 12 ++++++++---- resources/views/invoices/edit.blade.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 01594fa5a89b..814ff3140bd7 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -372,10 +372,14 @@ class InvoiceController extends BaseController $action = Input::get('action'); $entityType = Input::get('entityType'); - $invoice = $this->invoiceService->save($data, $request->entity()); - $entityType = $invoice->getEntityType(); - $message = trans("texts.updated_{$entityType}"); - Session::flash('message', $message); + if (config('ninja.lock_sent_invoices')) { + $invoice = $request->entity(); + } else { + $invoice = $this->invoiceService->save($data, $request->entity()); + $entityType = $invoice->getEntityType(); + $message = trans("texts.updated_{$entityType}"); + Session::flash('message', $message); + } if ($action == 'clone_invoice') { return url(sprintf('invoices/%s/clone', $invoice->public_id)); diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index b77d4becedb8..11ca1e1fb67e 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -536,8 +536,8 @@ @elseif ($invoice->isSent() && config('ninja.lock_sent_invoices')) @if (! $invoice->trashed()) {!! 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() !!} @endif - @else @if (!$invoice->is_deleted) @if ($invoice->isSent())