Code Duplication    Length = 10-12 lines in 2 locations

facture.php 1 location

@@ 129-138 (lines=10) @@
126
 *
127
 * Put here all code to do according to value of "action" parameter
128
 */
129
if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
130
    try{
131
        $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount);
132
        $handler->handle($command);
133
        Header("Location: card.php?id=" . $flight->getId());
134
    }catch (\Exception $e){
135
        dol_syslog($e->getMessage(),LOG_ERR);
136
        dol_htmloutput_mesg("Facture non créée", '', 'error');
137
    }
138
}
139
140
print load_fiche_titre("Créer facture");
141
$form = new Form($db);

generateMonthlyBilling.php 1 location

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