Exemplo n.º 1
0
    $result = $object->set_date_livraison($user, $datelivraison);
    if ($result < 0) {
        $mesg = '<div class="error">' . $object->error . '</div>';
    }
} else {
    if ($action == 'classin' && $user->rights->fournisseur->commande->creer) {
        $object->fetch($id);
        $object->setProject($projectid);
    } else {
        if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) {
            $object->fetch($id);
            $result = $object->set_remise($user, $_POST['remise_percent']);
        } else {
            if ($action == 'setnote_public' && $user->rights->fournisseur->commande->creer) {
                $object->fetch($id);
                $result = $object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
                if ($result < 0) {
                    dol_print_error($db, $object->error);
                }
            } else {
                if ($action == 'setnote' && $user->rights->fournisseur->commande->creer) {
                    $object->fetch($id);
                    $result = $object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
                    if ($result < 0) {
                        dol_print_error($db, $object->error);
                    }
                } else {
                    if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver) {
                        $order = new CommandeFournisseur($db);
                        $result = $order->fetch($id);
                        if ($order->statut == 5 || $order->statut == 6 || $order->statut == 7 || $order->statut == 9) {