diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index d2804c943..585deebab 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -311,6 +311,12 @@ class BaseController extends Controller public function flutterRoute() { + + // // Ensure all request are over HTTPS in production + // if (! request()->secure()) { + // return redirect()->secure(request()->path()); + // } + if ((bool)$this->checkAppSetup() !== false) { $data = []; diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 84a0e1f37..d8abfe9ca 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -45,6 +45,8 @@ class StartupCheck Session::flash('message', 'Cache cleared'); } + + /* Make sure our cache is built */ $cached_tables = config('ninja.cached_tables'); diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index 7c3e01791..2d5aba5e4 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -64,6 +64,7 @@ class UserTransformer extends EntityTransformer 'custom_value2' => $user->custom_value2 ?: '', 'custom_value3' => $user->custom_value3 ?: '', 'custom_value4' => $user->custom_value4 ?: '', + 'oauth_provider_id' => (string)$user->oauth_provider_id, ]; } diff --git a/app/Utils/Traits/Invoice/ActionsInvoice.php b/app/Utils/Traits/Invoice/ActionsInvoice.php index 7b6c9988b..78c344def 100644 --- a/app/Utils/Traits/Invoice/ActionsInvoice.php +++ b/app/Utils/Traits/Invoice/ActionsInvoice.php @@ -17,7 +17,7 @@ trait ActionsInvoice { public function invoiceDeletable($invoice) :bool { - if ($invoice->status_id <= Invoice::STATUS_SENT && $invoice->is_deleted == false && $invoice->deleted_at == null) { + if ($invoice->status_id <= Invoice::STATUS_SENT && $invoice->is_deleted == false && $invoice->deleted_at == null && $invoice->balance == 0) { return true; }