Code Duplication    Length = 12-12 lines in 2 locations

generateExpenseNote.php 1 location

@@ 85-96 (lines=12) @@
82
 * Put here all code to do according to value of "action" parameter
83
 */
84
85
if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
86
87
    try {
88
        $command = new CreateExpenseNoteCommand($year, $quarter, $userValidatorId, $privateNote, $publicNote);
89
        $commandHandler->__invoke($command);
90
    } catch(PeriodNotFinishedException $e){
91
        dol_htmloutput_errors("Le quadri n'est pas encore fini !");
92
    } catch(\Exception $e){
93
        dol_syslog($e->getMessage(), LOG_ERR);
94
        dol_htmloutput_errors('Error : ' . $e->getMessage());
95
    }
96
}
97
98
/*
99
 * VIEW

generateMonthlyBilling.php 1 location

@@ 95-106 (lines=12) @@
92
 *
93
 * Put here all code to do according to value of "action" parameter
94
 */
95
if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
96
    try {
97
98
        $command = new CreateMonthBillCommand( $type, $publicNote, $privateNote, $year, $month);
99
        $handler->handle($command);
100
        dol_htmloutput_mesg('Génération : OK');
101
    } catch (Exception $e) {
102
        dol_syslog($e->getMessage(), LOG_ERR);
103
        dol_htmloutput_mesg('Erreur pendant la génération.', '', 'error');
104
    }
105
106
}
107
108
/*
109
 * VIEW