1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00

Merge pull request #7296 from turbo124/v5-stable

v5.3.70
This commit is contained in:
David Bomba 2022-03-17 15:50:20 +11:00 committed by GitHub
commit 3beb454d4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 16 deletions

View File

@ -1 +1 @@
5.3.69 5.3.70

View File

@ -189,12 +189,11 @@ class DocumentController extends BaseController
*/ */
$documents->each(function ($document, $key) use ($action) { $documents->each(function ($document, $key) use ($action) {
if (auth()->user()->can('edit', $document)) { if (auth()->user()->can('edit', $document)) {
$this->{$action}($document); $this->document_repo->{$action}($document);
} }
}); });
/* Need to understand which permission are required for the given bulk action ie. view / edit */ /* Need to understand which permission are required for the given bulk action ie. view / edit */
return $this->listResponse(Document::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()); return $this->listResponse(Document::withTrashed()->whereIn('id', $this->transformKeys($ids))->company());
} }
} }

View File

@ -676,7 +676,7 @@ class QuoteController extends BaseController
return response()->json(['message' => ctrans('texts.quote_unapprovable')], 400); return response()->json(['message' => ctrans('texts.quote_unapprovable')], 400);
} }
return $this->itemResponse($quote->service()->approve()->save()); return $this->itemResponse($quote->service()->approveWithNoCoversion()->save());
break; break;
case 'history': case 'history':
// code... // code...

View File

@ -19,6 +19,7 @@ use App\Utils\Ninja;
*/ */
class DocumentRepository extends BaseRepository class DocumentRepository extends BaseRepository
{ {
public function delete($document) public function delete($document)
{ {
$document->deleteFile(); $document->deleteFile();
@ -27,14 +28,18 @@ class DocumentRepository extends BaseRepository
public function restore($document) public function restore($document)
{ {
if (! $document->trashed()) { return;
return; // if (! $document->trashed()) {
} // return;
$document->restore();
// if (class_exists($className)) {
// event(new $className($document, $document->company, Ninja::eventVars()));
// } // }
// $document->restore();
} }
public function archive($document)
{
return;
}
} }

View File

@ -185,6 +185,10 @@ class TaskRepository extends BaseRepository
public function start(Task $task) public function start(Task $task)
{ {
//do no allow an task to be restarted if it has been invoiced
if($task->invoice_id)
return;
if(strlen($task->time_log) < 5) if(strlen($task->time_log) < 5)
{ {
$log = []; $log = [];

View File

@ -126,6 +126,21 @@ class QuoteService
return $this; return $this;
} }
public function approveWithNoCoversion($contact = null) :self
{
$this->setStatus(Quote::STATUS_APPROVED)->save();
if (!$contact) {
$contact = $this->quote->invitations->first()->contact;
}
event(new QuoteWasApproved($contact, $this->quote, $this->quote->company, Ninja::eventVars()));
return $this;
}
public function convertToInvoice() public function convertToInvoice()
{ {

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.3.69', 'app_version' => '5.3.70',
'app_tag' => '5.3.69', 'app_tag' => '5.3.70',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),

View File

@ -4,7 +4,7 @@
@keydown.window.escape="sidebarOpen = false" @keydown.window.escape="sidebarOpen = false"
id="main-sidebar"> id="main-sidebar">
@if($settings->enable_client_portal) @if($settings && $settings->enable_client_portal)
<!-- Off-canvas menu for mobile --> <!-- Off-canvas menu for mobile -->
@include('portal.ninja2020.components.general.sidebar.mobile') @include('portal.ninja2020.components.general.sidebar.mobile')
@ -15,7 +15,7 @@
@endif @endif
<div class="flex flex-col w-0 flex-1 overflow-hidden"> <div class="flex flex-col w-0 flex-1 overflow-hidden">
@if($settings->enable_client_portal) @if($settings && $settings->enable_client_portal)
@include('portal.ninja2020.components.general.sidebar.header') @include('portal.ninja2020.components.general.sidebar.header')
@endif @endif