if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supprimer) { $db->begin(); $result = $payment->delete($user); if ($result > 0) { $db->commit(); header("Location: " . DOL_URL_ROOT . "/don/index.php"); exit; } else { setEventMessages($payment->error, $payment->errors, 'errors'); $db->rollback(); } } // Create payment if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->don->creer) { $db->begin(); $result = $payment->valide(); if ($result > 0) { $db->commit(); $factures = array(); // TODO Get all id of invoices linked to this payment foreach ($factures as $id) { $fac = new Facture($db); $fac->fetch($id); $outputlangs = $langs; if (!empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $fac->generateDocument($fac->modelpdf, $outputlangs); }