} 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>'; } } if ($action == 'setdate' && !empty($_POST['datepday'])) { $object->fetch($id); $datepaye = dol_mktime(12, 0, 0, $_POST['datepmonth'], $_POST['datepday'], $_POST['datepyear']); $res = $object->update_date($datepaye); if ($res === 0) { $mesg = '<div class="ok">' . $langs->trans('PaymentDateUpdateSucceeded') . '</div>'; } else { $mesg = '<div class="error">' . $langs->trans('PaymentDateUpdateFailed') . '</div>'; }
$ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); if ($ret == 'html') print '<br>'; } /* * Confirmation de la validation du paiement */ if ($_GET['action'] == 'valide') { $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); if ($ret == 'html') print '<br>'; } if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num'])) { $res = $paiement->update_num($_POST['new_num']); if ($res === 0) { $mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>'; } else { $mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>'; } } if (!empty($_POST['action']) && $_POST['action'] == 'update_date' && !empty($_POST['reday'])) { $datepaye = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $res = $paiement->update_date($datepaye); if ($res === 0) {