コード例 #1
0
        exit;
    } else {
        $mesg = '<div class="error">' . $object->error . '</div>';
        /* Fix bug 1485 : Reset action to avoid asking again confirmation on failure */
        $action = '';
    }
} elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) {
    $object->fetch($id);
    $result = $object->set_paid($user);
    if ($result < 0) {
        setEventMessage($object->error, 'errors');
    }
}
// Set supplier ref
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'));
    } elseif ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) {
        $object->fetch($id);
        $object->label = $_POST['label'];
        $result = $object->update($user);
        if ($result < 0) {