Esempio n. 1
0
            }
            if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
                $fac->generateDocument($fac->modelpdf, $outputlangs);
            }
        }
        header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id);
        exit;
    } else {
        $langs->load("errors");
        setEventMessage($langs->trans($object->error), 'errors');
        $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');
    }