* Actions */ if ($_POST['action'] == 'setcustomeraccountancycode') { $societe = new Societe($db); $result = $societe->fetch($_POST['socid']); $societe->code_compta = $_POST["customeraccountancycode"]; $result = $societe->update($societe->id, $user, 1, 1, 0); if ($result < 0) { $mesg = join(',', $societe->errors); } $POST["action"] = ""; $socid = $_POST["socid"]; } if ($_GET["action"] == 'attribute_prefix' && $user->rights->societe->creer) { $societe = new Societe($db, $_GET["socid"]); $societe->attribute_prefix($db, $_GET["socid"]); } // conditions de reglement if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer) { $societe = new Societe($db, $_GET["socid"]); $societe->cond_reglement = $_POST['cond_reglement_id']; $sql = "UPDATE " . MAIN_DB_PREFIX . "societe SET cond_reglement='" . $_POST['cond_reglement_id']; $sql .= "' WHERE rowid='" . $_GET["socid"] . "'"; $result = $db->query($sql); if (!$result) { dol_print_error($result); } } // mode de reglement if ($_POST["action"] == 'setmode' && $user->rights->societe->creer) { $societe = new Societe($db, $_GET["socid"]);
if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="nom"; /* * View */ llxHeader(); $thirdpartystatic=new Societe($db); if ($action == 'attribute_prefix') { $societe = new Societe($db, $socid); $societe->attribute_prefix($db, $socid); } if ($action == 'note') { $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$note."' WHERE rowid=".$socid; $result = $db->query($sql); } if ($mode == 'search') { if ($mode-search == 'soc') { $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; $sql.= " WHERE lower(s.nom) like '%".$db->escape(strtolower($socname))."%'"; $sql.= " AND s.entity = ".$conf->entity; }