1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Checks for company user in check data

This commit is contained in:
David Bomba 2022-03-08 22:19:25 +11:00
parent 88f730b9a1
commit b1d6f602ce

View File

@ -1010,6 +1010,27 @@ ORDER BY clients.id;
}
/* //used to set a company owner on the company_users table
$c = Company::whereDoesntHave('company_users', function ($query){
$query->where('is_owner', true)->withTrashed();
})->cursor()->each(function ($company){
if(!$company->company_users()->exists()){
echo "No company users AT ALL {$company->id}\n";
}
else{
$cu = $company->company_users()->orderBy('id', 'ASC')->orderBy('is_admin', 'ASC')->first();
echo "{$company->id} - {$cu->id} \n";
$cu->is_owner=true;
$cu->save();
}
});
*/
/* query if we want to company company ledger to client balance
$results = \DB::select( \DB::raw("
SELECT