@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param array $options |
28 | 28 | * @param \User $user |
29 | 29 | */ |
30 | - public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options,\User $user) |
|
30 | + public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options, \User $user) |
|
31 | 31 | { |
32 | 32 | |
33 | 33 | parent::__construct('flight_form', FormInterface::METHOD_POST, $this->buildOptionsfromConfiguration($options)); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $flight = $object; |
84 | 84 | |
85 | 85 | // Quick fix - Fixme by a factory on this form. |
86 | - if($this->user->rights->flightlog->vol->advanced){ |
|
86 | + if ($this->user->rights->flightlog->vol->advanced) { |
|
87 | 87 | return parent::bind($object); |
88 | 88 | } |
89 | 89 |
@@ -272,7 +272,7 @@ |
||
272 | 272 | $expenseNoteUser = new User($this->db); |
273 | 273 | $expenseNoteUser->id = $currentMissionUserId; |
274 | 274 | $id = $expenseNote->create($expenseNoteUser); |
275 | - if($id < 0){ |
|
275 | + if ($id < 0) { |
|
276 | 276 | return null; |
277 | 277 | } |
278 | 278 |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | $pilotLastname = $obj->lastname; |
53 | 53 | $pilotFirstname = $obj->firstname; |
54 | 54 | |
55 | - if($query->isPilotsOnly()){ |
|
55 | + if ($query->isPilotsOnly()) { |
|
56 | 56 | $result->addPilot($pilotId, $pilotFirstname, $pilotLastname); |
57 | - }else{ |
|
57 | + } else { |
|
58 | 58 | $result->addMission($obj->quartil, $pilotId, $pilotFirstname, $pilotLastname, |
59 | 59 | $obj->number_flights, $obj->total_kilometers); |
60 | 60 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $sql .= " , SUM(VOL.kilometers) as total_kilometers "; |
80 | 80 | $sql .= " , COUNT(VOL.idBBC_vols) as number_flights"; |
81 | 81 | |
82 | - if(!$query->isPilotsOnly()){ |
|
82 | + if (!$query->isPilotsOnly()) { |
|
83 | 83 | $sql .= " , QUARTER(VOL.date) as quartil "; |
84 | 84 | } |
85 | 85 |
@@ -397,7 +397,7 @@ |
||
397 | 397 | /** |
398 | 398 | * @return bool |
399 | 399 | */ |
400 | - public function hasOrderId(){ |
|
400 | + public function hasOrderId() { |
|
401 | 401 | return count($this->orderIds) > 0; |
402 | 402 | } |
403 | 403 | } |
404 | 404 | \ No newline at end of file |
@@ -26,8 +26,8 @@ |
||
26 | 26 | */ |
27 | 27 | public function __construct($flightId, $projectId) |
28 | 28 | { |
29 | - $this->flightId = (int)$flightId; |
|
30 | - $this->projectId = (int)$projectId; |
|
29 | + $this->flightId = (int) $flightId; |
|
30 | + $this->projectId = (int) $projectId; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -124,7 +124,7 @@ |
||
124 | 124 | $this->language = $form->language; |
125 | 125 | $this->userId = $userId; |
126 | 126 | $this->publicComment = $form->isCommentPublic == 1; |
127 | - $this->socid = (int)$form->socid; |
|
127 | + $this->socid = (int) $form->socid; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -52,12 +52,12 @@ |
||
52 | 52 | if (!isset($value->socid) && empty($value->email) && empty($value->phone)) { |
53 | 53 | $this->addWarning('Soit l\'e-mail soit le téléphone n\'a pas été complété'); |
54 | 54 | } |
55 | - if (empty($value->nbrPax) || (int)$value->nbrPax <= 0) { |
|
55 | + if (empty($value->nbrPax) || (int) $value->nbrPax <= 0) { |
|
56 | 56 | $this->addError('nbrPax', 'Le nombre de passagers doit être plus grand que 0.'); |
57 | 57 | } |
58 | 58 | |
59 | - if ((int)$value->nbrPax > 0) { |
|
60 | - $costPerPax = $value->cost / (int)$value->nbrPax; |
|
59 | + if ((int) $value->nbrPax > 0) { |
|
60 | + $costPerPax = $value->cost / (int) $value->nbrPax; |
|
61 | 61 | if ($costPerPax < $this->getMinPrice()) { |
62 | 62 | $this->addError('cost', |
63 | 63 | sprintf('Le prix demandé par passagé est trop peu élevé. Un minimum de %s est demandé', |
@@ -123,11 +123,11 @@ |
||
123 | 123 | * Put here all code to do according to value of "action" parameter |
124 | 124 | */ |
125 | 125 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
126 | - try{ |
|
127 | - $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax, $customerId); |
|
126 | + try { |
|
127 | + $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount, $nbrPax, $customerId); |
|
128 | 128 | $handler->handle($command); |
129 | - }catch (\Exception $e){ |
|
130 | - dol_syslog($e->getMessage(),LOG_ERR); |
|
129 | + } catch (\Exception $e) { |
|
130 | + dol_syslog($e->getMessage(), LOG_ERR); |
|
131 | 131 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
132 | 132 | } |
133 | 133 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $numberOfKilometers |
42 | 42 | ) |
43 | 43 | { |
44 | - $pilotId = (int)$pilotId; |
|
44 | + $pilotId = (int) $pilotId; |
|
45 | 45 | |
46 | 46 | if (!isset($this->items[$pilotId])) { |
47 | 47 | $this->items[$pilotId] = new PilotMissions($pilotId, $pilotFirstname, $pilotLastname); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function addPilot($pilotId, $pilotFirstname, $pilotLastname) |
59 | 59 | { |
60 | - $pilotId = (int)$pilotId; |
|
60 | + $pilotId = (int) $pilotId; |
|
61 | 61 | |
62 | 62 | if (isset($this->items[$pilotId])) { |
63 | 63 | return; |