Completed
Pull Request — master (#9)
by Laurent
04:26 queued 02:17
created
command/CreateFlightCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -393,7 +393,7 @@
 block discarded – undo
393 393
     /**
394 394
      * @return bool
395 395
      */
396
-    public function hasOrderId(){
396
+    public function hasOrderId() {
397 397
         return $this->orderId !== null;
398 398
     }
399 399
 }
400 400
\ No newline at end of file
Please login to merge, or discard this patch.
command/CreateFlightCommandHandler.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $vol = new Bbcvols($this->db);
66 66
         $vol->date = $command->getDate();
67 67
         $vol->lieuD = $command->getLieuD();
68
-        $vol->lieuA =$command->getLieuA();
68
+        $vol->lieuA = $command->getLieuA();
69 69
         $vol->heureD = $command->getHeureD();
70 70
         $vol->heureA = $command->getHeureA();
71 71
         $vol->BBC_ballons_idBBC_ballons = $command->getBBCBallonsIdBBCBallons();
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $vol->remarque = $command->getRemarque();
74 74
         $vol->incidents = $command->getIncidents();
75 75
         $vol->fk_type = $command->getFkType();
76
-        $vol->fk_pilot =$command->getFkPilot();
76
+        $vol->fk_pilot = $command->getFkPilot();
77 77
         $vol->fk_organisateur = $command->getFkOrganisateur();
78 78
         $vol->kilometers = $command->getKilometers();
79 79
         $vol->cost = $command->getCost();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         }
88 88
 
89 89
         $result = $vol->create($this->user);
90
-        if($result <= 0){
90
+        if ($result <= 0) {
91 91
             throw new Exception();
92 92
         }
93 93
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $flight->fetch($flight->id);
109 109
 
110
-        if(!$flight->isLinkedToOrder()){
110
+        if (!$flight->isLinkedToOrder()) {
111 111
             return;
112 112
         }
113 113
 
@@ -118,17 +118,17 @@  discard block
 block discarded – undo
118 118
 
119 119
         $qtyOrder = 0;
120 120
         /** @var OrderLine $currentOrderLine */
121
-        foreach($order->lines as $currentOrderLine){
122
-            $qtyOrder += (int)$currentOrderLine->qty;
121
+        foreach ($order->lines as $currentOrderLine) {
122
+            $qtyOrder += (int) $currentOrderLine->qty;
123 123
         }
124 124
 
125 125
         $passangersCount = $this->numberOfPassengersLinkedToOrder($order->id);
126 126
 
127
-        if($passangersCount != $qtyOrder){
127
+        if ($passangersCount != $qtyOrder) {
128 128
             return;
129 129
         }
130 130
 
131
-        if($order->statut == Commande::STATUS_VALIDATED){
131
+        if ($order->statut == Commande::STATUS_VALIDATED) {
132 132
             $order->cloture($this->user);
133 133
         }
134 134
     }
Please login to merge, or discard this patch.
class/bbcvols.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
         $sql .= ' justif_kilometers = ' . (isset($this->justif_kilometers) ? "'" . $this->db->escape($this->justif_kilometers) . "'," : "'',");
487 487
         $sql .= ' date_update = ' . "'" . date('Y-m-d H:i:s') . "',";
488 488
         $sql .= ' passenger_names = ' . "'" . trim($this->passengerNames) . "',";
489
-        $sql .= ' order_id = ' . "'" . (!isset($this->orderId) ? 'null' : $this->orderId ) . "'";
489
+        $sql .= ' order_id = ' . "'" . (!isset($this->orderId) ? 'null' : $this->orderId) . "'";
490 490
 
491 491
         $sql .= ' WHERE idBBC_vols=' . $this->idBBC_vols;
492 492
 
@@ -586,9 +586,9 @@  discard block
 block discarded – undo
586 586
         $label = '<u>' . $langs->trans("MyModule") . '</u>';
587 587
         $label .= '<div width="100%">';
588 588
         $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->idBBC_vols . '<br>';
589
-        $label .= '<b>' . $langs->trans('Date') . ':</b> ' . dol_print_date($this->date, '%d-%m-%Y').'<br/>';
590
-        $label .= '<b>' . $langs->trans('From') . ':</b> ' . $this->lieuD.'<br/>';
591
-        $label .= '<b>' . $langs->trans('To') . ':</b> ' . $this->lieuA.'<br/>';
589
+        $label .= '<b>' . $langs->trans('Date') . ':</b> ' . dol_print_date($this->date, '%d-%m-%Y') . '<br/>';
590
+        $label .= '<b>' . $langs->trans('From') . ':</b> ' . $this->lieuD . '<br/>';
591
+        $label .= '<b>' . $langs->trans('To') . ':</b> ' . $this->lieuA . '<br/>';
592 592
         $label .= '</div>';
593 593
 
594 594
         $link = '<a href="' . DOL_URL_ROOT . '/flightlog/card.php?id=' . $this->idBBC_vols . '"';
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
     /**
962 962
      * @return bool
963 963
      */
964
-    public function isLinkedToOrder(){
964
+    public function isLinkedToOrder() {
965 965
         return isset($this->orderId) && $this->orderId > 0;
966 966
     }
967 967
 
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
      */
971 971
     public function fetchOrder()
972 972
     {
973
-        if(!$this->isLinkedToOrder()){
973
+        if (!$this->isLinkedToOrder()) {
974 974
             return $this;
975 975
         }
976 976
 
Please login to merge, or discard this patch.