Skip to content

Commit

Permalink
Merge branch 'master' into i18n2
Browse files Browse the repository at this point in the history
  • Loading branch information
Papoteur committed Jan 19, 2024
2 parents 62cb97b + d1d3f09 commit 5f61b30
Show file tree
Hide file tree
Showing 13 changed files with 653 additions and 1,179 deletions.
16 changes: 8 additions & 8 deletions app/Http/Controllers/MatterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function storeFamily(Request $request)
$matter_id_num[$existing_app->filing->cleanNumber()] = $existing_app->id;
}
}
foreach ($apps as $key => &$app) {
foreach ($apps as $key => $app) {
if (array_key_exists($app['app']['number'], $matter_id_num)) {
// Member exists, do not create
continue;
Expand Down Expand Up @@ -402,11 +402,11 @@ public function storeFamily(Request $request)
$new_matter->events()->create(['code' => 'PFIL', 'alt_matter_id' => $new_matter->parent_id]);
}
if ($parent_num) {
//return response()->json(['errors' => ['message' => $matter_id_num]]);
// This app is a divisional or a continuation
$new_matter->events()->create(['code' => 'ENT', 'event_date' => $app['app']['date'], 'detail' => 'Child filing date']);
$parent = $apps->where('app.number', $parent_num)->first();
// Change this app's filing date to the parent's filing date for potentiel children of this app
$app->merge(['app.date' => $parent['app']['date']]);
// Change this app's filing date to the parent's filing date for potential children of this app
$app['app']['date'] = $parent['app']['date'];
$new_matter->parent_id = $matter_id_num["$parent_num"];
}
$new_matter->events()->create(['code' => 'FIL', 'event_date' => $app['app']['date'], 'detail' => $app['app']['number']]);
Expand Down Expand Up @@ -485,11 +485,11 @@ public function edit(Matter $matter)
'filing'
);
$country_edit = $matter->tasks()->whereHas('rule', function (Builder $q) {
$q->whereNull('for_country');
})->count();
$q->whereNotNull('for_country');
})->count() == 0;
$cat_edit = $matter->tasks()->whereHas('rule', function (Builder $q) {
$q->whereNull('for_category');
})->count();
$q->whereNotNull('for_category');
})->count() == 0;

return view('matter.edit', compact(['matter', 'cat_edit', 'country_edit']));
}
Expand Down
Loading

0 comments on commit 5f61b30

Please sign in to comment.