@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once(DOL_DOCUMENT_ROOT.'/flightlog/class/flight/FlightPoints.php'); |
|
| 3 | +require_once(DOL_DOCUMENT_ROOT . '/flightlog/class/flight/FlightPoints.php'); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * A bonus won by a pilot |
@@ -31,8 +31,8 @@ |
||
| 31 | 31 | public function __construct($type, $count = 0, $factor = 0) |
| 32 | 32 | { |
| 33 | 33 | $this->type = $type; |
| 34 | - $this->count = (int)$count; |
|
| 35 | - $this->factor = (int)$factor; |
|
| 34 | + $this->count = (int) $count; |
|
| 35 | + $this->factor = (int) $factor; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once(DOL_DOCUMENT_ROOT.'/flightlog/class/flight/FlightBonus.php'); |
|
| 4 | -require_once(DOL_DOCUMENT_ROOT.'/flightlog/class/flight/FlightPoints.php'); |
|
| 5 | -require_once(DOL_DOCUMENT_ROOT.'/flightlog/class/flight/FlightTypeCount.php'); |
|
| 6 | -require_once(DOL_DOCUMENT_ROOT.'/flightlog/class/billing/FlightCost.php'); |
|
| 3 | +require_once(DOL_DOCUMENT_ROOT . '/flightlog/class/flight/FlightBonus.php'); |
|
| 4 | +require_once(DOL_DOCUMENT_ROOT . '/flightlog/class/flight/FlightPoints.php'); |
|
| 5 | +require_once(DOL_DOCUMENT_ROOT . '/flightlog/class/flight/FlightTypeCount.php'); |
|
| 6 | +require_once(DOL_DOCUMENT_ROOT . '/flightlog/class/billing/FlightCost.php'); |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Pilot class |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | /** |
| 157 | 157 | * @return boolean |
| 158 | 158 | */ |
| 159 | - public function isBillable(){ |
|
| 159 | + public function isBillable() { |
|
| 160 | 160 | return $this->getTotalBill()->getValue() > 0; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once(DOL_DOCUMENT_ROOT.'/flightlog/class/flight/FlightBonus.php'); |
|
| 3 | +require_once(DOL_DOCUMENT_ROOT . '/flightlog/class/flight/FlightBonus.php'); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * @author Laurent De Coninck <[email protected]> |
@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | * Actions |
| 26 | 26 | */ |
| 27 | 27 | // Save |
| 28 | -if($action === ACTION_SAVE){ |
|
| 29 | - foreach($services as $flightTypeId => $serviceId){ |
|
| 28 | +if ($action === ACTION_SAVE) { |
|
| 29 | + foreach ($services as $flightTypeId => $serviceId) { |
|
| 30 | 30 | $res = $flightType->fetch($flightTypeId); |
| 31 | - if($res > 0 ){ |
|
| 31 | + if ($res > 0) { |
|
| 32 | 32 | $flightType->fkService = $serviceId; |
| 33 | 33 | $flightType->update($user); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - dolibarr_set_const($db, 'BBC_POINTS_BONUS_'.$flightTypeId, GETPOST('points_bonus_'.$flightTypeId), 'chaine', 0, 'Points pour le vol T'.$flightTypeId, $conf->entity); |
|
| 36 | + dolibarr_set_const($db, 'BBC_POINTS_BONUS_' . $flightTypeId, GETPOST('points_bonus_' . $flightTypeId), 'chaine', 0, 'Points pour le vol T' . $flightTypeId, $conf->entity); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | dolibarr_set_const($db, 'BBC_FLIGHT_TYPE_CUSTOMER', GETPOST('customer_product'), 'chaine', 0, '', $conf->entity); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | <tr class="<?= $flightTypeLine->id % 2 == 0 ? "pair" : "impair" ?>"> |
| 72 | 72 | <td>(T<?= $flightTypeLine->numero ?>) - <?= $flightTypeLine->nom ?></td> |
| 73 | 73 | <td> |
| 74 | - <?php $form->select_produits($flightTypeLine->fkService, 'idprod['.$flightTypeLine->id.']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?> |
|
| 74 | + <?php $form->select_produits($flightTypeLine->fkService, 'idprod[' . $flightTypeLine->id . ']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?> |
|
| 75 | 75 | </td> |
| 76 | 76 | </tr> |
| 77 | 77 | <?php endforeach; ?> |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | Vol client |
| 83 | 83 | </td> |
| 84 | 84 | <td> |
| 85 | - <?php $form->select_produits($conf->global->BBC_FLIGHT_TYPE_CUSTOMER, 'customer_product', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?> |
|
| 85 | + <?php $form->select_produits($conf->global->BBC_FLIGHT_TYPE_CUSTOMER, 'customer_product', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?> |
|
| 86 | 86 | </td> |
| 87 | 87 | </tr> |
| 88 | 88 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | <label for="points_bonus_<?php echo $flightTypeLine->numero; ?>"> |
| 106 | 106 | (T<?php echo $flightTypeLine->numero ?>) - <?php echo $flightTypeLine->nom ?> |
| 107 | 107 | </label> |
| 108 | - <?php $prop = 'BBC_POINTS_BONUS_'.$flightTypeLine->numero; ?> |
|
| 108 | + <?php $prop = 'BBC_POINTS_BONUS_' . $flightTypeLine->numero; ?> |
|
| 109 | 109 | <input type="number" id="points_bonus_<?php echo $flightTypeLine->numero; ?>" name="points_bonus_<?php echo $flightTypeLine->numero; ?>" value="<?php echo $conf->global->$prop?>" /> |
| 110 | 110 | <br/> |
| 111 | 111 | <?php endforeach; ?> |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | return $this->getFactorForService($type); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - return (int)$this->conf->$constVariableName; |
|
| 162 | + return (int) $this->conf->$constVariableName; |
|
| 163 | 163 | |
| 164 | 164 | } |
| 165 | 165 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Type 2 : Baptême") . '</td>'; |
| 148 | 148 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Organisateur (T1/T2)") . '</td>'; |
| 149 | 149 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Instructeur (orga T6)") . '</td>'; |
| 150 | -print '<td class="liste_titre" >' . $langs->trans("Total bonus") . '</td>'; |
|
| 150 | +print '<td class="liste_titre" >' . $langs->trans("Total bonus") . '</td>'; |
|
| 151 | 151 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Type 3 : Privé") . '</td>'; |
| 152 | 152 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Type 4: Meeting") . '</td>'; |
| 153 | 153 | print '<td class="liste_titre" colspan="1">' . $langs->trans("Type 5: Chambley") . '</td>'; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | print "<tr>"; |
| 244 | 244 | print "<td colspan='20'></td>"; |
| 245 | 245 | print "<td>Total à reçevoir</td>"; |
| 246 | -print "<td>".price($total)."€</td>"; |
|
| 246 | +print "<td>" . price($total) . "€</td>"; |
|
| 247 | 247 | print "</tr>"; |
| 248 | 248 | |
| 249 | 249 | print '</tbody>'; |
@@ -271,7 +271,7 @@ |
||
| 271 | 271 | */ |
| 272 | 272 | private function addAdditionalBonusToOrder(CreatePilotYearBillCommand $command, $object) |
| 273 | 273 | { |
| 274 | - if ((int)$command->getAdditionalBonus() <= 0) { |
|
| 274 | + if ((int) $command->getAdditionalBonus() <= 0) { |
|
| 275 | 275 | return; |
| 276 | 276 | } |
| 277 | 277 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | if (is_int($value)) { |
| 259 | - $sqlwhere [] = $key . ' = ' . (int)$value; |
|
| 259 | + $sqlwhere [] = $key . ' = ' . (int) $value; |
|
| 260 | 260 | continue; |
| 261 | 261 | } |
| 262 | 262 | } |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | */ |
| 600 | 600 | public function isPaxRequired() |
| 601 | 601 | { |
| 602 | - switch ((int)$this->idType) { |
|
| 602 | + switch ((int) $this->idType) { |
|
| 603 | 603 | case 1: |
| 604 | 604 | case 2: |
| 605 | 605 | return true; |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | */ |
| 616 | 616 | public function isBillingRequired() |
| 617 | 617 | { |
| 618 | - return (int)$this->idType === 2; |
|
| 618 | + return (int) $this->idType === 2; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | /** |