@@ -127,12 +127,12 @@ |
||
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 | } |
@@ -131,7 +131,7 @@ discard block |
||
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 |
||
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> |
@@ -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 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $id = GETPOST('id', 'int'); |
50 | 50 | $action = GETPOST('action', 'alpha'); |
51 | 51 | $year = GETPOST('year', 'int', 3) ?: $currentYear; |
52 | -$month = GETPOST('month', 'int', 3) ?: $currentMonth-1; |
|
52 | +$month = GETPOST('month', 'int', 3) ?: $currentMonth - 1; |
|
53 | 53 | |
54 | 54 | //post parameters |
55 | 55 | $publicNote = GETPOST('public_note', 'alpha', 2); |
@@ -96,12 +96,12 @@ discard block |
||
96 | 96 | * Put here all code to do according to value of "action" parameter |
97 | 97 | */ |
98 | 98 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
99 | - try{ |
|
99 | + try { |
|
100 | 100 | |
101 | - $command = new CreateMonthBillCommand($type, $modeReglement, $conditionReglement, $documentModel, $publicNote, $privateNote,$year, $month); |
|
101 | + $command = new CreateMonthBillCommand($type, $modeReglement, $conditionReglement, $documentModel, $publicNote, $privateNote, $year, $month); |
|
102 | 102 | $handler->handle($command); |
103 | 103 | dol_htmloutput_mesg('Génération : OK'); |
104 | - }catch(Exception $e){ |
|
104 | + } catch (Exception $e) { |
|
105 | 105 | dol_syslog($e->getMessage(), LOG_ERR); |
106 | 106 | dol_htmloutput_mesg('Erreur pendant la génération.', '', 'error'); |
107 | 107 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | <label><?php echo $langs->trans('Année') ?></label> |
125 | 125 | <select name="year"> |
126 | 126 | <?php for ($selectYearOption = $currentYear; $selectYearOption >= $currentYear - 6; $selectYearOption--): ?> |
127 | - <option value="<?php echo $selectYearOption; ?>" <?php echo $selectYearOption == $year? 'selected' : '' ?>><?php echo $selectYearOption; ?></option> |
|
127 | + <option value="<?php echo $selectYearOption; ?>" <?php echo $selectYearOption == $year ? 'selected' : '' ?>><?php echo $selectYearOption; ?></option> |
|
128 | 128 | <?php endfor; ?> |
129 | 129 | </select> |
130 | 130 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | <label><?php echo $langs->trans('Mois') ?></label> |
133 | 133 | <select name="month"> |
134 | 134 | <?php for ($selectMonthOption = 1; $selectMonthOption <= 12; $selectMonthOption++): ?> |
135 | - <option value="<?php echo $selectMonthOption; ?>" <?php echo $selectMonthOption == $month? 'selected' : '' ?>><?php echo $selectMonthOption; ?></option> |
|
135 | + <option value="<?php echo $selectMonthOption; ?>" <?php echo $selectMonthOption == $month ? 'selected' : '' ?>><?php echo $selectMonthOption; ?></option> |
|
136 | 136 | <?php endfor; ?> |
137 | 137 | </select> |
138 | 138 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $command = new CreateMonthBillCommand($type, $modeReglement, $conditionReglement, $documentModel, $publicNote, $privateNote,$year, $month); |
102 | 102 | $handler->handle($command); |
103 | 103 | dol_htmloutput_mesg('Génération : OK'); |
104 | - }catch(Exception $e){ |
|
104 | + } catch(Exception $e){ |
|
105 | 105 | dol_syslog($e->getMessage(), LOG_ERR); |
106 | 106 | dol_htmloutput_mesg('Erreur pendant la génération.', '', 'error'); |
107 | 107 | } |
@@ -223,9 +223,12 @@ discard block |
||
223 | 223 | <?php echo $langs->trans('La periode demandée n\'est pas cloturée.') ?> |
224 | 224 | </p> |
225 | 225 | <a class="butActionRefused" href="#">Générer</a> |
226 | - <?php else: ?> |
|
226 | + <?php else { |
|
227 | + : ?> |
|
227 | 228 | <button class="butAction" type="submit">Générer</button> |
228 | - <?php endif; ?> |
|
229 | + <?php endif; |
|
230 | +} |
|
231 | +?> |
|
229 | 232 | |
230 | 233 | </form> |
231 | 234 |
@@ -967,7 +967,7 @@ |
||
967 | 967 | */ |
968 | 968 | public function getPlaces() |
969 | 969 | { |
970 | - return $this->lieuD.' -> '.$this->lieuA; |
|
970 | + return $this->lieuD . ' -> ' . $this->lieuA; |
|
971 | 971 | } |
972 | 972 | } |
973 | 973 |