@@ -124,12 +124,12 @@ |
||
| 124 | 124 | * Put here all code to do according to value of "action" parameter |
| 125 | 125 | */ |
| 126 | 126 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
| 127 | - try{ |
|
| 128 | - $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax); |
|
| 127 | + try { |
|
| 128 | + $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount, $nbrPax); |
|
| 129 | 129 | $handler->handle($command); |
| 130 | 130 | Header("Location: card.php?id=" . $flight->getId()); |
| 131 | - }catch (\Exception $e){ |
|
| 132 | - dol_syslog($e->getMessage(),LOG_ERR); |
|
| 131 | + } catch (\Exception $e) { |
|
| 132 | + dol_syslog($e->getMessage(), LOG_ERR); |
|
| 133 | 133 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax); |
| 129 | 129 | $handler->handle($command); |
| 130 | 130 | Header("Location: card.php?id=" . $flight->getId()); |
| 131 | - }catch (\Exception $e){ |
|
| 131 | + } catch (\Exception $e){ |
|
| 132 | 132 | dol_syslog($e->getMessage(),LOG_ERR); |
| 133 | 133 | dol_htmloutput_mesg("Facture non créée", '', 'error'); |
| 134 | 134 | } |
@@ -269,9 +269,12 @@ discard block |
||
| 269 | 269 | |
| 270 | 270 | <?php if (!$flightProduct || !$flight->hasReceiver()) : ?> |
| 271 | 271 | <a class="butActionRefused" href="#">Générer</a> |
| 272 | - <?php else: ?> |
|
| 272 | + <?php else { |
|
| 273 | + : ?> |
|
| 273 | 274 | <button class="butAction" type="submit">Générer</button> |
| 274 | - <?php endif; ?> |
|
| 275 | + <?php endif; |
|
| 276 | +} |
|
| 277 | +?> |
|
| 275 | 278 | |
| 276 | 279 | <a class="butAction" href="<?php echo DOL_URL_ROOT . '/flightlog/card.php?id=' . $flight->id; ?>">Retour au |
| 277 | 280 | vol</a> |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | Assert::string($kilometersComment); |
| 65 | 65 | Assert::integerish($numberOfKilometers); |
| 66 | 66 | |
| 67 | - $this->id = (int)$id; |
|
| 67 | + $this->id = (int) $id; |
|
| 68 | 68 | $this->startPoint = $startPoint; |
| 69 | 69 | $this->endPoint = $endPoint; |
| 70 | 70 | $this->kilometersComment = $kilometersComment; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | Assert::nullOrString($pilotLastname); |
| 47 | 47 | Assert::nullOrString($pilotFirstname); |
| 48 | 48 | |
| 49 | - $this->pilotId = (int)$pilotId; |
|
| 49 | + $this->pilotId = (int) $pilotId; |
|
| 50 | 50 | $this->pilotFirstname = $pilotFirstname; |
| 51 | 51 | $this->pilotLastname = $pilotLastname; |
| 52 | 52 | |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | * @param int $numberOfFlights |
| 60 | 60 | * @param int $numberOfKilometers |
| 61 | 61 | */ |
| 62 | - public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers){ |
|
| 62 | + public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers) { |
|
| 63 | 63 | Assert::integerish($quarter); |
| 64 | - $quarter = (int)$quarter; |
|
| 64 | + $quarter = (int) $quarter; |
|
| 65 | 65 | |
| 66 | 66 | Assert::keyNotExists($this->quarterMissions, $quarter); |
| 67 | 67 | |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | * |
| 120 | 120 | * @return QuarterMission |
| 121 | 121 | */ |
| 122 | - private function getQuarterMission($quarter){ |
|
| 122 | + private function getQuarterMission($quarter) { |
|
| 123 | 123 | Assert::integer($quarter); |
| 124 | 124 | Assert::greaterThan($quarter, 0); |
| 125 | 125 | Assert::lessThanEq($quarter, 4); |
| 126 | 126 | |
| 127 | - if(!isset($this->quarterMissions[$quarter])){ |
|
| 128 | - return new QuarterMission($quarter,0,0); |
|
| 127 | + if (!isset($this->quarterMissions[$quarter])) { |
|
| 128 | + return new QuarterMission($quarter, 0, 0); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return $this->quarterMissions[$quarter]; |
@@ -136,6 +136,6 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function getPilotName() |
| 138 | 138 | { |
| 139 | - return $this->pilotFirstname.' '.$this->pilotLastname; |
|
| 139 | + return $this->pilotFirstname . ' ' . $this->pilotLastname; |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | \ No newline at end of file |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | while ($i < $num) { |
| 47 | 47 | $flight = $this->db->fetch_object($resql); |
| 48 | 48 | if ($flight) { |
| 49 | - $flights[] = new FlightMission($flight->rowid, $flight->lieuD,$flight->lieuA, $flight->justif_kilometers, $flight->kilometers, new \DateTime($flight->date)); |
|
| 49 | + $flights[] = new FlightMission($flight->rowid, $flight->lieuD, $flight->lieuA, $flight->justif_kilometers, $flight->kilometers, new \DateTime($flight->date)); |
|
| 50 | 50 | } |
| 51 | 51 | $i++; |
| 52 | 52 | } |
@@ -33,14 +33,14 @@ |
||
| 33 | 33 | Assert::greaterThan($year, 0); |
| 34 | 34 | |
| 35 | 35 | Assert::nullOrIntegerish($quarter); |
| 36 | - if($quarter !== null){ |
|
| 36 | + if ($quarter !== null) { |
|
| 37 | 37 | Assert::greaterThan($quarter, 0); |
| 38 | 38 | Assert::lessThanEq($quarter, 4); |
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $this->quarter = (int)$quarter; |
|
| 43 | - $this->year = (int)$year; |
|
| 42 | + $this->quarter = (int) $quarter; |
|
| 43 | + $this->year = (int) $year; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | Assert::integerish($quarter); |
| 40 | 40 | Assert::integerish($year); |
| 41 | 41 | |
| 42 | - $this->pilotId = (int)$pilotId; |
|
| 43 | - $this->quarter = (int)$quarter; |
|
| 44 | - $this->year = (int)$year; |
|
| 42 | + $this->pilotId = (int) $pilotId; |
|
| 43 | + $this->quarter = (int) $quarter; |
|
| 44 | + $this->year = (int) $year; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $isFlightInError = $this->addFlight($currentFlightForQuarter, $expenseNote) || $isFlightInError; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if(!$isFlightInError){ |
|
| 114 | + if (!$isFlightInError) { |
|
| 115 | 115 | $expenseNote->fetch($expenseNoteId); |
| 116 | 116 | $expenseNote->setValidate($this->user); |
| 117 | 117 | $expenseNote->setApproved($this->user); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $expenseNote->setDocModel($this->user, "standard"); |
| 121 | 121 | $error = $expenseNote->generateDocument($expenseNote->modelpdf, $this->langs) <= 0; |
| 122 | 122 | |
| 123 | - if(!$error){ |
|
| 123 | + if (!$error) { |
|
| 124 | 124 | dol_htmloutput_mesg(sprintf("Notes de frais crée pour %s", $currentMission->getPilotName())); |
| 125 | 125 | continue; |
| 126 | 126 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $isError = $object_ligne->insert() <= 0; |
| 196 | 196 | |
| 197 | - if(!$isError){ |
|
| 197 | + if (!$isError) { |
|
| 198 | 198 | $expenseReport->add_object_linked(self::FLIGHT_ELEMENT, $currentFlightForQuarter->getId()); |
| 199 | 199 | } |
| 200 | 200 | |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | try { |
| 88 | 88 | $command = new CreateExpenseNoteCommand($year, $quarter, $userValidatorId, $privateNote, $publicNote); |
| 89 | 89 | $commandHandler->__invoke($command); |
| 90 | - } catch(PeriodNotFinishedException $e){ |
|
| 90 | + } catch (PeriodNotFinishedException $e) { |
|
| 91 | 91 | dol_htmloutput_errors("Le quadri n'est pas encore fini !"); |
| 92 | - } catch(\Exception $e){ |
|
| 92 | + } catch (\Exception $e) { |
|
| 93 | 93 | dol_syslog($e->getMessage(), LOG_ERR); |
| 94 | 94 | dol_htmloutput_errors('Error : ' . $e->getMessage()); |
| 95 | 95 | } |
@@ -105,15 +105,15 @@ discard block |
||
| 105 | 105 | $form = new Form($db); |
| 106 | 106 | |
| 107 | 107 | $tabLinks = []; |
| 108 | -foreach($flightYears as $currentFlightYear){ |
|
| 108 | +foreach ($flightYears as $currentFlightYear) { |
|
| 109 | 109 | $tabLinks[] = [ |
| 110 | - DOL_URL_ROOT."/flightlog/generateExpenseNote.php?year=".$currentFlightYear, |
|
| 110 | + DOL_URL_ROOT . "/flightlog/generateExpenseNote.php?year=" . $currentFlightYear, |
|
| 111 | 111 | $currentFlightYear, |
| 112 | - "tab_".$currentFlightYear |
|
| 112 | + "tab_" . $currentFlightYear |
|
| 113 | 113 | ]; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | -dol_fiche_head($tabLinks, "tab_".$year); |
|
| 116 | +dol_fiche_head($tabLinks, "tab_" . $year); |
|
| 117 | 117 | |
| 118 | 118 | ?> |
| 119 | 119 | <form method="POST"> |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | <select name="quarter" id="field_quarter"> |
| 135 | 135 | <option value="1" <?= ($year == $currentYear && $currentQuarter <= 1) ? 'disabled="disabled"' : "" ?>>1</option> |
| 136 | 136 | <option value="2" <?= ($year == $currentYear && $currentQuarter <= 2) ? 'disabled="disabled"' : "" ?>>2</option> |
| 137 | - <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"': "" ?>>3</option> |
|
| 137 | + <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"' : "" ?>>3</option> |
|
| 138 | 138 | <option value="4" <?= ($year == $currentYear && $currentQuarter <= 4) ? 'disabled="disabled"' : "" ?>>4</option> |
| 139 | 139 | </select> |
| 140 | 140 | <br/> |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | <label><?= $langs->trans("Validateur de la note de frais")?></label><br/> |
| 144 | 144 | <?php |
| 145 | 145 | $include_users = $object->fetch_users_approver_expensereport(); |
| 146 | - print $form->select_dolusers($user->id,"fk_user_validator",1,"",0,$include_users); |
|
| 146 | + print $form->select_dolusers($user->id, "fk_user_validator", 1, "", 0, $include_users); |
|
| 147 | 147 | ?> |
| 148 | 148 | <br/> |
| 149 | 149 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | print '<td>' . $totalT3 . '</td>'; |
| 267 | 267 | print '<td></td>'; |
| 268 | 268 | |
| 269 | -print '<td>' . $totalT4. '</td>'; |
|
| 269 | +print '<td>' . $totalT4 . '</td>'; |
|
| 270 | 270 | print '<td></td>'; |
| 271 | 271 | |
| 272 | 272 | print '<td>' . $totalT5 . '</td>'; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | //table km |
| 293 | 293 | $tauxRemb = isset($conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM) ? $conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM : 0; |
| 294 | 294 | $year = GETPOST("year", 'int'); |
| 295 | -if(empty($year)){ |
|
| 295 | +if (empty($year)) { |
|
| 296 | 296 | $year = date('Y'); |
| 297 | 297 | } |
| 298 | 298 | |