Synchro
This commit is contained in:
parent
c983f847bf
commit
dcd22f962e
@ -105,7 +105,7 @@ if ($_POST["action"] == 'add')
|
||||
if ($id)
|
||||
{
|
||||
propale_pdf_create($db, $id, $_POST["modelpdf"]);
|
||||
$_GET["propalid"] = $id;
|
||||
Header ("Location: propal.php?propalid=$id");
|
||||
}
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ if ($_GET["propalid"])
|
||||
print '<td align="center">';
|
||||
print $html->select_tva("np_tva_tx") . '</td>';
|
||||
print '<td align="center"><input type="text" size="3" value="1" name="np_qty"></td>';
|
||||
print '<td align="center"><input type="text" size="3" value="0" name="np_remise"> %</td>';
|
||||
print '<td align="center"><input type="text" size="3" value="'.$societe->remise_client.'" name="np_remise"> %</td>';
|
||||
print '<td align="right"><input type="text" size="6" name="np_price"></td>';
|
||||
print '<td align="center"><input type="submit" value="'.$langs->trans("Add").'" name="addproduct"></td>';
|
||||
print '</tr>';
|
||||
@ -518,7 +518,7 @@ if ($_GET["propalid"])
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td> </td><td colspan=\"2\"><select name=\"idprod\">$opt</select></td>";
|
||||
print '<td align="center"><input type="text" size="3" name="qty" value="1"></td>';
|
||||
print '<td align="center"><input type="text" size="3" name="remise" value="0"> %</td>';
|
||||
print '<td align="center"><input type="text" size="3" name="remise" value="'.$societe->remise_client.'"> %</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center"><input type="submit" value="'.$langs->trans("Add").'" name="addligne"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -28,81 +28,110 @@ if ($conf->compta->enabled || $conf->banque->enabled || $conf->caisse->enabled)
|
||||
if ($conf->produit->enabled || $conf->service->enabled) $nbofentries++;
|
||||
if ($conf->webcal->enabled) $nbofentries++;
|
||||
|
||||
print '<table cellpadding="0" cellspacing="0" width="100%"><tr>';
|
||||
|
||||
if (! $nbofentries) {
|
||||
print '<td> </td>';
|
||||
}
|
||||
else
|
||||
if ($conf->commercial->enabled)
|
||||
{
|
||||
$widthtd=floor(100/$nbofentries);
|
||||
|
||||
if ($conf->commercial->enabled)
|
||||
{
|
||||
$langs->load("commercial");
|
||||
$langs->load("commercial");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial") { $class="menusel"; }
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/comm\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
|
||||
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
|
||||
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/comm/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Commercial").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if ($conf->adherent->enabled)
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "commercial")
|
||||
{
|
||||
$langs->load("members");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "adherent") { $class="menusel"; }
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/adherents\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
|
||||
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
|
||||
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/adherents/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Members").'</a>';
|
||||
print '</td>';
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
|
||||
if ($conf->compta->enabled || $conf->banque->enabled || $conf->caisse->enabled)
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/comm\/",$_SERVER["PHP_SELF"]))
|
||||
{
|
||||
$langs->load("compta");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "compta") { $class="menusel"; }
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/compta\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
|
||||
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
|
||||
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/compta/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Accountancy")."/".$langs->trans("Treasury").'</a>';
|
||||
print '</td>';
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
|
||||
if ($conf->produit->enabled || $conf->service->enabled)
|
||||
else
|
||||
{
|
||||
$langs->load("products");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "product") { $class="menusel"; }
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/product\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
|
||||
$chaine="";
|
||||
if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); }
|
||||
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
|
||||
if ($conf->service->enabled) { $chaine.="Services"; }
|
||||
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
|
||||
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/product/?type=0"'.($target?" target=$target":"").'>'.$chaine.'</a>';
|
||||
print '</td>';
|
||||
$class = 'class="tmenu"';
|
||||
}
|
||||
|
||||
if ($conf->webcal->enabled)
|
||||
{
|
||||
$langs->load("other");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "webcalendar") { $class="menusel"; }
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/projet\/",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/webcalendar\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
|
||||
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
|
||||
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/projet/webcal.php"'.($target?" target=$target":"").'>'.$langs->trans("Calendar").'</a>';
|
||||
print '</td>';
|
||||
};
|
||||
|
||||
print '<a '.$class.' href="'.DOL_URL_ROOT.'/comm/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Commercial").'</a>';
|
||||
|
||||
}
|
||||
|
||||
print '</tr></table>';
|
||||
if ($conf->adherent->enabled)
|
||||
{
|
||||
$langs->load("members");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "adherent")
|
||||
{
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/adherents\/",$_SERVER["PHP_SELF"]))
|
||||
{
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
|
||||
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/adherents/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Members").'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if ($conf->compta->enabled || $conf->banque->enabled || $conf->caisse->enabled)
|
||||
{
|
||||
$langs->load("compta");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "compta")
|
||||
{
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/compta\/",$_SERVER["PHP_SELF"]))
|
||||
{
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
}
|
||||
|
||||
print '<a '.$class.' href="'.DOL_URL_ROOT.'/compta/index.php"'.($target?" target=$target":"").'>'.$langs->trans("Accountancy")."/".$langs->trans("Treasury").'</a>';
|
||||
|
||||
}
|
||||
|
||||
if ($conf->produit->enabled || $conf->service->enabled)
|
||||
{
|
||||
$langs->load("products");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "product")
|
||||
{
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/product\/",$_SERVER["PHP_SELF"]))
|
||||
{
|
||||
$class='class="tmenu" id="sel"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$class = 'class="tmenu"';
|
||||
}
|
||||
$chaine="";
|
||||
if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); }
|
||||
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
|
||||
if ($conf->service->enabled) { $chaine.="Services"; }
|
||||
|
||||
|
||||
print '<a '.$class.' href="'.DOL_URL_ROOT.'/product/?type=0"'.($target?" target=$target":"").'>'.$chaine.'</a>';
|
||||
|
||||
}
|
||||
|
||||
if ($conf->webcal->enabled)
|
||||
{
|
||||
$langs->load("other");
|
||||
|
||||
$class="";
|
||||
if ($_SESSION["topmenu"] && $_SESSION["topmenu"] == "webcalendar") { $class="menusel"; }
|
||||
elseif (ereg("^".DOL_URL_ROOT."\/projet\/",$_SERVER["PHP_SELF"]) || ereg("^".DOL_URL_ROOT."\/webcalendar\/",$_SERVER["PHP_SELF"])) { $class="menusel"; }
|
||||
|
||||
print '<td class="'.$class.'" width="'.$widthtd.'%" align=center>';
|
||||
print '<a class="'.$class.'" href="'.DOL_URL_ROOT.'/projet/webcal.php"'.($target?" target=$target":"").'>'.$langs->trans("Calendar").'</a>';
|
||||
print '</td>';
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@ -194,6 +194,8 @@ if ($_POST["action"] == "set")
|
||||
// Si creation utilisateur admin demandée, on le crée
|
||||
if (isset($_POST["db_create_user"]) && $_POST["db_create_user"] == "on")
|
||||
{
|
||||
dolibarr_syslog ("Creation de l'utilisateur : ".$dolibarr_main_db_user);
|
||||
|
||||
$conf = new Conf();
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->name = "mysql";
|
||||
@ -206,16 +208,18 @@ if ($_POST["action"] == "set")
|
||||
$sql .= "(Host,User,password)";
|
||||
$sql .= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_user',password('$dolibarr_main_db_pass'))";
|
||||
|
||||
$db->query($sql);
|
||||
|
||||
print $db->query($sql);
|
||||
|
||||
$sql = "INSERT INTO db ";
|
||||
$sql .= "(Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv)";
|
||||
$sql .= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_name','$dolibarr_main_db_user'";
|
||||
$sql .= ",'Y','Y','Y','Y','Y','Y','Y','Y')";
|
||||
|
||||
print $sql;
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
|
||||
dolibarr_syslog("flush privileges");
|
||||
$db->query("flush privileges");
|
||||
|
||||
print "<tr><td>Création de l'utilisateur : $dolibarr_main_db_user</td><td>OK</td></tr>";
|
||||
|
||||
@ -491,6 +491,7 @@ class Propal
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ class Societe {
|
||||
$sql .= ", s.siret, s.capital, s.ape, s.tva_intra, s.rubrique, s.fk_effectif";
|
||||
$sql .= ", e.libelle as effectif, e.id as effectif_id";
|
||||
$sql .= ", s.fk_forme_juridique as forme_juridique_code, fj.libelle as forme_juridique";
|
||||
$sql .= ", s.fk_departement, s.fk_pays, s.fk_stcomm";
|
||||
$sql .= ", s.fk_departement, s.fk_pays, s.fk_stcomm, s.remise_client";
|
||||
$sql .= ", p.libelle as pays";
|
||||
$sql .= ", st.libelle as stcomm";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -230,6 +230,8 @@ class Societe {
|
||||
$this->forme_juridique = $obj->forme_juridique;
|
||||
|
||||
$this->prefix_comm = $obj->prefix_comm;
|
||||
|
||||
$this->remise_client = $obj->remise_client;
|
||||
|
||||
$this->client = $obj->client;
|
||||
$this->fournisseur = $obj->fournisseur;
|
||||
@ -414,6 +416,32 @@ class Societe {
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Définit la société comme un client
|
||||
*
|
||||
*
|
||||
*/
|
||||
function set_remise_client($remise, $user)
|
||||
{
|
||||
if ($this->id)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
||||
$sql .= " SET remise_client = '".$remise."'";
|
||||
$sql .= " WHERE idp = " . $this->id .";";
|
||||
|
||||
$this->db->query($sql);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise ";
|
||||
$sql .= " ( datec, fk_soc, remise_client, fk_user_author )";
|
||||
$sql .= " VALUES (now(),".$this->id.",'".$remise."',".$user->id.")";
|
||||
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Renvoie le nom d'une societe a partir d'un id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user