format('Y'); try { $taskId = $this->tasks->execute($year, $workTypeId, $sellerId, __('sales.job_name', ['year' => $year])); $this->addHours->execute( $sellerId, $taskId, $day->format('Y-m-d'), number_format($quarters / 4, 2, ',', ''), __('sales.hours_note', ['number' => $saleId]), ); } catch (DomainException) { // Approved or locked hours, or a day over 24 hours: the sale stands without them. return false; } return true; } }