$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) { if ($order->statut == 5) { $newstatus = 4; } // Received->Received partially if ($order->statut == 6) { $newstatus = 2; }