]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6571 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 29 Jan 2024 15:50:37 +0000 (16:50 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 29 Jan 2024 15:50:37 +0000 (16:50 +0100)
app/Http/Controllers/Admin/Operations/InvoiceOperation.php

index 872e2fa10d58cfc870a8e664da17be3ca68c40a4..0a507b6dca6486adda01e81bdd4d65d76b0320a7 100644 (file)
@@ -37,8 +37,12 @@ trait InvoiceOperation
     {
         $entry = FluidbookPublication::find($id);
 
-        if ($entry && $entry->invoicable_company) {
+        if ($entry) {
             $invoicable = $entry->invoicable_company;
+            if (!$invoicable) {
+                $company = Permissions::getCompanyByUser($entry->owner);
+                $invoicable = Permissions::getInvoicableCompany($company);
+            }
             if (request('type') === 'new') {
                 $time = time();
                 $projectData = [