Fogrot controller update in the last commit.
This commit is contained in:
@@ -61,7 +61,11 @@ class BookingsController extends Controller
|
||||
$sums[$month]['balance'] = $currBalance;
|
||||
}
|
||||
|
||||
return view('bookings.index', compact('bookings', 'year', 'sums'));
|
||||
$firstDateString = Carbon::parse(Booking::firstDate());
|
||||
$firstDate['Y'] = $firstDateString->format('Y');
|
||||
$firstDate['m'] = $firstDateString->format('m');
|
||||
|
||||
return view('bookings.index', compact('bookings', 'year', 'sums', 'firstDate'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,9 +115,9 @@ class BookingsController extends Controller
|
||||
$subBooking->account_type_id = request('account_type_id');
|
||||
$subBooking->project_id = request('project_id');
|
||||
|
||||
if (is_null(request('personTarget'))) {
|
||||
if (request('person_target_id') !== null) {
|
||||
$subBooking->person_target_id = request('person_target_id');
|
||||
} else {
|
||||
} elseif (request('personTarget')['person_id'] !== null) {
|
||||
$personTarget = new personTarget();
|
||||
|
||||
$personTarget->io_type_id = $subBooking->ioType()->id;
|
||||
@@ -234,7 +238,7 @@ class BookingsController extends Controller
|
||||
$booking->subBookings()->save($subBooking);
|
||||
}
|
||||
|
||||
return redirect('/bookings/year-' . Carbon::parse(request('date'))->format('Y'));
|
||||
return redirect('/bookings/year-' . Carbon::parse(request('booking')['date'])->format('Y'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user