forked from Wavyzz/dolibarr
Prefix en dur "llx_" remplac par constante "MAIN_DB_PREFIX".
This commit is contained in:
@@ -42,9 +42,9 @@ $var=True;
|
|||||||
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
|
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
|
||||||
{
|
{
|
||||||
if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){
|
if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){
|
||||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."',visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."',visible=0";
|
||||||
}else{
|
}else{
|
||||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."',visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."',visible=0";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
@@ -63,7 +63,7 @@ if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
|
|||||||
|
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = '$name', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '$name', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ if ($action == 'set')
|
|||||||
|
|
||||||
if ($action == 'unset')
|
if ($action == 'unset')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_const WHERE name = '$name'";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = '$name'";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -267,7 +267,7 @@ function form_constantes($tableau){
|
|||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
foreach($tableau as $const){
|
foreach($tableau as $const){
|
||||||
$sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE name='$const'";
|
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='$const'";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result && ($db->num_rows() == 1)) {
|
if ($result && ($db->num_rows() == 1)) {
|
||||||
$obj = $db->fetch_object(0);
|
$obj = $db->fetch_object(0);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ llxHeader();
|
|||||||
|
|
||||||
print_barre_liste("Mise a jour de tous les livres", $page, $PHP_SELF);
|
print_barre_liste("Mise a jour de tous les livres", $page, $PHP_SELF);
|
||||||
|
|
||||||
$sql = "SELECT l.rowid FROM llx_livre as l";
|
$sql = "SELECT l.rowid FROM ".MAIN_DB_PREFIX."livre as l";
|
||||||
|
|
||||||
if ( $db->query($sql) )
|
if ( $db->query($sql) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ llxHeader();
|
|||||||
|
|
||||||
print_barre_liste("Mise a jour de tous les livres", $page, $PHP_SELF);
|
print_barre_liste("Mise a jour de tous les livres", $page, $PHP_SELF);
|
||||||
|
|
||||||
$sql = "SELECT l.rowid FROM llx_livre as l";
|
$sql = "SELECT l.rowid FROM ".MAIN_DB_PREFIX."livre as l";
|
||||||
|
|
||||||
if ( $db->query($sql) )
|
if ( $db->query($sql) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ $modules["BOUTIQUE_ALBUM"][3] = "Module de gestion des albums";
|
|||||||
|
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = '".$value."', value='1', visible = 0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '".$value."', value='1', visible = 0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -58,7 +58,7 @@ if ($action == 'set')
|
|||||||
|
|
||||||
if ($action == 'reset')
|
if ($action == 'reset')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = '".$value."', value='0', visible = 0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '".$value."', value='0', visible = 0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,14 +27,14 @@ print_titre("Boites affich
|
|||||||
if ($HTTP_POST_VARS["action"] == 'add')
|
if ($HTTP_POST_VARS["action"] == 'add')
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_boxes (box_id, position) values (".$HTTP_POST_VARS["rowid"].",".$HTTP_POST_VARS["constvalue"].");";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$HTTP_POST_VARS["rowid"].",".$HTTP_POST_VARS["constvalue"].");";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_boxes WHERE rowid=$rowid";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=$rowid";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ $pos[0] = "Homepage";
|
|||||||
|
|
||||||
print '<table class="border" cellpadding="3" cellspacing="0">';
|
print '<table class="border" cellpadding="3" cellspacing="0">';
|
||||||
|
|
||||||
$sql = "SELECT b.rowid, b.box_id, b.position, d.name FROM llx_boxes as b, llx_boxes_def as d where b.box_id = d.rowid";
|
$sql = "SELECT b.rowid, b.box_id, b.position, d.name FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d where b.box_id = d.rowid";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ print "<p>";
|
|||||||
print_titre("Boites disponibles");
|
print_titre("Boites disponibles");
|
||||||
print '<table class="border" cellpadding="3" cellspacing="0">';
|
print '<table class="border" cellpadding="3" cellspacing="0">';
|
||||||
|
|
||||||
$sql = "SELECT rowid, name, file FROM llx_boxes_def";
|
$sql = "SELECT rowid, name, file FROM ".MAIN_DB_PREFIX."boxes_def";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ $commande_addon_var = COMMANDE_ADDON;
|
|||||||
|
|
||||||
if ($action == 'setmod')
|
if ($action == 'setmod')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'COMMANDE_ADDON', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'COMMANDE_ADDON', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require("./pre.inc.php");
|
|||||||
|
|
||||||
if ($action == 'nbprod' && $user->admin)
|
if ($action == 'nbprod' && $user->admin)
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'EXPEDITION_NEW_FORM_NB_PRODUCT', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_NEW_FORM_NB_PRODUCT', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -41,7 +41,7 @@ if (!$user->admin)
|
|||||||
|
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO llx_propal_model_pdf (nom) VALUES ('".$value."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -50,7 +50,7 @@ if ($action == 'set')
|
|||||||
}
|
}
|
||||||
if ($action == 'del')
|
if ($action == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_propal_model_pdf WHERE nom='".$value."'";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom='".$value."'";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -64,7 +64,7 @@ $expedition_addon_var_pdf = EXPEDITION_ADDON_PDF;
|
|||||||
|
|
||||||
if ($action == 'setpdf')
|
if ($action == 'setpdf')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'EXPEDITION_ADDON_PDF', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON_PDF', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -75,7 +75,7 @@ if ($action == 'setpdf')
|
|||||||
/*
|
/*
|
||||||
* On la set active
|
* On la set active
|
||||||
*/
|
*/
|
||||||
$sql = "INSERT INTO llx_propal_model_pdf (nom) VALUES ('".$value."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -87,7 +87,7 @@ $expedition_addon_var = EXPEDITION_ADDON;
|
|||||||
|
|
||||||
if ($action == 'setmod')
|
if ($action == 'setmod')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'EXPEDITION_ADDON', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -161,7 +161,7 @@ print '</table>';
|
|||||||
|
|
||||||
$def = array();
|
$def = array();
|
||||||
|
|
||||||
$sql = "SELECT nom FROM llx_propal_model_pdf";
|
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ if ($action == 'save')
|
|||||||
if(isset($$external_rss_url)) {
|
if(isset($$external_rss_url)) {
|
||||||
$external_rss_title = "external_rss_title_" . $i;
|
$external_rss_title = "external_rss_title_" . $i;
|
||||||
$external_rss_urlrss = "external_rss_urlrss_" . $i;
|
$external_rss_urlrss = "external_rss_urlrss_" . $i;
|
||||||
$sql = "REPLACE INTO llx_const SET name = '" . "EXTERNAL_RSS_URL_" . $i . "', value='".$$external_rss_url."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '" . "EXTERNAL_RSS_URL_" . $i . "', value='".$$external_rss_url."', visible=0";
|
||||||
$sql1 = "REPLACE INTO llx_const SET name = '" . "EXTERNAL_RSS_TITLE_" . $i . "', value='".$$external_rss_title."', visible=0";
|
$sql1 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '" . "EXTERNAL_RSS_TITLE_" . $i . "', value='".$$external_rss_title."', visible=0";
|
||||||
$sql2 = "REPLACE INTO llx_const SET name = '" . "EXTERNAL_RSS_URLRSS_" . $i . "', value='".$$external_rss_urlrss."', visible=0";
|
$sql2 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '" . "EXTERNAL_RSS_URLRSS_" . $i . "', value='".$$external_rss_urlrss."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql) && $db->query($sql1) && $db->query($sql2))
|
if ($db->query($sql) && $db->query($sql1) && $db->query($sql2))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ $facture_rib_number_var = FACTURE_RIB_NUMBER;
|
|||||||
|
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'FACTURE_ADDON', value='".$value."', visible=0, type='chaine'";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'FACTURE_ADDON', value='".$value."', visible=0, type='chaine'";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -49,7 +49,7 @@ if ($action == 'set')
|
|||||||
|
|
||||||
if ($action == 'setrib')
|
if ($action == 'setrib')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'FACTURE_RIB_NUMBER', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'FACTURE_RIB_NUMBER', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -61,7 +61,7 @@ if ($action == 'setrib')
|
|||||||
|
|
||||||
if ($action == 'setpdf')
|
if ($action == 'setpdf')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'FACTURE_ADDON_PDF', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'FACTURE_ADDON_PDF', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -192,7 +192,7 @@ print '<td> </td>';
|
|||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
print '<tr class="pair"><td><select name="value">';
|
print '<tr class="pair"><td><select name="value">';
|
||||||
print '<option value="0">Aucun</option>';
|
print '<option value="0">Aucun</option>';
|
||||||
$sql = "SELECT rowid, label FROM llx_bank_account";
|
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_account";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ $ficheinter_addon_var_pdf = FICHEINTER_ADDON_PDF;
|
|||||||
|
|
||||||
if ($action == 'setpdf')
|
if ($action == 'setpdf')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'FICHEINTER_ADDON_PDF', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'FICHEINTER_ADDON_PDF', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require("./pre.inc.php");
|
|||||||
|
|
||||||
if ($HTTP_POST_VARS["action"] == 'changetheme')
|
if ($HTTP_POST_VARS["action"] == 'changetheme')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'MAIN_THEME', value='".$HTTP_POST_VARS["theme"]."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'MAIN_THEME', value='".$HTTP_POST_VARS["theme"]."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,19 +23,19 @@ require (DOL_DOCUMENT_ROOT."/lib/ldap.lib.php");
|
|||||||
|
|
||||||
if ($_GET["action"] == 'setvalue' && $user->admin)
|
if ($_GET["action"] == 'setvalue' && $user->admin)
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'LDAP_SERVER_HOST', value='".$HTTP_POST_VARS["host"]."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'LDAP_SERVER_HOST', value='".$HTTP_POST_VARS["host"]."', visible=0";
|
||||||
|
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'LDAP_SERVER_DN', value='".$HTTP_POST_VARS["dn"]."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'LDAP_SERVER_DN', value='".$HTTP_POST_VARS["dn"]."', visible=0";
|
||||||
|
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'LDAP_SERVER_LOGIN', value='".$HTTP_POST_VARS["login"]."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'LDAP_SERVER_LOGIN', value='".$HTTP_POST_VARS["login"]."', visible=0";
|
||||||
|
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'LDAP_SERVER_PASS', value='".$HTTP_POST_VARS["pass"]."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'LDAP_SERVER_PASS', value='".$HTTP_POST_VARS["pass"]."', visible=0";
|
||||||
|
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require("./pre.inc.php");
|
|||||||
|
|
||||||
if ($action == 'nbprod' && $user->admin)
|
if ($action == 'nbprod' && $user->admin)
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'PROPALE_NEW_FORM_NB_PRODUCT', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_NEW_FORM_NB_PRODUCT', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -43,7 +43,7 @@ if (!$user->admin)
|
|||||||
|
|
||||||
if ($action == 'set')
|
if ($action == 'set')
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO llx_propal_model_pdf (nom) VALUES ('".$value."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -52,7 +52,7 @@ if ($action == 'set')
|
|||||||
}
|
}
|
||||||
if ($action == 'del')
|
if ($action == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_propal_model_pdf WHERE nom='".$value."'";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom='".$value."'";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -66,7 +66,7 @@ $propale_addon_var_pdf = PROPALE_ADDON_PDF;
|
|||||||
|
|
||||||
if ($action == 'setpdf')
|
if ($action == 'setpdf')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'PROPALE_ADDON_PDF', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_ADDON_PDF', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -77,7 +77,7 @@ if ($action == 'setpdf')
|
|||||||
/*
|
/*
|
||||||
* On la set active
|
* On la set active
|
||||||
*/
|
*/
|
||||||
$sql = "INSERT INTO llx_propal_model_pdf (nom) VALUES ('".$value."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -89,7 +89,7 @@ $propale_addon_var = PROPALE_ADDON;
|
|||||||
|
|
||||||
if ($action == 'setmod')
|
if ($action == 'setmod')
|
||||||
{
|
{
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'PROPALE_ADDON', value='".$value."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PROPALE_ADDON', value='".$value."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@@ -163,7 +163,7 @@ print '</table>';
|
|||||||
|
|
||||||
$def = array();
|
$def = array();
|
||||||
|
|
||||||
$sql = "SELECT nom FROM llx_propal_model_pdf";
|
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ llxHeader();
|
|||||||
|
|
||||||
print_barre_liste("Liste des tables", $page, $PHP_SELF);
|
print_barre_liste("Liste des tables", $page, $PHP_SELF);
|
||||||
|
|
||||||
$sql = "SELECT name, loaded FROM llx_sqltables";
|
$sql = "SELECT name, loaded FROM ".MAIN_DB_PREFIX."sqltables";
|
||||||
|
|
||||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||||
print '<TR class="liste_titre">';
|
print '<TR class="liste_titre">';
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ if ($user->admin)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){
|
if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){
|
||||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."'";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."'";
|
||||||
}else{
|
}else{
|
||||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ if ($user->admin)
|
|||||||
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_const WHERE rowid='$rowid'";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE rowid='$rowid'";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result)
|
||||||
@@ -69,9 +69,9 @@ if ($user->admin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($all==1){
|
if ($all==1){
|
||||||
$sql = "SELECT rowid, name, value, type, note FROM llx_const ORDER BY name ASC";
|
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC";
|
||||||
}else{
|
}else{
|
||||||
$sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE visible = 1 ORDER BY name ASC";
|
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE visible = 1 ORDER BY name ASC";
|
||||||
}
|
}
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ print '<TD>Nom</TD>';
|
|||||||
print '<TD>Valeur</TD>';
|
print '<TD>Valeur</TD>';
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
$sql = "SELECT rowid, name, value, type, note FROM llx_const ORDER BY name ASC";
|
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ require("./pre.inc.php");
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM llx_product"; $productsid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$num = $db->num_rows(); $i = 0;
|
$num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
||||||
|
|
||||||
$sql = "SELECT idp FROM llx_societe"; $societesid = array();
|
$sql = "SELECT idp FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
||||||
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
||||||
|
|
||||||
|
|||||||
@@ -38,16 +38,16 @@ include_once "../../product.class.php";
|
|||||||
include_once "../../paiement.class.php";
|
include_once "../../paiement.class.php";
|
||||||
include_once "../../contrat/contrat.class.php";
|
include_once "../../contrat/contrat.class.php";
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM llx_product"; $productsid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
|
||||||
if ($db->query($sql)) {
|
if ($db->query($sql)) {
|
||||||
$num = $db->num_rows(); $i = 0;
|
$num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
|
||||||
|
|
||||||
$sql = "SELECT idp FROM llx_societe"; $societesid = array();
|
$sql = "SELECT idp FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
|
||||||
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM llx_commande"; $commandesid = array();
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
|
||||||
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
|
||||||
while ($i < $num) { $row = $db->fetch_row($i); $commandesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
while ($i < $num) { $row = $db->fetch_row($i); $commandesid[$i] = $row[0]; $i++; } } else { print "err"; }
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ $err = 0;
|
|||||||
/*
|
/*
|
||||||
* Factures
|
* Factures
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT rowid FROM llx_facture";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
@@ -85,7 +85,7 @@ else
|
|||||||
$err++;
|
$err++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "DELETE FROM llx_const WHERE name = 'MAIN_NEED_UPDATE'";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'MAIN_NEED_UPDATE'";
|
||||||
if (! $db->query($sql))
|
if (! $db->query($sql))
|
||||||
{
|
{
|
||||||
print "Erreur #100";
|
print "Erreur #100";
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ $def = array();
|
|||||||
if ($action == 'save')
|
if ($action == 'save')
|
||||||
{
|
{
|
||||||
if(trim($phpwebcalendar_pass) == trim($phpwebcalendar_pass2)) {
|
if(trim($phpwebcalendar_pass) == trim($phpwebcalendar_pass2)) {
|
||||||
$sql = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_URL', value='".$phpwebcalendar_url."', visible=0";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_URL', value='".$phpwebcalendar_url."', visible=0";
|
||||||
|
|
||||||
$sql1 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_HOST', value='".$phpwebcalendar_host."', visible=0";
|
$sql1 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_HOST', value='".$phpwebcalendar_host."', visible=0";
|
||||||
$sql2 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_DBNAME', value='".$phpwebcalendar_dbname."', visible=0";
|
$sql2 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_DBNAME', value='".$phpwebcalendar_dbname."', visible=0";
|
||||||
$sql3 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_USER', value='".$phpwebcalendar_user."', visible=0";
|
$sql3 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_USER', value='".$phpwebcalendar_user."', visible=0";
|
||||||
$sql4 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_PASS', value='".$phpwebcalendar_pass."', visible=0";
|
$sql4 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_PASS', value='".$phpwebcalendar_pass."', visible=0";
|
||||||
|
|
||||||
if ($db->query($sql) && $db->query($sql1) && $db->query($sql2) && $db->query($sql3) && $db->query($sql4))
|
if ($db->query($sql) && $db->query($sql1) && $db->query($sql2) && $db->query($sql3) && $db->query($sql4))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Auteur {
|
|||||||
*/
|
*/
|
||||||
Function create($user) {
|
Function create($user) {
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_auteur (fk_user_author) VALUES (".$user->id.")";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."auteur (fk_user_author) VALUES (".$user->id.")";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@ class Auteur {
|
|||||||
{
|
{
|
||||||
$ga = array();
|
$ga = array();
|
||||||
|
|
||||||
$sql = "SELECT rowid, nom FROM llx_auteur ORDER BY nom";
|
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."auteur ORDER BY nom";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ class Auteur {
|
|||||||
Function update($id, $user)
|
Function update($id, $user)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE llx_auteur ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."auteur ";
|
||||||
$sql .= " SET nom = '" . trim($this->nom) ."'";
|
$sql .= " SET nom = '" . trim($this->nom) ."'";
|
||||||
|
|
||||||
$sql .= " WHERE rowid = " . $id;
|
$sql .= " WHERE rowid = " . $id;
|
||||||
@@ -119,7 +119,7 @@ class Auteur {
|
|||||||
{
|
{
|
||||||
$sql = "SELECT a.rowid, ";
|
$sql = "SELECT a.rowid, ";
|
||||||
}
|
}
|
||||||
$sql .= " a.title FROM llx_livre as a, llx_livre_to_auteur as l";
|
$sql .= " a.title FROM ".MAIN_DB_PREFIX."livre as a, ".MAIN_DB_PREFIX."livre_to_auteur as l";
|
||||||
$sql .= " WHERE a.rowid = l.fk_livre AND l.fk_auteur = ".$this->id;
|
$sql .= " WHERE a.rowid = l.fk_livre AND l.fk_auteur = ".$this->id;
|
||||||
if ($status)
|
if ($status)
|
||||||
{
|
{
|
||||||
@@ -156,7 +156,7 @@ class Auteur {
|
|||||||
*/
|
*/
|
||||||
Function fetch ($id) {
|
Function fetch ($id) {
|
||||||
|
|
||||||
$sql = "SELECT rowid, nom FROM llx_auteur WHERE rowid = $id";
|
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."auteur WHERE rowid = $id";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ class Auteur {
|
|||||||
|
|
||||||
if (sizeof($livres) == 0)
|
if (sizeof($livres) == 0)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_auteur WHERE rowid = $this->id ";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."auteur WHERE rowid = $this->id ";
|
||||||
$return = $this->db->query($sql) ;
|
$return = $this->db->query($sql) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ $offset = $limit * $page ;
|
|||||||
|
|
||||||
print_barre_liste("Liste des Auteurs", $page, $PHP_SELF);
|
print_barre_liste("Liste des Auteurs", $page, $PHP_SELF);
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.nom FROM llx_auteur as e";
|
$sql = "SELECT e.rowid, e.nom FROM ".MAIN_DB_PREFIX."auteur as e";
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||||
$sql .= $db->plimit( $limit ,$offset);
|
$sql .= $db->plimit( $limit ,$offset);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Editeur {
|
|||||||
*/
|
*/
|
||||||
Function create($user) {
|
Function create($user) {
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_editeur (fk_user_author) VALUES (".$user->id.")";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."editeur (fk_user_author) VALUES (".$user->id.")";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@ class Editeur {
|
|||||||
{
|
{
|
||||||
$ga = array();
|
$ga = array();
|
||||||
|
|
||||||
$sql = "SELECT rowid, nom FROM llx_editeur ORDER BY nom";
|
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur ORDER BY nom";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ class Editeur {
|
|||||||
Function update($id, $user)
|
Function update($id, $user)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE llx_editeur ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."editeur ";
|
||||||
$sql .= " SET nom = '" . trim($this->nom) ."'";
|
$sql .= " SET nom = '" . trim($this->nom) ."'";
|
||||||
|
|
||||||
$sql .= " WHERE rowid = " . $id;
|
$sql .= " WHERE rowid = " . $id;
|
||||||
@@ -110,7 +110,7 @@ class Editeur {
|
|||||||
*/
|
*/
|
||||||
Function fetch ($id) {
|
Function fetch ($id) {
|
||||||
|
|
||||||
$sql = "SELECT rowid, nom FROM llx_editeur WHERE rowid = $id";
|
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur WHERE rowid = $id";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ class Editeur {
|
|||||||
{
|
{
|
||||||
$ga = array();
|
$ga = array();
|
||||||
|
|
||||||
$sql = "SELECT a.rowid, a.title FROM llx_livre as a";
|
$sql = "SELECT a.rowid, a.title FROM ".MAIN_DB_PREFIX."livre as a";
|
||||||
$sql .= " WHERE a.fk_editeur = ".$this->id;
|
$sql .= " WHERE a.fk_editeur = ".$this->id;
|
||||||
$sql .= " ORDER BY a.title";
|
$sql .= " ORDER BY a.title";
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ class Editeur {
|
|||||||
|
|
||||||
if (sizeof($livres) == 0)
|
if (sizeof($livres) == 0)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_editeur WHERE rowid = $this->id ";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."editeur WHERE rowid = $this->id ";
|
||||||
$return = $this->db->query($sql) ;
|
$return = $this->db->query($sql) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ $pagenext = $page + 1;
|
|||||||
print '<div class="titre">Bookmark</div>';
|
print '<div class="titre">Bookmark</div>';
|
||||||
|
|
||||||
$sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, st.libelle as stcomm, b.rowid as bid, b.author";
|
$sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, st.libelle as stcomm, b.rowid as bid, b.author";
|
||||||
$sql .= " FROM llx_societe as s, c_stcomm as st, llx_bookmark as b";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."bookmark as b";
|
||||||
$sql .= " WHERE b.fk_soc = s.idp AND s.fk_stcomm = st.id AND s.datea is not null";
|
$sql .= " WHERE b.fk_soc = s.idp AND s.fk_stcomm = st.id AND s.datea is not null";
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
|
||||||
|
|||||||
@@ -84,7 +84,8 @@ llxHeader();
|
|||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM llx_societe as s, c_stcomm as st ";
|
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st ";
|
||||||
$sql .= " WHERE s.fk_stcomm=st.id";
|
$sql .= " WHERE s.fk_stcomm=st.id";
|
||||||
$sql .= " AND s.idp = $socid";
|
$sql .= " AND s.idp = $socid";
|
||||||
|
|
||||||
@@ -233,7 +234,7 @@ if ($socid > 0)
|
|||||||
print "<td>Fax</td><td>Email</td>";
|
print "<td>Fax</td><td>Email</td>";
|
||||||
|
|
||||||
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
|
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
|
||||||
$sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
|
||||||
$sql .= " WHERE a.fk_soc = $objsoc->idp ";
|
$sql .= " WHERE a.fk_soc = $objsoc->idp ";
|
||||||
$sql .= " AND u.rowid = a.fk_user_author";
|
$sql .= " AND u.rowid = a.fk_user_author";
|
||||||
$sql .= " AND c.id=a.fk_action ";
|
$sql .= " AND c.id=a.fk_action ";
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if ($user->societe_id > 0)
|
|||||||
print_titre("Caisse");
|
print_titre("Caisse");
|
||||||
|
|
||||||
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_paiement as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiement as f";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@ if ($db->query($sql))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_paiementfourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as f";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ $titre_mois = strftime("%B %Y", $time);
|
|||||||
print_fiche_titre("Journal de caisse");
|
print_fiche_titre("Journal de caisse");
|
||||||
|
|
||||||
$sql = "SELECT f.amount, date_format(f.datep,'%Y-%m') as dm";
|
$sql = "SELECT f.amount, date_format(f.datep,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_paiement as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiement as f";
|
||||||
$sql .= " WHERE date_format(f.datep,'%Y%m') = ".$annee.$mois;
|
$sql .= " WHERE date_format(f.datep,'%Y%m') = ".$annee.$mois;
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
@@ -73,7 +73,7 @@ if ($db->query($sql))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%d') as dm";
|
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%d') as dm";
|
||||||
$sql .= " FROM llx_paiementfourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as f";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Deplacement
|
|||||||
*/
|
*/
|
||||||
Function create($user)
|
Function create($user)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO llx_deplacement (datec, fk_user_author) VALUES (now(), $user->id)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."deplacement (datec, fk_user_author) VALUES (now(), $user->id)";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@@ -61,7 +61,7 @@ class Deplacement
|
|||||||
if (strlen($this->km)==0)
|
if (strlen($this->km)==0)
|
||||||
$this->km = 0;
|
$this->km = 0;
|
||||||
|
|
||||||
$sql = "UPDATE llx_deplacement ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."deplacement ";
|
||||||
$sql .= " SET km = $this->km";
|
$sql .= " SET km = $this->km";
|
||||||
$sql .= " , dated = '".$this->db->idate($this->date)."'";
|
$sql .= " , dated = '".$this->db->idate($this->date)."'";
|
||||||
$sql .= " , fk_user = $this->userid";
|
$sql .= " , fk_user = $this->userid";
|
||||||
@@ -86,7 +86,7 @@ class Deplacement
|
|||||||
Function fetch ($id)
|
Function fetch ($id)
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, fk_user, km, fk_soc,".$this->db->pdate("dated")." as dated";
|
$sql = "SELECT rowid, fk_user, km, fk_soc,".$this->db->pdate("dated")." as dated";
|
||||||
$sql .= " FROM llx_deplacement WHERE rowid = $id";
|
$sql .= " FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = $id";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class Deplacement
|
|||||||
*/
|
*/
|
||||||
Function delete($id)
|
Function delete($id)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_deplacement WHERE rowid = $id";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = $id";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ $pageprev = $page - 1;
|
|||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
$sql = "SELECT s.nom,s.idp, d.km,".$db->pdate("d.dated")." as dd, u.name, u.firstname, d.rowid";
|
$sql = "SELECT s.nom,s.idp, d.km,".$db->pdate("d.dated")." as dd, u.name, u.firstname, d.rowid";
|
||||||
$sql .= " FROM llx_societe as s, llx_deplacement as d, llx_user as u ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u ";
|
||||||
$sql .= " WHERE d.fk_soc = s.idp AND d.fk_user = u.rowid";
|
$sql .= " WHERE d.fk_soc = s.idp AND d.fk_user = u.rowid";
|
||||||
|
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ if ($rowid)
|
|||||||
$don->fetch($rowid);
|
$don->fetch($rowid);
|
||||||
|
|
||||||
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
||||||
$sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
|
$sql .= " FROM societe as s, ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp";
|
||||||
$sql .= " AND f.rowid = $facid";
|
$sql .= " AND f.rowid = $facid";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ llxHeader();
|
|||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
|
|
||||||
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
||||||
$sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
|
$sql .= " FROM societe as s, ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp";
|
||||||
$sql .= " AND f.rowid = $facid";
|
$sql .= " AND f.rowid = $facid";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@@ -144,7 +144,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print "<tr $bc[1]><td>Projet</td><td><select name=\"projetid\">\n";
|
print "<tr $bc[1]><td>Projet</td><td><select name=\"projetid\">\n";
|
||||||
|
|
||||||
$sql = "SELECT rowid, libelle FROM llx_don_projet ORDER BY rowid";
|
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."don_projet ORDER BY rowid";
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ require("./pre.inc.php");
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$sql = "SELECT sum(d.amount) as somme , d.fk_statut FROM llx_don as d GROUP BY d.fk_statut";
|
$sql = "SELECT sum(d.amount) as somme , d.fk_statut FROM ".MAIN_DB_PREFIX."don as d GROUP BY d.fk_statut";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ $pagenext = $page + 1;
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet";
|
$sql = "SELECT d.rowid, ".$db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet";
|
||||||
$sql .= " FROM llx_don as d, llx_don_projet as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."don as d, ".MAIN_DB_PREFIX."don_projet as p";
|
||||||
$sql .= " WHERE p.rowid = d.fk_don_projet";
|
$sql .= " WHERE p.rowid = d.fk_don_projet";
|
||||||
if (strlen($statut))
|
if (strlen($statut))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ llxHeader();
|
|||||||
print_titre("Statistiques");
|
print_titre("Statistiques");
|
||||||
|
|
||||||
$sql = "SELECT d.amount";
|
$sql = "SELECT d.amount";
|
||||||
$sql .= " FROM llx_don as d, llx_don_projet as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."don as d, ".MAIN_DB_PREFIX."don_projet as p";
|
||||||
$sql .= " WHERE p.rowid = d.fk_don_projet";
|
$sql .= " WHERE p.rowid = d.fk_don_projet";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class FactureRec
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_facture_rec (titre, fk_soc, datec, amount, remise, remise_percent, note, fk_user_author,fk_projet, fk_cond_reglement) ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_rec (titre, fk_soc, datec, amount, remise, remise_percent, note, fk_user_author,fk_projet, fk_cond_reglement) ";
|
||||||
$sql .= " VALUES ('$this->titre', '$facsrc->socidp', now(), '$facsrc->amount', '$facsrc->remise', '$facsrc->remise_percent', '$this->note','$user->id', '$facsrc->projetid', '$facsrc->cond_reglement_id')";
|
$sql .= " VALUES ('$this->titre', '$facsrc->socidp', now(), '$facsrc->amount', '$facsrc->remise', '$facsrc->remise_percent', '$this->note','$user->id', '$facsrc->projetid', '$facsrc->cond_reglement_id')";
|
||||||
if ( $this->db->query($sql) )
|
if ( $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ class FactureRec
|
|||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT f.fk_soc,f.titre,f.amount,f.tva,f.total,f.total_ttc,f.remise,f.remise_percent,f.fk_projet, c.rowid as crid, c.libelle, c.libelle_facture, f.note, f.fk_user_author";
|
$sql = "SELECT f.fk_soc,f.titre,f.amount,f.tva,f.total,f.total_ttc,f.remise,f.remise_percent,f.fk_projet, c.rowid as crid, c.libelle, c.libelle_facture, f.note, f.fk_user_author";
|
||||||
$sql .= " FROM llx_facture_rec as f, llx_cond_reglement as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_rec as f, ".MAIN_DB_PREFIX."cond_reglement as c";
|
||||||
$sql .= " WHERE f.rowid=$rowid AND c.rowid = f.fk_cond_reglement";
|
$sql .= " WHERE f.rowid=$rowid AND c.rowid = f.fk_cond_reglement";
|
||||||
|
|
||||||
if ($societe_id > 0)
|
if ($societe_id > 0)
|
||||||
@@ -178,7 +178,7 @@ class FactureRec
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT l.fk_product,l.description, l.subprice, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent";
|
$sql = "SELECT l.fk_product,l.description, l.subprice, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent";
|
||||||
$sql .= " FROM llx_facturedet_rec as l WHERE l.fk_facture = ".$this->id." ORDER BY l.rowid ASC";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet_rec as l WHERE l.fk_facture = ".$this->id." ORDER BY l.rowid ASC";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@@ -241,7 +241,7 @@ class FactureRec
|
|||||||
*/
|
*/
|
||||||
Function valid($userid, $dir)
|
Function valid($userid, $dir)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE llx_facture SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid";
|
||||||
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
|
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
@@ -260,11 +260,11 @@ class FactureRec
|
|||||||
*/
|
*/
|
||||||
Function delete($rowid)
|
Function delete($rowid)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_facturedet_rec WHERE fk_facture = $rowid;";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = $rowid;";
|
||||||
|
|
||||||
if ($this->db->query( $sql) )
|
if ($this->db->query( $sql) )
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_facture_rec WHERE rowid = $rowid";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_rec WHERE rowid = $rowid";
|
||||||
|
|
||||||
if ($this->db->query( $sql) )
|
if ($this->db->query( $sql) )
|
||||||
{
|
{
|
||||||
@@ -294,7 +294,7 @@ class FactureRec
|
|||||||
|
|
||||||
$numfa = facture_get_num($soc); // d<>finit dans includes/modules/facture
|
$numfa = facture_get_num($soc); // d<>finit dans includes/modules/facture
|
||||||
|
|
||||||
$sql = "UPDATE llx_facture set facnumber='$numfa', fk_statut = 1, fk_user_valid = $user->id WHERE rowid = $rowid ;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set facnumber='$numfa', fk_statut = 1, fk_user_valid = $user->id WHERE rowid = $rowid ;";
|
||||||
$result = $this->db->query( $sql);
|
$result = $this->db->query( $sql);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -311,7 +311,7 @@ class FactureRec
|
|||||||
* Update Stats
|
* Update Stats
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT fk_product FROM llx_facturedet WHERE fk_facture = ".$this->id;
|
$sql = "SELECT fk_product FROM ".MAIN_DB_PREFIX."facturedet WHERE fk_facture = ".$this->id;
|
||||||
$sql .= " AND fk_product IS NOT NULL";
|
$sql .= " AND fk_product IS NOT NULL";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@@ -324,7 +324,7 @@ class FactureRec
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($i);
|
$obj = $this->db->fetch_object($i);
|
||||||
|
|
||||||
$sql = "UPDATE llx_product SET nbvente=nbvente+1 WHERE rowid = ".$obj->fk_product;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."product SET nbvente=nbvente+1 WHERE rowid = ".$obj->fk_product;
|
||||||
$db2 = $this->db->clone();
|
$db2 = $this->db->clone();
|
||||||
$result = $db2->query($sql);
|
$result = $db2->query($sql);
|
||||||
$i++;
|
$i++;
|
||||||
@@ -378,7 +378,7 @@ class FactureRec
|
|||||||
$price = $pu - $remise;
|
$price = $pu - $remise;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_facturedet_rec (fk_facture,description,price,qty,tva_taux, fk_product, remise_percent, subprice, remise)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facturedet_rec (fk_facture,description,price,qty,tva_taux, fk_product, remise_percent, subprice, remise)";
|
||||||
$sql .= " VALUES ('$facid', '$desc', '$price', '$qty', '$txtva', '$fk_product', '$remise_percent', '$subprice', '$remise') ;";
|
$sql .= " VALUES ('$facid', '$desc', '$price', '$qty', '$txtva', '$fk_product', '$remise_percent', '$subprice', '$remise') ;";
|
||||||
|
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
@@ -418,7 +418,7 @@ class FactureRec
|
|||||||
$remise_percent=0;
|
$remise_percent=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE llx_facturedet set description='$desc',price=$price,subprice=$subprice,remise=$remise,remise_percent=$remise_percent,qty=$qty WHERE rowid = $rowid ;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set description='$desc',price=$price,subprice=$subprice,remise=$remise,remise_percent=$remise_percent,qty=$qty WHERE rowid = $rowid ;";
|
||||||
$result = $this->db->query( $sql);
|
$result = $this->db->query( $sql);
|
||||||
|
|
||||||
$this->updateprice($this->id);
|
$this->updateprice($this->id);
|
||||||
@@ -432,7 +432,7 @@ class FactureRec
|
|||||||
{
|
{
|
||||||
if ($this->brouillon)
|
if ($this->brouillon)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM llx_facturedet WHERE rowid = $rowid;";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = $rowid;";
|
||||||
$result = $this->db->query( $sql);
|
$result = $this->db->query( $sql);
|
||||||
|
|
||||||
$this->updateprice($this->id);
|
$this->updateprice($this->id);
|
||||||
@@ -446,7 +446,7 @@ class FactureRec
|
|||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT . "/lib/price.lib.php";
|
include_once DOL_DOCUMENT_ROOT . "/lib/price.lib.php";
|
||||||
$err=0;
|
$err=0;
|
||||||
$sql = "SELECT price, qty, tva_taux FROM llx_facturedet_rec WHERE fk_facture = $facid;";
|
$sql = "SELECT price, qty, tva_taux FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = $facid;";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
@@ -481,7 +481,7 @@ class FactureRec
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "UPDATE llx_facture_rec SET amount = $this->amount_ht, remise=$this->total_remise, total=$this->total_ht, tva=$this->total_tva, total_ttc=$this->total_ttc";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET amount = $this->amount_ht, remise=$this->total_remise, total=$this->total_ht, tva=$this->total_tva, total_ttc=$this->total_ttc";
|
||||||
$sql .= " WHERE rowid = $facid ;";
|
$sql .= " WHERE rowid = $facid ;";
|
||||||
|
|
||||||
if ( $this->db->query($sql) )
|
if ( $this->db->query($sql) )
|
||||||
@@ -518,7 +518,7 @@ class FactureRec
|
|||||||
|
|
||||||
$this->remise_percent = $remise ;
|
$this->remise_percent = $remise ;
|
||||||
|
|
||||||
$sql = "UPDATE llx_facture SET remise_percent = ".ereg_replace(",",".",$remise);
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET remise_percent = ".ereg_replace(",",".",$remise);
|
||||||
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
|
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td colspan="3">';
|
print '<tr><td colspan="3">';
|
||||||
|
|
||||||
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice";
|
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice";
|
||||||
$sql .= " FROM llx_facturedet as l WHERE l.fk_facture = $facid ORDER BY l.rowid";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l WHERE l.fk_facture = $facid ORDER BY l.rowid";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@@ -396,7 +396,7 @@ else
|
|||||||
$sortfield="f.datef";
|
$sortfield="f.datef";
|
||||||
|
|
||||||
$sql = "SELECT s.nom,s.idp,f.titre,f.total,f.rowid as facid";
|
$sql = "SELECT s.nom,s.idp,f.titre,f.total,f.rowid as facid";
|
||||||
$sql .= " FROM llx_societe as s,llx_facture_rec as f WHERE f.fk_soc = s.idp";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f WHERE f.fk_soc = s.idp";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
$sql .= " AND s.idp = $socidp";
|
$sql .= " AND s.idp = $socidp";
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class FactureStats extends Stats
|
|||||||
*/
|
*/
|
||||||
Function getNbByMonth($year)
|
Function getNbByMonth($year)
|
||||||
{
|
{
|
||||||
$sql = "SELECT date_format(datef,'%m') as dm, count(*) FROM llx_facture";
|
$sql = "SELECT date_format(datef,'%m') as dm, count(*) FROM ".MAIN_DB_PREFIX."facture";
|
||||||
$sql .= " WHERE date_format(datef,'%Y') = $year AND fk_statut > 0";
|
$sql .= " WHERE date_format(datef,'%Y') = $year AND fk_statut > 0";
|
||||||
if ($this->socidp)
|
if ($this->socidp)
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ class FactureStats extends Stats
|
|||||||
*/
|
*/
|
||||||
Function getNbByYear()
|
Function getNbByYear()
|
||||||
{
|
{
|
||||||
$sql = "SELECT date_format(datef,'%Y') as dm, count(*) FROM llx_facture GROUP BY dm DESC WHERE fk_statut > 0";
|
$sql = "SELECT date_format(datef,'%Y') as dm, count(*) FROM ".MAIN_DB_PREFIX."facture GROUP BY dm DESC WHERE fk_statut > 0";
|
||||||
|
|
||||||
return $this->_getNbByYear($sql);
|
return $this->_getNbByYear($sql);
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ class FactureStats extends Stats
|
|||||||
*/
|
*/
|
||||||
Function getAmountByMonth($year)
|
Function getAmountByMonth($year)
|
||||||
{
|
{
|
||||||
$sql = "SELECT date_format(datef,'%m') as dm, sum(total) FROM llx_facture";
|
$sql = "SELECT date_format(datef,'%m') as dm, sum(total) FROM ".MAIN_DB_PREFIX."facture";
|
||||||
$sql .= " WHERE date_format(datef,'%Y') = $year AND fk_statut > 0";
|
$sql .= " WHERE date_format(datef,'%Y') = $year AND fk_statut > 0";
|
||||||
if ($this->socidp)
|
if ($this->socidp)
|
||||||
{
|
{
|
||||||
@@ -83,7 +83,7 @@ class FactureStats extends Stats
|
|||||||
*/
|
*/
|
||||||
Function getAverageByMonth($year)
|
Function getAverageByMonth($year)
|
||||||
{
|
{
|
||||||
$sql = "SELECT date_format(datef,'%m') as dm, avg(total) FROM llx_facture";
|
$sql = "SELECT date_format(datef,'%m') as dm, avg(total) FROM ".MAIN_DB_PREFIX."facture";
|
||||||
$sql .= " WHERE date_format(datef,'%Y') = $year AND fk_statut > 0";
|
$sql .= " WHERE date_format(datef,'%Y') = $year AND fk_statut > 0";
|
||||||
if ($this->socidp)
|
if ($this->socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ $px->SetHeight(280);
|
|||||||
|
|
||||||
$px->draw(DOL_DOCUMENT_ROOT.$filev, $data, $year);
|
$px->draw(DOL_DOCUMENT_ROOT.$filev, $data, $year);
|
||||||
|
|
||||||
$sql = "SELECT count(*), date_format(datef,'%Y') as dm, sum(total) FROM llx_facture WHERE fk_statut > 0 ";
|
$sql = "SELECT count(*), date_format(datef,'%Y') as dm, sum(total) FROM ".MAIN_DB_PREFIX."facture WHERE fk_statut > 0 ";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND fk_soc = $socidp";
|
$sql .= " AND fk_soc = $socidp";
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ if ($_GET["propalid"])
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT s.nom, s.idp, p.price, p.fk_projet,p.remise, p.tva, p.total, p.ref,".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.note, x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture";
|
$sql = "SELECT s.nom, s.idp, p.price, p.fk_projet,p.remise, p.tva, p.total, p.ref,".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.note, x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture";
|
||||||
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c, llx_socpeople as x";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c, ".MAIN_DB_PREFIX."socpeople as x";
|
||||||
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = ".$propal->id;
|
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = ".$propal->id;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@@ -429,7 +429,7 @@ if ($_GET["propalid"])
|
|||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||||
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c ";
|
||||||
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut in(2,4)";
|
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut in(2,4)";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if ($user->societe_id > 0)
|
|||||||
print_titre("Caisse");
|
print_titre("Caisse");
|
||||||
|
|
||||||
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_paiement as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiement as f";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ if ($db->query($sql))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_paiementfourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as f";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ print '<td><input type="text" size="8" name="date"></td>';
|
|||||||
print '<td colspan="2" align="right"><select name="type">';
|
print '<td colspan="2" align="right"><select name="type">';
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT c.id, c.libelle as nom FROM c_chargesociales as c";
|
$sql = "SELECT c.id, c.libelle as nom FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||||
$sql .= " ORDER BY lower(c.libelle) ASC";
|
$sql .= " ORDER BY lower(c.libelle) ASC";
|
||||||
|
|
||||||
if ( $db->query($sql) )
|
if ( $db->query($sql) )
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ print_titre("Chiffre d'affaire par utilisateur (euros HT)");
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as ca FROM llx_facture as f";
|
$sql = "SELECT sum(f.total) as ca FROM ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .= " WHERE f.fk_user_valid is not NULL AND f.fk_statut = 1";
|
$sql .= " WHERE f.fk_user_valid is not NULL AND f.fk_statut = 1";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ if ($catotal == 0) { $catotal = 1; };
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT u.name, u.firstname, sum(f.total) as ca";
|
$sql = "SELECT u.name, u.firstname, sum(f.total) as ca";
|
||||||
$sql .= " FROM llx_user as u,llx_facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u,".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .= " WHERE f.fk_user_valid is not NULL and f.fk_statut = 1 AND f.fk_user_author = u.rowid";
|
$sql .= " WHERE f.fk_user_valid is not NULL and f.fk_statut = 1 AND f.fk_user_author = u.rowid";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ print_titre("Chiffre d'affaire par soci
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as ca FROM llx_facture as f";
|
$sql = "SELECT sum(f.total) as ca FROM ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .= " WHERE f.fk_user_valid = 1 AND f.fk_statut = 1";
|
$sql .= " WHERE f.fk_user_valid = 1 AND f.fk_statut = 1";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ if ($catotal == 0) { $catotal = 1; };
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, sum(f.total) as ca";
|
$sql = "SELECT s.nom, s.idp, sum(f.total) as ca";
|
||||||
$sql .= " FROM llx_societe as s,llx_facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .= " WHERE f.fk_statut = 1 and f.fk_user_valid = 1 AND f.fk_soc = s.idp";
|
$sql .= " WHERE f.fk_statut = 1 and f.fk_user_valid = 1 AND f.fk_soc = s.idp";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ require("./lib.inc.php");
|
|||||||
function propals ($db, $year, $month) {
|
function propals ($db, $year, $month) {
|
||||||
global $bc;
|
global $bc;
|
||||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||||
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
|
||||||
$sql .= " AND c.id in (1,2,4)";
|
$sql .= " AND c.id in (1,2,4)";
|
||||||
$sql .= " AND date_format(p.datep, '%Y') = $year ";
|
$sql .= " AND date_format(p.datep, '%Y') = $year ";
|
||||||
$sql .= " AND round(date_format(p.datep, '%m')) = $month ";
|
$sql .= " AND round(date_format(p.datep, '%m')) = $month ";
|
||||||
@@ -97,7 +97,7 @@ function factures ($db, $year, $month, $paye) {
|
|||||||
global $bc;
|
global $bc;
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, f.facnumber, f.total,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
|
$sql = "SELECT s.nom, s.idp, f.facnumber, f.total,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
|
||||||
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.paye = $paye";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp AND f.paye = $paye";
|
||||||
$sql .= " AND date_format(f.datef, '%Y') = $year ";
|
$sql .= " AND date_format(f.datef, '%Y') = $year ";
|
||||||
$sql .= " AND round(date_format(f.datef, '%m')) = $month ";
|
$sql .= " AND round(date_format(f.datef, '%m')) = $month ";
|
||||||
$sql .= " ORDER BY f.datef DESC ";
|
$sql .= " ORDER BY f.datef DESC ";
|
||||||
@@ -244,7 +244,7 @@ function ppt ($db, $year, $socidp)
|
|||||||
print '<tr><td valign="top" align="center" width="30%">';
|
print '<tr><td valign="top" align="center" width="30%">';
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price) as sum, round(date_format(f.datep,'%m')) as dm";
|
$sql = "SELECT sum(f.price) as sum, round(date_format(f.datep,'%m')) as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep,'%Y') = $year ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep,'%Y') = $year ";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@@ -258,7 +258,7 @@ function ppt ($db, $year, $socidp)
|
|||||||
print "</td><td valign=\"top\" width=\"30%\">";
|
print "</td><td valign=\"top\" width=\"30%\">";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
|
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = $year ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = $year ";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ print_titre("Chiffre d'affaire cumul
|
|||||||
print '<table width="100%"><tr><td valign="top">';
|
print '<table width="100%"><tr><td valign="top">';
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE fk_user_valid is not NULL and f.paye = 1";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE fk_user_valid is not NULL and f.paye = 1";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
@@ -53,7 +53,7 @@ pt($db, $sql,"Suivi cumul par mois");
|
|||||||
print "</td><td valign=\"top\">";
|
print "</td><td valign=\"top\">";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as amount, year(f.datef) as dm";
|
$sql = "SELECT sum(f.total) as amount, year(f.datef) as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE fk_user_valid is not NULL and f.paye = 1";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE fk_user_valid is not NULL and f.paye = 1";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
@@ -65,7 +65,7 @@ pt($db, $sql,"Suivi cumul par ann
|
|||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as amount, month(f.datef) as dm";
|
$sql = "SELECT sum(f.total) as amount, month(f.datef) as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE fk_user_valid is not NULL and f.paye = 1";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE fk_user_valid is not NULL and f.paye = 1";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ require("./lib.inc.php");
|
|||||||
function propals ($db, $year, $month) {
|
function propals ($db, $year, $month) {
|
||||||
global $bc;
|
global $bc;
|
||||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||||
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
|
||||||
$sql .= " AND c.id in (1,2)";
|
$sql .= " AND c.id in (1,2)";
|
||||||
$sql .= " AND date_format(p.datep, '%Y') = $year ";
|
$sql .= " AND date_format(p.datep, '%Y') = $year ";
|
||||||
$sql .= " AND round(date_format(p.datep, '%m')) = $month ";
|
$sql .= " AND round(date_format(p.datep, '%m')) = $month ";
|
||||||
@@ -97,7 +97,7 @@ function factures ($db, $year, $month, $paye) {
|
|||||||
global $bc;
|
global $bc;
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, f.facnumber, f.total as amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
|
$sql = "SELECT s.nom, s.idp, f.facnumber, f.total as amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
|
||||||
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.paye = $paye";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp AND f.paye = $paye";
|
||||||
$sql .= " AND date_format(f.datef, '%Y') = $year ";
|
$sql .= " AND date_format(f.datef, '%Y') = $year ";
|
||||||
$sql .= " AND round(date_format(f.datef, '%m')) = $month ";
|
$sql .= " AND round(date_format(f.datef, '%m')) = $month ";
|
||||||
$sql .= " ORDER BY f.datef DESC ";
|
$sql .= " ORDER BY f.datef DESC ";
|
||||||
@@ -233,7 +233,7 @@ function ppt ($db, $year, $socidp)
|
|||||||
print "<tr><td valign=\"top\" width=\"30%\">";
|
print "<tr><td valign=\"top\" width=\"30%\">";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
|
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = ".($year-1);
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = ".($year-1);
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@@ -247,7 +247,7 @@ function ppt ($db, $year, $socidp)
|
|||||||
print "</td><td valign=\"top\" width=\"30%\">";
|
print "</td><td valign=\"top\" width=\"30%\">";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
|
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = $year ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = $year ";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if ($user->societe_id > 0)
|
|||||||
print_titre("Chiffres d'affaires (".MAIN_MONNAIE." HT)");
|
print_titre("Chiffres d'affaires (".MAIN_MONNAIE." HT)");
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
|
||||||
|
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
function get_ca_propal ($db, $year, $socidp)
|
function get_ca_propal ($db, $year, $socidp)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price - f.remise) as sum FROM llx_propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep, '%Y') = $year ";
|
$sql = "SELECT sum(f.price - f.remise) as sum FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep, '%Y') = $year ";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
@@ -45,7 +45,7 @@ function get_ca_propal ($db, $year, $socidp)
|
|||||||
function get_ca ($db, $year, $socidp)
|
function get_ca ($db, $year, $socidp)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT sum(f.amount) as sum FROM llx_facture as f WHERE f.paye = 1 AND date_format(f.datef , '%Y') = $year ";
|
$sql = "SELECT sum(f.amount) as sum FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1 AND date_format(f.datef , '%Y') = $year ";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ print '<table width="100%">';
|
|||||||
print '<tr><td valign="top">';
|
print '<tr><td valign="top">';
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price) as amount, date_format(f.datep,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.price) as amount, date_format(f.datep,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
$sql .= " FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in $in";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
@@ -107,7 +107,7 @@ pt($db, $sql, "Mois");
|
|||||||
print '</td><td valign="top">';
|
print '</td><td valign="top">';
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price) as amount, year(f.datep) as dm";
|
$sql = "SELECT sum(f.price) as amount, year(f.datep) as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
$sql .= " FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in $in";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
@@ -119,7 +119,7 @@ pt($db, $sql, "Ann
|
|||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price) as amount, month(f.datep) as dm";
|
$sql = "SELECT sum(f.price) as amount, month(f.datep) as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
$sql .= " FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in $in";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ require("../../tva.class.php");
|
|||||||
*/
|
*/
|
||||||
function tva_coll($db, $y,$m) {
|
function tva_coll($db, $y,$m) {
|
||||||
$sql = "SELECT sum(f.tva) as amount";
|
$sql = "SELECT sum(f.tva) as amount";
|
||||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
|
||||||
$sql .= " AND date_format(f.datef,'%Y') = $y";
|
$sql .= " AND date_format(f.datef,'%Y') = $y";
|
||||||
$sql .= " AND date_format(f.datef,'%m') = $m";
|
$sql .= " AND date_format(f.datef,'%m') = $m";
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ function tva_coll($db, $y,$m) {
|
|||||||
function tva_paye($db, $y,$m)
|
function tva_paye($db, $y,$m)
|
||||||
{
|
{
|
||||||
$sql = "SELECT sum(f.total_tva) as amount";
|
$sql = "SELECT sum(f.total_tva) as amount";
|
||||||
$sql .= " FROM llx_facture_fourn as f WHERE f.paye = 1";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f WHERE f.paye = 1";
|
||||||
$sql .= " AND date_format(f.datef,'%Y') = $y";
|
$sql .= " AND date_format(f.datef,'%Y') = $y";
|
||||||
$sql .= " AND date_format(f.datef,'%m') = $m";
|
$sql .= " AND date_format(f.datef,'%m') = $m";
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) {
|
|||||||
print "<tr><td valign=\"top\">";
|
print "<tr><td valign=\"top\">";
|
||||||
|
|
||||||
$sql = "SELECT amount, date_format(f.datev,'%Y-%m') as dm";
|
$sql = "SELECT amount, date_format(f.datev,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_tva as f WHERE f.datev >= '$y-01-01' AND f.datev <= '$y-12-31' ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."tva as f WHERE f.datev >= '$y-01-01' AND f.datev <= '$y-12-31' ";
|
||||||
$sql .= " GROUP BY dm DESC";
|
$sql .= " GROUP BY dm DESC";
|
||||||
|
|
||||||
pt($db, $sql,"Ann<EFBFBD>e $y");
|
pt($db, $sql,"Ann<EFBFBD>e $y");
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ $tva = new Tva($db);
|
|||||||
print_titre("R<EFBFBD>glements TVA");
|
print_titre("R<EFBFBD>glements TVA");
|
||||||
|
|
||||||
$sql = "SELECT amount, date_format(f.datev,'%d-%M-%Y') as dm";
|
$sql = "SELECT amount, date_format(f.datev,'%d-%M-%Y') as dm";
|
||||||
$sql .= " FROM llx_tva as f ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."tva as f ";
|
||||||
$sql .= " ORDER BY dm DESC";
|
$sql .= " ORDER BY dm DESC";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ llxHeader();
|
|||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
$author = $GLOBALS["REMOTE_USER"];
|
$author = $GLOBALS["REMOTE_USER"];
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) ";
|
||||||
$sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reduc);";
|
$sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reduc);";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@@ -43,7 +43,7 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if ($action == 'del') {
|
if ($action == 'del') {
|
||||||
/* $sql = "DELETE FROM llx_voyage WHERE rowid = $rowid";
|
/* $sql = "DELETE FROM ".MAIN_DB_PREFIX."voyage WHERE rowid = $rowid";
|
||||||
*$result = $db->query($sql);
|
*$result = $db->query($sql);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ if ($vline) {
|
|||||||
$viewline = 20;
|
$viewline = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid, label FROM llx_voyage_reduc;";
|
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."voyage_reduc;";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$var=True;
|
$var=True;
|
||||||
@@ -74,7 +74,7 @@ print_titre("Bilan des reductions");
|
|||||||
* Cartes
|
* Cartes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT rowid FROM llx_voyage_reduc";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."voyage_reduc";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@@ -110,7 +110,7 @@ for ($j = 0 ; $j < sizeof($cartes) ; $j++) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.depart, b.arrivee , b.reduction";
|
$sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.depart, b.arrivee , b.reduction";
|
||||||
$sql .= " FROM llx_voyage as b WHERE fk_reduc=".$reduc->id." ORDER BY b.date_depart ASC";
|
$sql .= " FROM ".MAIN_DB_PREFIX."voyage as b WHERE fk_reduc=".$reduc->id." ORDER BY b.date_depart ASC";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ llxHeader();
|
|||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
$author = $GLOBALS["REMOTE_USER"];
|
$author = $GLOBALS["REMOTE_USER"];
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc, reduction) ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc, reduction) ";
|
||||||
$sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reducid, $reduc);";
|
$sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reducid, $reduc);";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@@ -41,7 +41,7 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if ($action == 'del') {
|
if ($action == 'del') {
|
||||||
/* $sql = "DELETE FROM llx_voyage WHERE rowid = $rowid";
|
/* $sql = "DELETE FROM ".MAIN_DB_PREFIX."voyage WHERE rowid = $rowid";
|
||||||
*$result = $db->query($sql);
|
*$result = $db->query($sql);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ if ($vline) {
|
|||||||
$viewline = 20;
|
$viewline = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid, label FROM llx_voyage_reduc;";
|
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."voyage_reduc;";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$var=True;
|
$var=True;
|
||||||
@@ -71,7 +71,7 @@ print_titre("Voyages");
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.reduction,b.depart, b.arrivee ";
|
$sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.reduction,b.depart, b.arrivee ";
|
||||||
$sql .= " FROM llx_voyage as b ORDER BY b.date_depart ASC";
|
$sql .= " FROM ".MAIN_DB_PREFIX."voyage as b ORDER BY b.date_depart ASC";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Reduc {
|
|||||||
|
|
||||||
Function fetch($id) {
|
Function fetch($id) {
|
||||||
$sql = "SELECT b.rowid,".$this->db->pdate("b.date_debut")." as debut,".$this->db->pdate("b.date_fin")." as fin, b.amount, b.label ";
|
$sql = "SELECT b.rowid,".$this->db->pdate("b.date_debut")." as debut,".$this->db->pdate("b.date_fin")." as fin, b.amount, b.label ";
|
||||||
$sql .= " FROM llx_voyage_reduc as b WHERE rowid = $id";
|
$sql .= " FROM ".MAIN_DB_PREFIX."voyage_reduc as b WHERE rowid = $id";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ print "</TR>\n";
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT b.rowid,".$db->pdate("b.date_debut")." as debut,".$db->pdate("b.date_fin")." as fin, b.amount, b.label ";
|
$sql = "SELECT b.rowid,".$db->pdate("b.date_debut")." as debut,".$db->pdate("b.date_fin")." as fin, b.amount, b.label ";
|
||||||
$sql .= " FROM llx_voyage_reduc as b ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."voyage_reduc as b ";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ else
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT s.idp, s.nom, p.idp as cidp, p.name, p.firstname, p.email, p.phone, p.phone_mobile, p.fax ";
|
$sql = "SELECT s.idp, s.nom, p.idp as cidp, p.name, p.firstname, p.email, p.phone, p.phone_mobile, p.fax ";
|
||||||
$sql .= "FROM llx_socpeople as p";
|
$sql .= "FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||||
$sql .= " LEFT JOIN llx_societe as s ON (s.idp = p.fk_soc)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (s.idp = p.fk_soc)";
|
||||||
|
|
||||||
|
|
||||||
if (strlen($_GET["userid"])) // statut commercial
|
if (strlen($_GET["userid"])) // statut commercial
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class Contrat
|
|||||||
$day,
|
$day,
|
||||||
$year);
|
$year);
|
||||||
|
|
||||||
$sql = "UPDATE llx_contrat SET enservice = 1";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET enservice = 1";
|
||||||
$sql .= " , mise_en_service = ".$this->db->idate($date).", fk_user_mise_en_service = ".$user->id;
|
$sql .= " , mise_en_service = ".$this->db->idate($date).", fk_user_mise_en_service = ".$user->id;
|
||||||
$sql .= " , fin_validite = ". $this->db->idate($fin);
|
$sql .= " , fin_validite = ". $this->db->idate($fin);
|
||||||
$sql .= " WHERE rowid = ".$this->id . " AND enservice = 0";
|
$sql .= " WHERE rowid = ".$this->id . " AND enservice = 0";
|
||||||
@@ -92,7 +92,7 @@ class Contrat
|
|||||||
*/
|
*/
|
||||||
Function cloture($user)
|
Function cloture($user)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE llx_contrat SET enservice = 2";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET enservice = 2";
|
||||||
$sql .= " , date_cloture = now(), fk_user_cloture = ".$user->id;
|
$sql .= " , date_cloture = now(), fk_user_cloture = ".$user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id . " AND enservice = 1";
|
$sql .= " WHERE rowid = ".$this->id . " AND enservice = 1";
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ class Contrat
|
|||||||
$sql .= ", fk_user_mise_en_service, ".$this->db->pdate("date_cloture")." as datecloture";
|
$sql .= ", fk_user_mise_en_service, ".$this->db->pdate("date_cloture")." as datecloture";
|
||||||
$sql .= ", ".$this->db->pdate("fin_validite")." as datefin";
|
$sql .= ", ".$this->db->pdate("fin_validite")." as datefin";
|
||||||
$sql .= ", fk_user_cloture, fk_facture";
|
$sql .= ", fk_user_cloture, fk_facture";
|
||||||
$sql .= " FROM llx_contrat WHERE rowid = $id";
|
$sql .= " FROM ".MAIN_DB_PREFIX."contrat WHERE rowid = $id";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ class Contrat
|
|||||||
*/
|
*/
|
||||||
Function create_from_facture($factureid, $user, $socid)
|
Function create_from_facture($factureid, $user, $socid)
|
||||||
{
|
{
|
||||||
$sql = "SELECT p.rowid FROM llx_product as p, llx_facturedet as f";
|
$sql = "SELECT p.rowid FROM ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."facturedet as f";
|
||||||
$sql .= " WHERE p.rowid = f.fk_product AND p.fk_product_type = 1 AND f.fk_facture = ".$factureid;
|
$sql .= " WHERE p.rowid = f.fk_product AND p.fk_product_type = 1 AND f.fk_facture = ".$factureid;
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
@@ -166,7 +166,7 @@ class Contrat
|
|||||||
|
|
||||||
while (list($key, $value) = each ($contrats))
|
while (list($key, $value) = each ($contrats))
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO llx_contrat (fk_product, fk_facture, fk_soc, fk_user_author)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (fk_product, fk_facture, fk_soc, fk_user_author)";
|
||||||
$sql .= " VALUES ($value, $factureid, $socid, $user->id)";
|
$sql .= " VALUES ($value, $factureid, $socid, $user->id)";
|
||||||
if (! $this->db->query($sql))
|
if (! $this->db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ if ($sortorder == "")
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT s.nom, c.rowid as cid, c.enservice, p.label, p.rowid, s.idp as sidp";
|
$sql = "SELECT s.nom, c.rowid as cid, c.enservice, p.label, p.rowid, s.idp as sidp";
|
||||||
$sql .= " FROM llx_contrat as c, llx_societe as s, llx_product as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product as p";
|
||||||
$sql .= " WHERE c.fk_soc = s.idp AND c.fk_product = p.rowid";
|
$sql .= " WHERE c.fk_soc = s.idp AND c.fk_product = p.rowid";
|
||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,23 +28,23 @@ drop table if exists llx_co_pr;
|
|||||||
drop table if exists llx_commande;
|
drop table if exists llx_commande;
|
||||||
drop table if exists llx_commandedet;
|
drop table if exists llx_commandedet;
|
||||||
|
|
||||||
drop table if exists c_actioncomm;
|
drop table if exists llx_c_actioncomm;
|
||||||
|
|
||||||
drop table if exists c_chargesociales;
|
drop table if exists llx_c_chargesociales;
|
||||||
|
|
||||||
drop table if exists c_effectif;
|
drop table if exists llx_c_effectif;
|
||||||
|
|
||||||
drop table if exists c_paiement ;
|
drop table if exists llx_c_paiement ;
|
||||||
|
|
||||||
drop table if exists c_pays ;
|
drop table if exists llx_c_pays ;
|
||||||
|
|
||||||
drop table if exists c_prestatype ;
|
drop table if exists llx_c_prestatype ;
|
||||||
|
|
||||||
drop table if exists c_propalst ;
|
drop table if exists llx_c_propalst ;
|
||||||
|
|
||||||
drop table if exists c_stcomm;
|
drop table if exists llx_c_stcomm;
|
||||||
|
|
||||||
drop table if exists c_typent ;
|
drop table if exists llx_c_typent ;
|
||||||
|
|
||||||
drop table if exists llx_action_def;
|
drop table if exists llx_action_def;
|
||||||
|
|
||||||
|
|||||||
166
mysql/mysql.sql
166
mysql/mysql.sql
@@ -496,7 +496,7 @@ create table llx_voyage_reduc
|
|||||||
note text
|
note text
|
||||||
);
|
);
|
||||||
|
|
||||||
create table c_paiement
|
create table llx_c_paiement
|
||||||
(
|
(
|
||||||
id integer PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
libelle varchar(30),
|
libelle varchar(30),
|
||||||
@@ -526,7 +526,7 @@ create table llx_domain
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
create table c_actioncomm
|
create table llx_c_actioncomm
|
||||||
(
|
(
|
||||||
id integer PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
libelle varchar(30),
|
libelle varchar(30),
|
||||||
@@ -575,7 +575,7 @@ create table llx_bank_categ
|
|||||||
label varchar(255)
|
label varchar(255)
|
||||||
);
|
);
|
||||||
|
|
||||||
create table c_effectif
|
create table llx_c_effectif
|
||||||
(
|
(
|
||||||
id integer PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
libelle varchar(30)
|
libelle varchar(30)
|
||||||
@@ -611,7 +611,7 @@ create table llx_commande
|
|||||||
UNIQUE INDEX (ref)
|
UNIQUE INDEX (ref)
|
||||||
);
|
);
|
||||||
|
|
||||||
create table c_pays
|
create table llx_c_pays
|
||||||
(
|
(
|
||||||
id integer PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
libelle varchar(25),
|
libelle varchar(25),
|
||||||
@@ -629,7 +629,7 @@ create table llx_adherent_options
|
|||||||
UNIQUE INDEX(adhid)
|
UNIQUE INDEX(adhid)
|
||||||
);
|
);
|
||||||
|
|
||||||
create table c_chargesociales
|
create table llx_c_chargesociales
|
||||||
(
|
(
|
||||||
id integer PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
libelle varchar(80),
|
libelle varchar(80),
|
||||||
@@ -661,7 +661,7 @@ create table llx_album
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
create table c_typent
|
create table llx_c_typent
|
||||||
(
|
(
|
||||||
id integer PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
libelle varchar(30)
|
libelle varchar(30)
|
||||||
@@ -694,7 +694,7 @@ create table llx_projet
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
create table c_stcomm
|
create table llx_c_stcomm
|
||||||
(
|
(
|
||||||
id integer PRIMARY KEY,
|
id integer PRIMARY KEY,
|
||||||
libelle varchar(30)
|
libelle varchar(30)
|
||||||
@@ -758,7 +758,7 @@ create table llx_chargesociales
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
create table c_propalst
|
create table llx_c_propalst
|
||||||
(
|
(
|
||||||
id smallint PRIMARY KEY,
|
id smallint PRIMARY KEY,
|
||||||
label varchar(30)
|
label varchar(30)
|
||||||
@@ -1303,89 +1303,89 @@ INSERT INTO llx_const (name, value, type, note) VALUES ('ADHERENT_MAIL_FROM','ad
|
|||||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MENU_BARRETOP','default.php','chaine','Module commande');
|
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_MENU_BARRETOP','default.php','chaine','Module commande');
|
||||||
|
|
||||||
|
|
||||||
delete from c_chargesociales;
|
delete from llx_c_chargesociales;
|
||||||
insert into c_chargesociales (id,libelle,deductible) values ( 1, 'Allocations familiales',1);
|
insert into llx_c_chargesociales (id,libelle,deductible) values ( 1, 'Allocations familiales',1);
|
||||||
insert into c_chargesociales (id,libelle,deductible) values ( 2, 'GSG Deductible',1);
|
insert into llx_c_chargesociales (id,libelle,deductible) values ( 2, 'GSG Deductible',1);
|
||||||
insert into c_chargesociales (id,libelle,deductible) values ( 3, 'GSG/CRDS NON Deductible',0);
|
insert into llx_c_chargesociales (id,libelle,deductible) values ( 3, 'GSG/CRDS NON Deductible',0);
|
||||||
|
|
||||||
|
|
||||||
delete from c_actioncomm;
|
delete from llx_c_actioncomm;
|
||||||
insert into c_actioncomm (id,libelle) values ( 0, '-');
|
insert into llx_c_actioncomm (id,libelle) values ( 0, '-');
|
||||||
insert into c_actioncomm (id,libelle) values ( 1, 'Appel T<>l<EFBFBD>phonique');
|
insert into llx_c_actioncomm (id,libelle) values ( 1, 'Appel T<>l<EFBFBD>phonique');
|
||||||
insert into c_actioncomm (id,libelle) values ( 2, 'Envoi Fax');
|
insert into llx_c_actioncomm (id,libelle) values ( 2, 'Envoi Fax');
|
||||||
insert into c_actioncomm (id,libelle) values ( 3, 'Envoi propal par mail');
|
insert into llx_c_actioncomm (id,libelle) values ( 3, 'Envoi propal par mail');
|
||||||
insert into c_actioncomm (id,libelle) values ( 4, 'Envoi d\'un email');
|
insert into llx_c_actioncomm (id,libelle) values ( 4, 'Envoi d\'un email');
|
||||||
insert into c_actioncomm (id,libelle) values ( 5, 'Rendez-vous');
|
insert into llx_c_actioncomm (id,libelle) values ( 5, 'Rendez-vous');
|
||||||
insert into c_actioncomm (id,libelle) values ( 9, 'Envoi Facture');
|
insert into llx_c_actioncomm (id,libelle) values ( 9, 'Envoi Facture');
|
||||||
insert into c_actioncomm (id,libelle) values (10, 'Relance effectu<EFBFBD>e');
|
insert into llx_c_actioncomm (id,libelle) values (10, 'Relance effectu<EFBFBD>e');
|
||||||
insert into c_actioncomm (id,libelle) values (11, 'Cl<EFBFBD>ture');
|
insert into llx_c_actioncomm (id,libelle) values (11, 'Cl<EFBFBD>ture');
|
||||||
|
|
||||||
delete from c_stcomm;
|
delete from llx_c_stcomm;
|
||||||
insert into c_stcomm (id,libelle) values (-1, 'NE PAS CONTACTER');
|
insert into llx_c_stcomm (id,libelle) values (-1, 'NE PAS CONTACTER');
|
||||||
insert into c_stcomm (id,libelle) values ( 0, 'Jamais contact<EFBFBD>');
|
insert into llx_c_stcomm (id,libelle) values ( 0, 'Jamais contact<EFBFBD>');
|
||||||
insert into c_stcomm (id,libelle) values ( 1, 'A contacter');
|
insert into llx_c_stcomm (id,libelle) values ( 1, 'A contacter');
|
||||||
insert into c_stcomm (id,libelle) values ( 2, 'Contact en cours');
|
insert into llx_c_stcomm (id,libelle) values ( 2, 'Contact en cours');
|
||||||
insert into c_stcomm (id,libelle) values ( 3, 'Contact<EFBFBD>e');
|
insert into llx_c_stcomm (id,libelle) values ( 3, 'Contact<EFBFBD>e');
|
||||||
|
|
||||||
delete from c_typent;
|
delete from llx_c_typent;
|
||||||
insert into c_typent (id,libelle) values ( 0, 'Indiff<EFBFBD>rent');
|
insert into llx_c_typent (id,libelle) values ( 0, 'Indiff<EFBFBD>rent');
|
||||||
insert into c_typent (id,libelle) values ( 1, 'Start-up');
|
insert into llx_c_typent (id,libelle) values ( 1, 'Start-up');
|
||||||
insert into c_typent (id,libelle) values ( 2, 'Grand groupe');
|
insert into llx_c_typent (id,libelle) values ( 2, 'Grand groupe');
|
||||||
insert into c_typent (id,libelle) values ( 3, 'PME/PMI');
|
insert into llx_c_typent (id,libelle) values ( 3, 'PME/PMI');
|
||||||
insert into c_typent (id,libelle) values ( 4, 'Administration');
|
insert into llx_c_typent (id,libelle) values ( 4, 'Administration');
|
||||||
insert into c_typent (id,libelle) values (100, 'Autres');
|
insert into llx_c_typent (id,libelle) values (100, 'Autres');
|
||||||
|
|
||||||
delete from c_pays;
|
delete from llx_c_pays;
|
||||||
insert into c_pays (id,libelle,code) values (0, 'France', 'FR');
|
insert into llx_c_pays (id,libelle,code) values (0, 'France', 'FR');
|
||||||
insert into c_pays (id,libelle,code) values (2, 'Belgique', 'BE');
|
insert into llx_c_pays (id,libelle,code) values (2, 'Belgique', 'BE');
|
||||||
insert into c_pays (id,libelle,code) values (3, 'Italie', 'IT');
|
insert into llx_c_pays (id,libelle,code) values (3, 'Italie', 'IT');
|
||||||
insert into c_pays (id,libelle,code) values (4, 'Espagne', 'ES');
|
insert into llx_c_pays (id,libelle,code) values (4, 'Espagne', 'ES');
|
||||||
insert into c_pays (id,libelle,code) values (5, 'Allemagne', 'DE');
|
insert into llx_c_pays (id,libelle,code) values (5, 'Allemagne', 'DE');
|
||||||
insert into c_pays (id,libelle,code) values (6, 'Suisse', 'CH');
|
insert into llx_c_pays (id,libelle,code) values (6, 'Suisse', 'CH');
|
||||||
insert into c_pays (id,libelle,code) values (7, 'Royaume uni', 'GB');
|
insert into llx_c_pays (id,libelle,code) values (7, 'Royaume uni', 'GB');
|
||||||
insert into c_pays (id,libelle,code) values (8, 'Irlande', 'IE');
|
insert into llx_c_pays (id,libelle,code) values (8, 'Irlande', 'IE');
|
||||||
insert into c_pays (id,libelle,code) values (9, 'Chine', 'CN');
|
insert into llx_c_pays (id,libelle,code) values (9, 'Chine', 'CN');
|
||||||
insert into c_pays (id,libelle,code) values (10, 'Tunisie', 'TN');
|
insert into llx_c_pays (id,libelle,code) values (10, 'Tunisie', 'TN');
|
||||||
insert into c_pays (id,libelle,code) values (11, 'Etats Unis', 'US');
|
insert into llx_c_pays (id,libelle,code) values (11, 'Etats Unis', 'US');
|
||||||
insert into c_pays (id,libelle,code) values (12, 'Maroc', 'MA');
|
insert into llx_c_pays (id,libelle,code) values (12, 'Maroc', 'MA');
|
||||||
insert into c_pays (id,libelle,code) values (13, 'Alg<EFBFBD>rie', 'DZ');
|
insert into llx_c_pays (id,libelle,code) values (13, 'Alg<EFBFBD>rie', 'DZ');
|
||||||
insert into c_pays (id,libelle,code) values (14, 'Canada', 'CA');
|
insert into llx_c_pays (id,libelle,code) values (14, 'Canada', 'CA');
|
||||||
insert into c_pays (id,libelle,code) values (15, 'Togo', 'TG');
|
insert into llx_c_pays (id,libelle,code) values (15, 'Togo', 'TG');
|
||||||
insert into c_pays (id,libelle,code) values (16, 'Gabon', 'GA');
|
insert into llx_c_pays (id,libelle,code) values (16, 'Gabon', 'GA');
|
||||||
insert into c_pays (id,libelle,code) values (17, 'Pays Bas', 'NL');
|
insert into llx_c_pays (id,libelle,code) values (17, 'Pays Bas', 'NL');
|
||||||
insert into c_pays (id,libelle,code) values (18, 'Hongrie', 'HU');
|
insert into llx_c_pays (id,libelle,code) values (18, 'Hongrie', 'HU');
|
||||||
insert into c_pays (id,libelle,code) values (19, 'Russie', 'RU');
|
insert into llx_c_pays (id,libelle,code) values (19, 'Russie', 'RU');
|
||||||
insert into c_pays (id,libelle,code) values (20, 'Su<EFBFBD>de', 'SE');
|
insert into llx_c_pays (id,libelle,code) values (20, 'Su<EFBFBD>de', 'SE');
|
||||||
insert into c_pays (id,libelle,code) values (21, 'C<EFBFBD>te d\'Ivoire', 'CI');
|
insert into llx_c_pays (id,libelle,code) values (21, 'C<EFBFBD>te d\'Ivoire', 'CI');
|
||||||
insert into c_pays (id,libelle,code) values (23, 'S<EFBFBD>n<EFBFBD>gal', 'SN');
|
insert into llx_c_pays (id,libelle,code) values (23, 'S<EFBFBD>n<EFBFBD>gal', 'SN');
|
||||||
insert into c_pays (id,libelle,code) values (24, 'Argentine', 'AR');
|
insert into llx_c_pays (id,libelle,code) values (24, 'Argentine', 'AR');
|
||||||
insert into c_pays (id,libelle,code) values (25, 'Cameroun', 'CM');
|
insert into llx_c_pays (id,libelle,code) values (25, 'Cameroun', 'CM');
|
||||||
|
|
||||||
delete from c_effectif;
|
delete from llx_c_effectif;
|
||||||
insert into c_effectif (id,libelle) values (0, 'Non sp<73>cifi<66>');
|
insert into llx_c_effectif (id,libelle) values (0, 'Non sp<73>cifi<66>');
|
||||||
insert into c_effectif (id,libelle) values (1, '1 - 5');
|
insert into llx_c_effectif (id,libelle) values (1, '1 - 5');
|
||||||
insert into c_effectif (id,libelle) values (2, '6 - 10');
|
insert into llx_c_effectif (id,libelle) values (2, '6 - 10');
|
||||||
insert into c_effectif (id,libelle) values (3, '11 - 50');
|
insert into llx_c_effectif (id,libelle) values (3, '11 - 50');
|
||||||
insert into c_effectif (id,libelle) values (4, '51 - 100');
|
insert into llx_c_effectif (id,libelle) values (4, '51 - 100');
|
||||||
insert into c_effectif (id,libelle) values (5, '100 - 500');
|
insert into llx_c_effectif (id,libelle) values (5, '100 - 500');
|
||||||
insert into c_effectif (id,libelle) values (6, '> 500');
|
insert into llx_c_effectif (id,libelle) values (6, '> 500');
|
||||||
|
|
||||||
delete from c_paiement;
|
delete from llx_c_paiement;
|
||||||
insert into c_paiement (id,libelle,type) values (0, '-', 3);
|
insert into llx_c_paiement (id,libelle,type) values (0, '-', 3);
|
||||||
insert into c_paiement (id,libelle,type) values (1, 'TIP', 1);
|
insert into llx_c_paiement (id,libelle,type) values (1, 'TIP', 1);
|
||||||
insert into c_paiement (id,libelle,type) values (2, 'Virement', 2);
|
insert into llx_c_paiement (id,libelle,type) values (2, 'Virement', 2);
|
||||||
insert into c_paiement (id,libelle,type) values (3, 'Pr<EFBFBD>l<EFBFBD>vement', 1);
|
insert into llx_c_paiement (id,libelle,type) values (3, 'Pr<EFBFBD>l<EFBFBD>vement', 1);
|
||||||
insert into c_paiement (id,libelle,type) values (4, 'Liquide', 0);
|
insert into llx_c_paiement (id,libelle,type) values (4, 'Liquide', 0);
|
||||||
insert into c_paiement (id,libelle,type) values (5, 'Paiement en ligne', 0);
|
insert into llx_c_paiement (id,libelle,type) values (5, 'Paiement en ligne', 0);
|
||||||
insert into c_paiement (id,libelle,type) values (6, 'CB', 1);
|
insert into llx_c_paiement (id,libelle,type) values (6, 'CB', 1);
|
||||||
insert into c_paiement (id,libelle,type) values (7, 'Ch<EFBFBD>que', 2);
|
insert into llx_c_paiement (id,libelle,type) values (7, 'Ch<EFBFBD>que', 2);
|
||||||
|
|
||||||
delete from c_propalst;
|
delete from llx_c_propalst;
|
||||||
insert into c_propalst (id,label) values (0, 'Brouillon');
|
insert into llx_c_propalst (id,label) values (0, 'Brouillon');
|
||||||
insert into c_propalst (id,label) values (1, 'Ouverte');
|
insert into llx_c_propalst (id,label) values (1, 'Ouverte');
|
||||||
insert into c_propalst (id,label) values (2, 'Sign<EFBFBD>e');
|
insert into llx_c_propalst (id,label) values (2, 'Sign<EFBFBD>e');
|
||||||
insert into c_propalst (id,label) values (3, 'Non Sign<67>e');
|
insert into llx_c_propalst (id,label) values (3, 'Non Sign<67>e');
|
||||||
insert into c_propalst (id,label) values (4, 'Factur<EFBFBD>e');
|
insert into llx_c_propalst (id,label) values (4, 'Factur<EFBFBD>e');
|
||||||
|
|
||||||
|
|
||||||
insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,admin)
|
insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,admin)
|
||||||
|
|||||||
Reference in New Issue
Block a user