| @@ -61,8 +61,8 @@ | ||
| 61 | 61 | $form = new Form($db); | 
| 62 | 62 | print '<!-- debut cartouche rapport --> | 
| 63 | 63 | <div class="tabs"> | 
| 64 | - <a id="'.($viewSelection == 1 ? 'active' : '').'" class="tab" href="listFact.php?view=1">Facturation</a> | |
| 65 | - <a id="'.($viewSelection == 2 ? 'active' : '').'" class="tab" href="listFact.php?view=2">AVIABEL</a> | |
| 64 | + <a id="'.($viewSelection == 1 ? 'active' : '') . '" class="tab" href="listFact.php?view=1">Facturation</a> | |
| 65 | + <a id="'.($viewSelection == 2 ? 'active' : '') . '" class="tab" href="listFact.php?view=2">AVIABEL</a> | |
| 66 | 66 | </div>'; | 
| 67 | 67 | print '<div class="tabBar">'; | 
| 68 | 68 | print "<form name='listFact' action=\"listFact.php\" method=\"get\">\n"; | 
| @@ -69,7 +69,7 @@ | ||
| 69 | 69 | $result = [$this->year]; | 
| 70 | 70 | |
| 71 | 71 |          foreach ($this->graphData as $typeId => $data) { | 
| 72 | -            if(!in_array($typeId, [1,2,3,6])){ | |
| 72 | +            if (!in_array($typeId, [1, 2, 3, 6])) { | |
| 73 | 73 | continue; | 
| 74 | 74 | } | 
| 75 | 75 | |
| @@ -36,14 +36,14 @@ | ||
| 36 | 36 | /** | 
| 37 | 37 | * @param GraphicalValue $value | 
| 38 | 38 | */ | 
| 39 | -    public function addValue(GraphicalValue $value){ | |
| 39 | +    public function addValue(GraphicalValue $value) { | |
| 40 | 40 | $this->counter = $this->counter->add($value); | 
| 41 | 41 | } | 
| 42 | 42 | |
| 43 | 43 | /** | 
| 44 | 44 | * @return int | 
| 45 | 45 | */ | 
| 46 | -    public function getValue(){ | |
| 46 | +    public function getValue() { | |
| 47 | 47 | return $this->counter->getValue(); | 
| 48 | 48 | } | 
| 49 | 49 | |
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | */ | 
| 41 | 41 | public function addValue($year, GraphicalValue $value) | 
| 42 | 42 |      { | 
| 43 | -        if(!isset($this->data[$year])){ | |
| 43 | +        if (!isset($this->data[$year])) { | |
| 44 | 44 |              throw new \Exception("Year is not defined"); | 
| 45 | 45 | } | 
| 46 | 46 | |
| @@ -54,7 +54,7 @@ discard block | ||
| 54 | 54 |      { | 
| 55 | 55 | $result = []; | 
| 56 | 56 | |
| 57 | -        foreach($this->data as $year){ | |
| 57 | +        foreach ($this->data as $year) { | |
| 58 | 58 | $result[] = $year->export(); | 
| 59 | 59 | } | 
| 60 | 60 | |
| @@ -149,9 +149,9 @@ | ||
| 149 | 149 | } | 
| 150 | 150 | |
| 151 | 151 | /** | 
| 152 | - * @param null $year | |
| 153 | - * @param null $pilotId | |
| 154 | - * @param null $quarter | |
| 152 | + * @param integer $year | |
| 153 | + * @param integer $pilotId | |
| 154 | + * @param integer $quarter | |
| 155 | 155 | * @param bool $groupBy | 
| 156 | 156 | * | 
| 157 | 157 | * @return string | 
| @@ -337,7 +337,7 @@ discard block | ||
| 337 | 337 | $totalQ4 = 0; | 
| 338 | 338 | |
| 339 | 339 |      $curMonth = date("m", time()); | 
| 340 | - $curQuarter = ceil($curMonth/3); | |
| 340 | + $curQuarter = ceil($curMonth / 3); | |
| 341 | 341 | $disableColor = 'style="background-color: lightyellow;" title="N/A" data-toggle="tooltip"'; | 
| 342 | 342 | |
| 343 | 343 |      foreach ($kmByQuartil as $id => $rembKm) { | 
| @@ -371,29 +371,29 @@ discard block | ||
| 371 | 371 | print '<td>' . $name . '</td>'; | 
| 372 | 372 | print '<td>' . $firstname . '</td>'; | 
| 373 | 373 | |
| 374 | - print '<td'.($curQuarter < 1 ? $disableColor: '').'>' . ($flightsQ1) . '</td>'; | |
| 375 | - print '<td'.($curQuarter < 1 ? $disableColor: '').'>' . ($flightsQ1 * $unitPriceMission) . '€</td>'; | |
| 376 | - print '<td'.($curQuarter < 1 ? $disableColor: '').'>' . $sumQ1 . '</td>'; | |
| 377 | - print '<td'.($curQuarter < 1 ? $disableColor: '').'>' . ($sumQ1 * $tauxRemb) . '</td>'; | |
| 378 | - print '<td'.($curQuarter < 1 ? $disableColor: '').'><b>' . $amoutQ1 . '€</b></td>'; | |
| 379 | - | |
| 380 | - print '<td '.($curQuarter < 2 ? $disableColor: '').'>' . ($flightsQ2) . '</td>'; | |
| 381 | - print '<td '.($curQuarter < 2 ? $disableColor: '').'>' . ($flightsQ2 * $unitPriceMission) . '€</td>'; | |
| 382 | - print '<td '.($curQuarter < 2 ? $disableColor: '').'>' . $sumQ2 . '</td>'; | |
| 383 | - print '<td '.($curQuarter < 2 ? $disableColor: '').'>' . ($sumQ2 * $tauxRemb) . '</td>'; | |
| 384 | - print '<td '.($curQuarter < 2 ? $disableColor: '').'><b>' . $amoutQ2 . '€</b></td>'; | |
| 385 | - | |
| 386 | - print '<td '.($curQuarter < 3 ? $disableColor: '').'>' . ($flightsQ3) . '</td>'; | |
| 387 | - print '<td '.($curQuarter < 3 ? $disableColor: '').'>' . ($flightsQ3 * $unitPriceMission) . '€</td>'; | |
| 388 | - print '<td '.($curQuarter < 3 ? $disableColor: '').'>' . $sumQ3 . '</td>'; | |
| 389 | - print '<td '.($curQuarter < 3 ? $disableColor: '').'>' . ($sumQ3 * $tauxRemb) . '</td>'; | |
| 390 | - print '<td '.($curQuarter < 3 ? $disableColor: '').'><b>' . $amoutQ3 . '€</b></td>'; | |
| 391 | - | |
| 392 | - print '<td '.($curQuarter < 4 ? $disableColor: '').'>' . ($flightsQ4) . '</td>'; | |
| 393 | - print '<td '.($curQuarter < 4 ? $disableColor: '').'>' . ($flightsQ4 * $unitPriceMission) . '€</td>'; | |
| 394 | - print '<td '.($curQuarter < 4 ? $disableColor: '').'>' . $sumQ4 . '</td>'; | |
| 395 | - print '<td '.($curQuarter < 4 ? $disableColor: '').'>' . ($sumQ4 * $tauxRemb) . '</td>'; | |
| 396 | - print '<td '.($curQuarter < 4 ? $disableColor: '').'><b>' . $amoutQ4 . '€</b></td>'; | |
| 374 | + print '<td' . ($curQuarter < 1 ? $disableColor : '') . '>' . ($flightsQ1) . '</td>'; | |
| 375 | + print '<td' . ($curQuarter < 1 ? $disableColor : '') . '>' . ($flightsQ1 * $unitPriceMission) . '€</td>'; | |
| 376 | + print '<td' . ($curQuarter < 1 ? $disableColor : '') . '>' . $sumQ1 . '</td>'; | |
| 377 | + print '<td' . ($curQuarter < 1 ? $disableColor : '') . '>' . ($sumQ1 * $tauxRemb) . '</td>'; | |
| 378 | + print '<td' . ($curQuarter < 1 ? $disableColor : '') . '><b>' . $amoutQ1 . '€</b></td>'; | |
| 379 | + | |
| 380 | + print '<td ' . ($curQuarter < 2 ? $disableColor : '') . '>' . ($flightsQ2) . '</td>'; | |
| 381 | + print '<td ' . ($curQuarter < 2 ? $disableColor : '') . '>' . ($flightsQ2 * $unitPriceMission) . '€</td>'; | |
| 382 | + print '<td ' . ($curQuarter < 2 ? $disableColor : '') . '>' . $sumQ2 . '</td>'; | |
| 383 | + print '<td ' . ($curQuarter < 2 ? $disableColor : '') . '>' . ($sumQ2 * $tauxRemb) . '</td>'; | |
| 384 | + print '<td ' . ($curQuarter < 2 ? $disableColor : '') . '><b>' . $amoutQ2 . '€</b></td>'; | |
| 385 | + | |
| 386 | + print '<td ' . ($curQuarter < 3 ? $disableColor : '') . '>' . ($flightsQ3) . '</td>'; | |
| 387 | + print '<td ' . ($curQuarter < 3 ? $disableColor : '') . '>' . ($flightsQ3 * $unitPriceMission) . '€</td>'; | |
| 388 | + print '<td ' . ($curQuarter < 3 ? $disableColor : '') . '>' . $sumQ3 . '</td>'; | |
| 389 | + print '<td ' . ($curQuarter < 3 ? $disableColor : '') . '>' . ($sumQ3 * $tauxRemb) . '</td>'; | |
| 390 | + print '<td ' . ($curQuarter < 3 ? $disableColor : '') . '><b>' . $amoutQ3 . '€</b></td>'; | |
| 391 | + | |
| 392 | + print '<td ' . ($curQuarter < 4 ? $disableColor : '') . '>' . ($flightsQ4) . '</td>'; | |
| 393 | + print '<td ' . ($curQuarter < 4 ? $disableColor : '') . '>' . ($flightsQ4 * $unitPriceMission) . '€</td>'; | |
| 394 | + print '<td ' . ($curQuarter < 4 ? $disableColor : '') . '>' . $sumQ4 . '</td>'; | |
| 395 | + print '<td ' . ($curQuarter < 4 ? $disableColor : '') . '>' . ($sumQ4 * $tauxRemb) . '</td>'; | |
| 396 | + print '<td ' . ($curQuarter < 4 ? $disableColor : '') . '><b>' . $amoutQ4 . '€</b></td>'; | |
| 397 | 397 | |
| 398 | 398 | print '<td>' . (($sumFlights * $unitPriceMission) + ($sumKm * $tauxRemb)) . '€</td>'; | 
| 399 | 399 | |
| @@ -401,13 +401,13 @@ discard block | ||
| 401 | 401 | } | 
| 402 | 402 | |
| 403 | 403 | print "<td colspan='6'></td>"; | 
| 404 | - print "<td>".price($totalQ1)."€</td>"; | |
| 404 | + print "<td>" . price($totalQ1) . "€</td>"; | |
| 405 | 405 | print "<td colspan='4'></td>"; | 
| 406 | - print "<td>".price($totalQ2)."€</td>"; | |
| 406 | + print "<td>" . price($totalQ2) . "€</td>"; | |
| 407 | 407 | print "<td colspan='4'></td>"; | 
| 408 | - print "<td>".price($totalQ3)."€</td>"; | |
| 408 | + print "<td>" . price($totalQ3) . "€</td>"; | |
| 409 | 409 | print "<td colspan='4'></td>"; | 
| 410 | - print "<td>".price($totalQ4)."€</td>"; | |
| 410 | + print "<td>" . price($totalQ4) . "€</td>"; | |
| 411 | 411 | print "<td></td>"; | 
| 412 | 412 | |
| 413 | 413 | print '</table>'; | 
| @@ -45,17 +45,17 @@ | ||
| 45 | 45 | * | 
| 46 | 46 | * @return TabCollection | 
| 47 | 47 | */ | 
| 48 | -    public function addTab(Tab $tab){ | |
| 48 | +    public function addTab(Tab $tab) { | |
| 49 | 49 | $this->tabs[] = $tab; | 
| 50 | 50 | } | 
| 51 | 51 | |
| 52 | 52 | /** | 
| 53 | 53 | * @return array | 
| 54 | 54 | */ | 
| 55 | -    public function toArray(){ | |
| 55 | +    public function toArray() { | |
| 56 | 56 | $tabAsArray = []; | 
| 57 | 57 | |
| 58 | -        foreach ($this->tabs as $tab){ | |
| 58 | +        foreach ($this->tabs as $tab) { | |
| 59 | 59 | $tabAsArray[] = $tab->toArray(); | 
| 60 | 60 | } | 
| 61 | 61 | |
| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | <tr <?php echo $GLOBALS['bc'][$var]; ?> > | 
| 52 | 52 |          <td><?php echo $langs->trans("Vol"); ?></td> | 
| 53 | 53 | <td><?= $flight->getNomUrl()?></td> | 
| 54 | -        <td align="center"><?= sprintf("%s à %s ", $flight->lieuD, $flight->lieuA);?></td> | |
| 54 | +        <td align="center"><?= sprintf("%s à %s ", $flight->lieuD, $flight->lieuA); ?></td> | |
| 55 | 55 | <td align="center"><?= dol_print_date($flight->date, '%d-%m-%Y') ?></td> | 
| 56 | - <td align="right"><?= $flight->cost?:'N/A' ?></td> | |
| 56 | + <td align="right"><?= $flight->cost ?: 'N/A' ?></td> | |
| 57 | 57 | <td align="right"><?= $flight->getLibStatut(3)?></td> | 
| 58 | 58 | <td align="right"><a | 
| 59 | 59 |                      href="<?php echo $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=dellink&dellinkid=' . $key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a> | 
| @@ -81,9 +81,9 @@ discard block | ||
| 81 | 81 | |
| 82 | 82 | $missions = bbcKilometersByQuartil($year); | 
| 83 | 83 | |
| 84 | -        foreach($missions as $currentMissionUserId => $currentMission){ | |
| 84 | +        foreach ($missions as $currentMissionUserId => $currentMission) { | |
| 85 | 85 | |
| 86 | -            if($currentMission["quartil"][$quarter]["km"] == 0 && $currentMission["quartil"][$quarter]["flight"] == 0){ | |
| 86 | +            if ($currentMission["quartil"][$quarter]["km"] == 0 && $currentMission["quartil"][$quarter]["flight"] == 0) { | |
| 87 | 87 | continue; | 
| 88 | 88 | } | 
| 89 | 89 | |
| @@ -97,18 +97,18 @@ discard block | ||
| 97 | 97 | $object->fk_statut = 1; | 
| 98 | 98 |              $object->fk_user_validator = GETPOST("fk_user_validator", 'int'); | 
| 99 | 99 |              $object->note_public = GETPOST('public_note', 'alpha'); | 
| 100 | -            $object->note_private = GETPOST('private_note','alpha'); | |
| 100 | +            $object->note_private = GETPOST('private_note', 'alpha'); | |
| 101 | 101 | |
| 102 | 102 | $expenseNoteId = $object->create($expenseNoteUser); | 
| 103 | -            if($expenseNoteId < 0){ | |
| 104 | -                dol_htmloutput_errors("Erreur lors de la création de la note de frais" , $object->errors); | |
| 103 | +            if ($expenseNoteId < 0) { | |
| 104 | +                dol_htmloutput_errors("Erreur lors de la création de la note de frais", $object->errors); | |
| 105 | 105 | continue; | 
| 106 | 106 | } | 
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | $flightsForQuarter = findFlightByPilotAndQuarter($currentMissionUserId, $year, $quarter); | 
| 110 | 110 | |
| 111 | -            foreach($flightsForQuarter as $currentFlightForQuarter) { | |
| 111 | +            foreach ($flightsForQuarter as $currentFlightForQuarter) { | |
| 112 | 112 | |
| 113 | 113 | // Kilometers | 
| 114 | 114 | $object_ligne = new ExpenseReportLine($db); | 
| @@ -168,7 +168,7 @@ discard block | ||
| 168 | 168 | |
| 169 | 169 |          if ($result > 0) { | 
| 170 | 170 |              dol_htmloutput_mesg("Notes de frais créées"); | 
| 171 | -        }else{ | |
| 171 | +        } else { | |
| 172 | 172 |              dol_htmloutput_errors("Note de frais non créée"); | 
| 173 | 173 | } | 
| 174 | 174 |      } else { | 
| @@ -187,15 +187,15 @@ discard block | ||
| 187 | 187 | $form = new Form($db); | 
| 188 | 188 | |
| 189 | 189 | $tabLinks = []; | 
| 190 | -foreach($flightYears as $currentFlightYear){ | |
| 190 | +foreach ($flightYears as $currentFlightYear) { | |
| 191 | 191 | $tabLinks[] = [ | 
| 192 | - DOL_URL_ROOT."/flightlog/generateExpenseNote.php?year=".$currentFlightYear, | |
| 192 | + DOL_URL_ROOT . "/flightlog/generateExpenseNote.php?year=" . $currentFlightYear, | |
| 193 | 193 | $currentFlightYear, | 
| 194 | - "tab_".$currentFlightYear | |
| 194 | + "tab_" . $currentFlightYear | |
| 195 | 195 | ]; | 
| 196 | 196 | } | 
| 197 | 197 | |
| 198 | -dol_fiche_head($tabLinks, "tab_".$year); | |
| 198 | +dol_fiche_head($tabLinks, "tab_" . $year); | |
| 199 | 199 | |
| 200 | 200 | ?> | 
| 201 | 201 | <form method="POST"> | 
| @@ -211,7 +211,7 @@ discard block | ||
| 211 | 211 | <select name="quarter" id="field_quarter"> | 
| 212 | 212 | <option value="1" <?= ($year == $currentYear && $currentQuarter <= 1) ? 'disabled="disabled"' : "" ?>>1</option> | 
| 213 | 213 | <option value="2" <?= ($year == $currentYear && $currentQuarter <= 2) ? 'disabled="disabled"' : "" ?>>2</option> | 
| 214 | - <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"': "" ?>>3</option> | |
| 214 | + <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"' : "" ?>>3</option> | |
| 215 | 215 | <option value="4" <?= ($year == $currentYear && $currentQuarter <= 4) ? 'disabled="disabled"' : "" ?>>4</option> | 
| 216 | 216 | </select> | 
| 217 | 217 | <br/> | 
| @@ -220,7 +220,7 @@ discard block | ||
| 220 | 220 |          <label><?= $langs->trans("Validateur de la note de frais")?></label><br/> | 
| 221 | 221 | <?php | 
| 222 | 222 | $include_users = $object->fetch_users_approver_expensereport(); | 
| 223 | - print $form->select_dolusers($user->id,"fk_user_validator",1,"",0,$include_users); | |
| 223 | + print $form->select_dolusers($user->id, "fk_user_validator", 1, "", 0, $include_users); | |
| 224 | 224 | ?> | 
| 225 | 225 | <br/> | 
| 226 | 226 | |
| @@ -29,7 +29,7 @@ discard block | ||
| 29 | 29 | $this->results["flightlog"] = [ | 
| 30 | 30 |              'label' => $langs->trans("Search flight"), | 
| 31 | 31 |              'text'  => $langs->trans("Search flight"), | 
| 32 | - 'url' => DOL_URL_ROOT . '/flightlog/list.php?mainmenu=flightlog&sall='.$searchInfo['search_boxvalue'] | |
| 32 | + 'url' => DOL_URL_ROOT . '/flightlog/list.php?mainmenu=flightlog&sall=' . $searchInfo['search_boxvalue'] | |
| 33 | 33 | ]; | 
| 34 | 34 | } | 
| 35 | 35 | |
| @@ -38,8 +38,8 @@ discard block | ||
| 38 | 38 | * @param $object | 
| 39 | 39 | * @param $action | 
| 40 | 40 | */ | 
| 41 | -    public function showLinkToObjectBlock($parameter, $object, $action){ | |
| 42 | -        $this->results["flightlog_bbcvols"]= array('enabled'=>1, 'perms'=>1, 'label'=>'LinkToFlight', 'sql'=>"SELECT f.idBBC_vols as rowid, CONCAT('(ID : ',f.idBBC_vols, ') -',f.date, '-',f.lieuD, ' ; ', f.lieuA) as ref FROM ".MAIN_DB_PREFIX."bbc_vols as f WHERE YEAR(f.date) = (YEAR(NOW())) ORDER BY date DESC"); | |
| 41 | +    public function showLinkToObjectBlock($parameter, $object, $action) { | |
| 42 | +        $this->results["flightlog_bbcvols"] = array('enabled'=>1, 'perms'=>1, 'label'=>'LinkToFlight', 'sql'=>"SELECT f.idBBC_vols as rowid, CONCAT('(ID : ',f.idBBC_vols, ') -',f.date, '-',f.lieuD, ' ; ', f.lieuA) as ref FROM " . MAIN_DB_PREFIX . "bbc_vols as f WHERE YEAR(f.date) = (YEAR(NOW())) ORDER BY date DESC"); | |
| 43 | 43 | |
| 44 | 44 | } | 
| 45 | 45 | } | 
| 46 | 46 | \ No newline at end of file |