From e7b8a64f2841c5ba9e31d07017e1f6f92c6db313 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 22 Jan 2017 21:32:54 +0200 Subject: [PATCH] Merge fix to prevent marking quotes as paid --- app/Ninja/Datatables/InvoiceDatatable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Ninja/Datatables/InvoiceDatatable.php b/app/Ninja/Datatables/InvoiceDatatable.php index 66b02bd8a6..29771fad12 100644 --- a/app/Ninja/Datatables/InvoiceDatatable.php +++ b/app/Ninja/Datatables/InvoiceDatatable.php @@ -122,8 +122,8 @@ class InvoiceDatatable extends EntityDatatable function ($model) use ($entityType) { return "javascript:submitForm_{$entityType}('markPaid', {$model->public_id})"; }, - function ($model) { - return $model->is_public && $model->balance > 0 && Auth::user()->can('editByOwner', [ENTITY_INVOICE, $model->user_id]); + function ($model) use ($entityType) { + return $entityType == ENTITY_INVOICE && $model->balance > 0 && Auth::user()->can('editByOwner', [ENTITY_INVOICE, $model->user_id]); } ], [