@@ -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; ?> |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | </td> |
84 | 84 | <td> |
85 | 85 | <?php $form->select_produits($conf->global->BBC_FLIGHT_TYPE_CUSTOMER, 'customer_product', |
86 | - $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?> |
|
86 | + $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?> |
|
87 | 87 | </td> |
88 | 88 | </tr> |
89 | 89 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <label for="points_bonus_<?php echo $flightTypeLine->numero; ?>"> |
107 | 107 | (T<?php echo $flightTypeLine->numero ?>) - <?php echo $flightTypeLine->nom ?> |
108 | 108 | </label> |
109 | - <?php $prop = 'BBC_POINTS_BONUS_'.$flightTypeLine->numero; ?> |
|
109 | + <?php $prop = 'BBC_POINTS_BONUS_' . $flightTypeLine->numero; ?> |
|
110 | 110 | <input type="number" id="points_bonus_<?php echo $flightTypeLine->numero; ?>" name="points_bonus_<?php echo $flightTypeLine->numero; ?>" value="<?php echo $conf->global->$prop?>" /> |
111 | 111 | <br/> |
112 | 112 | <?php endforeach; ?> |
@@ -1,7 +1,7 @@ discard block |
||
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 |
||
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 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
96 | 96 | try { |
97 | 97 | |
98 | - $command = new CreateMonthBillCommand( $type, $publicNote, $privateNote, $year, $month); |
|
98 | + $command = new CreateMonthBillCommand($type, $publicNote, $privateNote, $year, $month); |
|
99 | 99 | $handler->handle($command); |
100 | 100 | dol_htmloutput_mesg('Génération : OK'); |
101 | 101 | } catch (Exception $e) { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | try { |
55 | 55 | |
56 | - if(date('d')>=15){ |
|
56 | + if (date('d') >= 15) { |
|
57 | 57 | dol_syslog('Monthly bill generation : date over'); |
58 | 58 | return -2; |
59 | 59 | } |
@@ -232,7 +232,7 @@ |
||
232 | 232 | <?php echo !empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
233 | 233 | $flight->linkedObjectsIds[$currentTask->table_element]) ? 'checked' : '' ?> |
234 | 234 | /> |
235 | - <?php else: ?> |
|
235 | + <?php else : ?> |
|
236 | 236 | |
237 | 237 | <?php if (!empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
238 | 238 | $flight->linkedObjectsIds[$currentTask->table_element])): ?> |
@@ -95,7 +95,7 @@ |
||
95 | 95 | */ |
96 | 96 | private function checkBillingInformation($vol, $context) |
97 | 97 | { |
98 | - if($vol->isLinkedToOrder()){ |
|
98 | + if ($vol->isLinkedToOrder()) { |
|
99 | 99 | return $this; |
100 | 100 | } |
101 | 101 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $id = GETPOST('id', 'int') ?: GETPOST('idBBC_vols', 'int'); |
45 | 45 | $action = GETPOST('action', 'alpha'); |
46 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
46 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
47 | 47 | |
48 | 48 | $object = new Bbcvols($db); |
49 | 49 | $extrafields = new ExtraFields($db); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
63 | 63 | |
64 | 64 | // Load object |
65 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
66 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
65 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
66 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
67 | 67 | |
68 | 68 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
69 | 69 | $hookmanager->initHooks(array('bbcvols')); |
@@ -93,16 +93,16 @@ discard block |
||
93 | 93 | print '<tr><td class="fieldrequired">' . $langs->trans("Fielddate") . '</td><td>' . dol_print_date($object->date) . '</td></tr>'; |
94 | 94 | |
95 | 95 | if ($user->rights->flightlog->vol->financial) { |
96 | - print '<tr><td class="fieldrequired">' . $langs->trans("Fieldis_facture") . '</td><td>' . $object->getLibStatut(5). '</td></tr>'; |
|
96 | + print '<tr><td class="fieldrequired">' . $langs->trans("Fieldis_facture") . '</td><td>' . $object->getLibStatut(5) . '</td></tr>'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldkilometers") . '</td><td>' . $object->kilometers . ' KM</td></tr>'; |
100 | 100 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldjustif_kilometers") . '</td><td>' . $object->justif_kilometers . '</td></tr>'; |
101 | -if(!$object->isLinkedToOrder()){ |
|
101 | +if (!$object->isLinkedToOrder()) { |
|
102 | 102 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldcost") . '</td><td>' . $object->cost . " " . $langs->getCurrencySymbol($conf->currency) . '</td></tr>'; |
103 | 103 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_receiver") . '</td><td>' . $receiver->getNomUrl(1) . '</td></tr>'; |
104 | -}else{ |
|
105 | - print '<tr><td class="fieldrequired">' . $langs->trans("Order") . '</td><td>' . $object->getOrder()->getNomUrl(1). '</td></tr>'; |
|
104 | +} else { |
|
105 | + print '<tr><td class="fieldrequired">' . $langs->trans("Order") . '</td><td>' . $object->getOrder()->getNomUrl(1) . '</td></tr>'; |
|
106 | 106 | } |
107 | 107 | print '</table>'; |
108 | 108 | |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | // Buttons |
112 | 112 | print '<div class="tabsAction">' . "\n"; |
113 | 113 | |
114 | -if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){ |
|
115 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id.'">' . $langs->trans("Facturer") . '</a></div>' . "\n"; |
|
114 | +if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) { |
|
115 | + print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id . '">' . $langs->trans("Facturer") . '</a></div>' . "\n"; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | print '</div>' . "\n"; |
119 | 119 | |
120 | -if($user->rights->flightlog->vol->financial){ |
|
120 | +if ($user->rights->flightlog->vol->financial) { |
|
121 | 121 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
122 | 122 | $form->showLinkedObjectBlock($object); |
123 | 123 | print '</div></div>'; |
@@ -132,7 +132,7 @@ |
||
132 | 132 | $name = $command->getName() . ' ' . $command->getFirstname(); |
133 | 133 | |
134 | 134 | $existingCustomers = $this->societe->searchByName($name); |
135 | - if(count($existingCustomers) > 0){ |
|
135 | + if (count($existingCustomers) > 0) { |
|
136 | 136 | $this->societe = $existingCustomers[0]; |
137 | 137 | return $this->societe; |
138 | 138 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | /** |
229 | 229 | * @return boolean |
230 | 230 | */ |
231 | - public function hasTVA(){ |
|
231 | + public function hasTVA() { |
|
232 | 232 | return !empty($this->tva); |
233 | 233 | } |
234 | 234 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | /** |
260 | 260 | * @return bool |
261 | 261 | */ |
262 | - public function isCommentPublic(){ |
|
262 | + public function isCommentPublic() { |
|
263 | 263 | return $this->publicComment; |
264 | 264 | } |
265 | 265 |