Beispiel #1
0
        $db->rollback();
    }
}
if ($action == 'setnum_paiement' && !empty($_POST['num_paiement'])) {
    $object->fetch($id);
    $res = $object->update_num($_POST['num_paiement']);
    if ($res === 0) {
        setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
    } else {
        setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
    }
}
if ($action == 'setdatep' && !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) {
        setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
    } else {
        setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
    }
}
/*
 * View
 */
llxHeader();
$thirdpartystatic = new Societe($db);
$result = $object->fetch($id);
if ($result <= 0) {
    dol_print_error($db, 'Payement ' . $id . ' not found in database');
    exit;