From ed2952356c91d1aca85f83db3ff0aba617b9d7d3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 11 Mar 2022 08:13:27 +1100 Subject: [PATCH] Approve quote --- app/Http/Controllers/InvoiceController.php | 2 +- app/Http/Controllers/QuoteController.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 4dd93d9c0166..bbd80dca4826 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -685,7 +685,7 @@ class InvoiceController extends BaseController return $this->errorResponse(['message' => ctrans('texts.invoice_cannot_be_marked_paid')], 400); } - $invoice = $invoice->service()->markPaid(); + $invoice = $invoice->service()->markPaid()->save(); if (! $bulk) { return $this->itemResponse($invoice); diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index 6f14b3a18b48..9d06d208608c 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -672,8 +672,7 @@ class QuoteController extends BaseController return $this->itemResponse($quote); break; case 'approve': - //make sure it hasn't already been approved!! - if ($quote->status_id != Quote::STATUS_SENT) { + if (!in_array($quote->status_id, [Quote::STATUS_SENT, Quote::STATUS_DRAFT]) ) { return response()->json(['message' => ctrans('texts.quote_unapprovable')], 400); }