$object->socid = $fourn->id;
        $ret = $object->fetch_thirdparty();
        if ($ret < 0) {
            dol_print_error($db, $object->error);
        }
    }
}
$permissionnote = $user->rights->fournisseur->commande->creer;
// Used by the include of actions_setnotes.inc.php
/*
 * Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not includ_once
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) {
    $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier', 'alpha'));
    if ($result < 0) {
        dol_print_error($db, $object->error);
    }
}
// conditions de reglement
if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) {
    $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} else {
    if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) {
        $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
    }
}
// date de livraison
if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer) {
    $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));