$db->begin(); $object->fetch($id); $result = $object->delete(); if ($result > 0) { $db->commit(); header('Location: ' . DOL_URL_ROOT . '/fourn/facture/paiement.php'); exit; } else { $mesg = '<div class="error">' . $object->error . '</div>'; $db->rollback(); } } if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisseur->facture->valider) { $db->begin(); $object->fetch($id); if ($object->valide() >= 0) { $db->commit(); header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); exit; } else { $mesg = '<div class="error">' . $object->error . '</div>'; $db->rollback(); } } if ($action == 'setnum' && !empty($_POST['num_paiement'])) { $object->fetch($id); $res = $object->update_num($_POST['num_paiement']); if ($res === 0) { $mesg = '<div class="ok">' . $langs->trans('PaymentNumberUpdateSucceeded') . '</div>'; } else { $mesg = '<div class="error">' . $langs->trans('PaymentNumberUpdateFailed') . '</div>';
exit; } else { $mesg='<div class="error">'.$paiement->error.'</div>'; $db->rollback(); } } if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user->rights->fournisseur->facture->valider) { $db->begin(); $paiement = new PaiementFourn($db); $paiement->id = $_GET['id']; if ($paiement->valide() >= 0) { $db->commit(); Header('Location: fiche.php?id='.$paiement->id); exit; } else { $mesg='<div class="error">'.$paiement->error.'</div>'; $db->rollback(); } } /* * View