Completed
Push — master ( 5decc1...c80619 )
by Laurent
02:09
created
facture.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,12 +127,12 @@
 block discarded – undo
127 127
  * Put here all code to do according to value of "action" parameter
128 128
  */
129 129
 if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
130
-    try{
131
-        $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount);
130
+    try {
131
+        $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount);
132 132
         $handler->handle($command);
133 133
         Header("Location: card.php?id=" . $flight->getId());
134
-    }catch (\Exception $e){
135
-        dol_syslog($e->getMessage(),LOG_ERR);
134
+    } catch (\Exception $e) {
135
+        dol_syslog($e->getMessage(), LOG_ERR);
136 136
         dol_htmloutput_mesg("Facture non créée", '', 'error');
137 137
     }
138 138
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount);
132 132
         $handler->handle($command);
133 133
         Header("Location: card.php?id=" . $flight->getId());
134
-    }catch (\Exception $e){
134
+    } catch (\Exception $e){
135 135
         dol_syslog($e->getMessage(),LOG_ERR);
136 136
         dol_htmloutput_mesg("Facture non créée", '', 'error');
137 137
     }
@@ -267,9 +267,12 @@  discard block
 block discarded – undo
267 267
 
268 268
         <?php if (!$flightProduct) : ?>
269 269
             <a class="butActionRefused" href="#">Générer</a>
270
-        <?php else: ?>
270
+        <?php else {
271
+    : ?>
271 272
             <button class="butAction" type="submit">Générer</button>
272
-        <?php endif; ?>
273
+        <?php endif;
274
+}
275
+?>
273 276
 
274 277
         <a class="butAction" href="<?php echo DOL_URL_ROOT . '/flightlog/card.php?id=' . $flight->id; ?>">Retour au
275 278
             vol</a>
Please login to merge, or discard this patch.
command/CreateFlightBillCommandHandlerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__.'/CreateFlightBillCommandHandler.php';
4
-require_once __DIR__.'/CreateFlightBillTransactionalCommandHandler.php';
3
+require_once __DIR__ . '/CreateFlightBillCommandHandler.php';
4
+require_once __DIR__ . '/CreateFlightBillTransactionalCommandHandler.php';
5 5
 
6 6
 /**
7 7
  * @author Laurent De Coninck <[email protected]>
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @return CreateFlightBillCommandHandler
13 13
      */
14
-    public static function factory($db, $conf, $user, $langs){
14
+    public static function factory($db, $conf, $user, $langs) {
15 15
         return new CreateFlightBillTransactionalCommandHandler($db, $conf, $user, $langs);
16 16
     }
17 17
 
Please login to merge, or discard this patch.
class/bbcvols.class.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     private $pilot;
87 87
 
88 88
     /**
89
-     * @return int
89
+     * @return string
90 90
      */
91 91
     public function getIdBBCVols()
92 92
     {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     }
95 95
 
96 96
     /**
97
-     * @return int
97
+     * @return string
98 98
      */
99 99
     public function getId()
100 100
     {
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
     }
952 952
 
953 953
     /**
954
-     * @return int
954
+     * @return string
955 955
      */
956 956
     public function getKilometers(){
957 957
         return $this->kilometers;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
             $this->lieuA = trim($this->lieuA);
150 150
         }
151 151
         if (isset($this->heureD)) {
152
-            $this->heureD = trim($this->heureD).'00';
152
+            $this->heureD = trim($this->heureD) . '00';
153 153
         }
154 154
         if (isset($this->heureA)) {
155
-            $this->heureA = trim($this->heureA).'00';
155
+            $this->heureA = trim($this->heureA) . '00';
156 156
         }
157 157
         if (isset($this->BBC_ballons_idBBC_ballons)) {
158 158
             $this->BBC_ballons_idBBC_ballons = trim($this->BBC_ballons_idBBC_ballons);
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
      */
892 892
     public function hasPax()
893 893
     {
894
-        return (int)$this->nbrPax > 0;
894
+        return (int) $this->nbrPax > 0;
895 895
     }
896 896
 
897 897
     /**
@@ -917,14 +917,14 @@  discard block
 block discarded – undo
917 917
     /**
918 918
      * @return int
919 919
      */
920
-    public function getAmountReceived(){
920
+    public function getAmountReceived() {
921 921
         return $this->cost;
922 922
     }
923 923
 
924 924
     /**
925 925
      * @return int
926 926
      */
927
-    public function getAmountPerPassenger(){
927
+    public function getAmountPerPassenger() {
928 928
         return $this->cost / $this->nbrPax;
929 929
     }
930 930
 
@@ -939,21 +939,21 @@  discard block
 block discarded – undo
939 939
     /**
940 940
      * @return boolean
941 941
      */
942
-    public function hasKilometers(){
942
+    public function hasKilometers() {
943 943
         return !empty($this->kilometers);
944 944
     }
945 945
 
946 946
     /**
947 947
      * @return boolean
948 948
      */
949
-    public function hasKilometersDescription(){
949
+    public function hasKilometersDescription() {
950 950
         return !empty(trim($this->justif_kilometers));
951 951
     }
952 952
 
953 953
     /**
954 954
      * @return int
955 955
      */
956
-    public function getKilometers(){
956
+    public function getKilometers() {
957 957
         return $this->kilometers;
958 958
     }
959 959
 }
Please login to merge, or discard this patch.
validators/FlightValidator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,16 +47,16 @@  discard block
 block discarded – undo
47 47
             $this->addError('heures', 'L\'heure de depart est plus grande  que l\'heure d\'arrivee');
48 48
         }
49 49
 
50
-        if(empty($vol->lieuD)){
50
+        if (empty($vol->lieuD)) {
51 51
             $this->addError('lieuD', 'Le lieu de départ est vide');
52 52
         }
53 53
 
54
-        if(empty($vol->lieuA)){
54
+        if (empty($vol->lieuA)) {
55 55
             $this->addError('lieuA', 'Le lieu d\'arrivée est vide');
56 56
         }
57 57
 
58 58
         // PAX
59
-        if (!is_numeric($vol->nbrPax) || (int)$vol->nbrPax < 0) {
59
+        if (!is_numeric($vol->nbrPax) || (int) $vol->nbrPax < 0) {
60 60
             $this->addError('nbrPax', 'Erreur le nombre de passager est un nombre négatif.');
61 61
         }
62 62
 
@@ -74,18 +74,18 @@  discard block
 block discarded – undo
74 74
                 'Erreur ce type de vol doit être payant, mais personne n\'a été signalé comme recepteur d\'argent.');
75 75
         }
76 76
 
77
-        if($vol->getFlightType()->isBillingRequired() && ($vol->getAmountPerPassenger()) < $this->getMinPrice()){
77
+        if ($vol->getFlightType()->isBillingRequired() && ($vol->getAmountPerPassenger()) < $this->getMinPrice()) {
78 78
             $this->addError('cost',
79 79
                 sprintf('Le montant demandé pour ce vol n\'est pas suffisant un minimum de %s euros est demandé', $this->getMinPrice()));
80 80
         }
81 81
 
82 82
         //Kilometers
83
-        if($vol->hasKilometers() && !$vol->getKilometers() > 0){
83
+        if ($vol->hasKilometers() && !$vol->getKilometers() > 0) {
84 84
             $this->addError('kilometers',
85 85
                 'Les kilometres doivent être un nombre positif');
86 86
         }
87 87
 
88
-        if($vol->hasKilometers() && !$vol->hasKilometersDescription()){
88
+        if ($vol->hasKilometers() && !$vol->hasKilometersDescription()) {
89 89
             $this->addError('justif_kilometers',
90 90
                 'Vous essayez d\'encoder des kilometres sans justificatif.');
91 91
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      *
129 129
      * @return int
130 130
      */
131
-    public function getMinPrice(){
131
+    public function getMinPrice() {
132 132
         if ($this->defaultService->price_base_type == 'TTC') {
133 133
             return $this->defaultService->price_min;
134 134
         }
Please login to merge, or discard this patch.