$result = restrictedArea($user, 'facture', $id, ''); $object = new Facture($db); $object->fetch($id); /******************************************************************************/ /* Actions */ /******************************************************************************/ if ($action == 'setnote_public' && $user->rights->facture->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->facture->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); } } } /******************************************************************************/ /* Affichage fiche */ /******************************************************************************/ llxHeader(); $form = new Form($db); if ($id > 0 || !empty($ref)) { $object = new Facture($db); $object->fetch($id, $ref); $soc = new Societe($db); $soc->fetch($object->socid);