diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index ba117a8d635..e12b33e8c6c 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -495,7 +495,7 @@ else // Ligne de 3 colonnes print ''.$langs->trans("AmountHT").''; print ''.price($commande->total_ht).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; print ''.$langs->trans("Note").' :'; print 'Remise globale'; @@ -512,12 +512,12 @@ else print ''; print ''.$langs->trans("VAT").''.price($commande->total_tva).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; print ''.$langs->trans("TotalTTC").''.price($commande->total_ttc).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; if ($commande->note) { - print 'Note : '.nl2br($commande->note).""; + print ''.$langs->trans("Note").' : '.nl2br($commande->note).""; } print ""; diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 377b1b72751..49f8abe96e9 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -128,11 +128,11 @@ else $total = $total + (0 - $objp->amount); } $db->free(); - print "".$langs->trans("Total")."".price(abs($total))."".MAIN_MONNAIE.""; + print "".$langs->trans("Total")."".price(abs($total))."".$conf->monnaie.""; } else { - print $db->error(); + dolibarr_print_error($db); } print ""; diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 84e353f24fc..84e6ffb6f46 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -71,7 +71,7 @@ if ($_POST["action"] == 'add') $accountto=new Account($db); $accountto->fetch($_POST["account_to"]); - $mesg.="
Votre virement entre id."\">".$accountfrom->label." et id."\">".$accountto->label." de ".$amount." ".MAIN_MONNAIE." a été crée.
"; + $mesg.="
Votre virement entre id."\">".$accountfrom->label." et id."\">".$accountto->label." de ".$amount." ".$conf->monnaie." a été crée.
"; } else { dolibarr_print_error($db); diff --git a/htdocs/compta/commande.php b/htdocs/compta/commande.php index bc5978ea984..19109729dc3 100644 --- a/htdocs/compta/commande.php +++ b/htdocs/compta/commande.php @@ -116,9 +116,9 @@ if ($_GET["id"] > 0) } print " "; - print 'Montant'; + print ''.$langs->trans("Amount").''; print ''.price($commande->total_ht).''; - print ''.MAIN_MONNAIE.' HT'; + print ''.$conf->monnaie.' HT'; print 'Note'; @@ -128,13 +128,13 @@ if ($_GET["id"] > 0) print ''; - print 'TVA'.price($commande->total_tva).''; - print ''.MAIN_MONNAIE.''; + print ''.$langs->trans("VAT").''.price($commande->total_tva).''; + print ''.$conf->monnaie.''; print ''.$langs->trans("TotalTTC").''.price($commande->total_ttc).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; if ($commande->note) { - print 'Note : '.nl2br($commande->note).""; + print ''.$langs->trans("Note").' : '.nl2br($commande->note).""; } print ""; @@ -288,7 +288,7 @@ if ($_GET["id"] > 0) $total = $total + $objp->total; $i++; } - print "".$langs->trans("TotalHT").": $total ".MAIN_MONNAIE."\n"; + print "".$langs->trans("TotalHT").": $total ".$conf->monnaie."\n"; print ""; } $db->free(); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index eac8cc447a2..b39a87f646b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -884,7 +884,7 @@ else print ''.img_file().''; print " ".strftime("%d %B %Y",$objp->dp)."\n"; print "$objp->paiement_type $objp->num_paiement\n"; - print ''.price($objp->amount)."".MAIN_MONNAIE."\n"; + print ''.price($objp->amount)."".$conf->monnaie."\n"; print ""; $totalpaye += $objp->amount; $i++; @@ -892,13 +892,13 @@ else if ($fac->paye == 0) { - print "Total déjà payé:".price($totalpaye)."".MAIN_MONNAIE."\n"; + print "Total déjà payé:".price($totalpaye)."".$conf->monnaie."\n"; print "Facturé :".price($fac->total_ttc)."".MAIN_MONNAIE."\n"; $resteapayer = $fac->total_ttc - $totalpaye; print "Reste à payer :"; - print "".price($resteapayer)."".MAIN_MONNAIE."\n"; + print "".price($resteapayer)."".$conf->monnaie."\n"; } print ""; $db->free(); @@ -916,12 +916,12 @@ else print ''.$langs->trans("AmountHT").''; print ''.price($fac->total_ht).''; - print ''.MAIN_MONNAIE.' HT'; + print ''.$conf->monnaie.' HT'; print ''.$langs->trans("VAT").''.price($fac->total_tva).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; print ''.$langs->trans("AmountTTC").''.price($fac->total_ttc).''; - print ''.MAIN_MONNAIE.' TTC'; + print ''.$conf->monnaie.' TTC'; print ''.$langs->trans("Status").''.($fac->get_libstatut()).''; if ($fac->note) { @@ -1452,7 +1452,7 @@ else $total = $total + $objp->price; $i++; } - print "".$langs->trans("TotalHT").": ".price($total)." ".MAIN_MONNAIE."\n"; + print "".$langs->trans("TotalHT").": ".price($total)." ".$conf->monnaie."\n"; print ""; } } else { diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index e713244c97c..62e00b5927a 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -211,7 +211,7 @@ if ($_GET["facid"] > 0) print ''.$langs->trans("AmountHT").''; print ''.price($fac->total_ht).''; - print ''.MAIN_MONNAIE.' HT'; + print ''.$conf->monnaie.' HT'; print "
"; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 4cae79c6f22..2d959266ad8 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -292,14 +292,14 @@ else print ""; - print 'Montant'; + print ''.$langs->trans("Amount").''; print ''.price($fac->total_ht).''; - print ''.MAIN_MONNAIE.' HT'; + print ''.$conf->monnaie.' HT'; - print 'TVA'.price($fac->total_tva).''; - print ''.MAIN_MONNAIE.''; + print ''.$langs->trans("VAT").''.price($fac->total_tva).''; + print ''.$conf->monnaie.''; print ''.$langs->trans("TotalTTC").''.price($fac->total_ttc).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; if ($fac->note) { print 'Note : '.nl2br($fac->note).""; diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index f6436198dda..8a0573855bb 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -88,7 +88,7 @@ print $langs->trans("Date").' : '.strftime("%d %B %Y",$paiement->date)."
"; print $langs->trans("Type").' : '.$paiement->type_libelle."
"; -print $langs->trans("Amount").' : '.$paiement->montant." ".MAIN_MONNAIE."
"; +print $langs->trans("Amount").' : '.$paiement->montant." ".$conf->monnaie."
"; print ''; print ""; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 50b98e27827..8d6e414bb8e 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -258,7 +258,7 @@ if ($_GET["propalid"]) $total = $total + $objp->total; $i++; } - print "".$langs->trans("TotalHT").": $total ".MAIN_MONNAIE."\n"; + print "".$langs->trans("TotalHT").": $total ".$conf->monnaie."\n"; print ""; $db->free(); } diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 9c963be51fc..3bff81ea35e 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -127,7 +127,7 @@ if ($chid > 0) print ""; print dolibarr_print_date($objp->dp)."\n"; print "$objp->paiement_type $objp->num_paiement\n"; - print ''.price($objp->amount)."".MAIN_MONNAIE."\n"; + print ''.price($objp->amount)."".$conf->monnaie."\n"; print ""; $totalpaye += $objp->amount; $i++; @@ -135,13 +135,13 @@ if ($chid > 0) if ($fac->paye == 0) { - print "Total payé:".price($totalpaye)."".MAIN_MONNAIE."\n"; + print "Total payé:".price($totalpaye)."".$conf->monnaie."\n"; print "Réclamé :".price($cha->amount)."".MAIN_MONNAIE."\n"; $resteapayer = $cha->amount - $totalpaye; print "Reste à payer :"; - print "".price($resteapayer)."".MAIN_MONNAIE."\n"; + print "".price($resteapayer)."".$conf->monnaie."\n"; } print ""; $db->free(); diff --git a/htdocs/compta/stats/cumul.php b/htdocs/compta/stats/cumul.php index fed12e5c24f..839751de991 100644 --- a/htdocs/compta/stats/cumul.php +++ b/htdocs/compta/stats/cumul.php @@ -36,7 +36,7 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } -print_titre("Chiffre d'affaire cumulé (".MAIN_MONNAIE." HT)"); +print_titre("Chiffre d'affaire cumulé (".$conf->monnaie." HT)"); print '"; + print ""; $db->free(); } diff --git a/htdocs/compta/tva.php b/htdocs/compta/tva.php index fced5772b01..195974b2af1 100644 --- a/htdocs/compta/tva.php +++ b/htdocs/compta/tva.php @@ -55,9 +55,9 @@ function pt ($db, $sql, $date) { $i++; } - print ""; + print ""; - print "
'; diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php index 18f8b83ffb7..df70e64c411 100644 --- a/htdocs/compta/stats/exercices.php +++ b/htdocs/compta/stats/exercices.php @@ -41,7 +41,7 @@ $mode='recettes'; if ($conf->compta->mode == 'CREANCES-DETTES') { $mode='creances'; } -print_titre("Comparatif CA année en cours avec année précédente (".MAIN_MONNAIE." HT, ".$mode.")"); +print_titre("Comparatif CA année en cours avec année précédente (".$conf->monnaie." HT, ".$mode.")"); print "
\n"; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 48398169699..60302b96a8a 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -39,7 +39,7 @@ if ($user->societe_id > 0) $mode='recettes'; if ($conf->compta->mode == 'CREANCES-DETTES') { $mode='creances'; } -print_titre("Chiffre d'affaire (".MAIN_MONNAIE." HT, ".$mode.")"); +print_titre("Chiffre d'affaire (".$conf->monnaie." HT, ".$mode.")"); $sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; diff --git a/htdocs/compta/stats/prev.php b/htdocs/compta/stats/prev.php index 12321b83716..31bc7a66189 100644 --- a/htdocs/compta/stats/prev.php +++ b/htdocs/compta/stats/prev.php @@ -60,7 +60,7 @@ function pt ($db, $sql, $title) { $total = $total + $obj->amount; $i++; } - print "
".$langs->trans("TotalHT").": ".price($total)." ".MAIN_MONNAIE."
".$langs->trans("TotalHT").": ".price($total)." ".$conf->monnaie."
".$langs->trans("TotalHT").":".price($total)."".MAIN_MONNAIE."
".$langs->trans("TotalHT").":".price($total)."".$conf->monnaie."
"; + print ""; $db->free(); } } diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index ac04c0b66bb..fd41d0d710a 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -65,7 +65,7 @@ if ($result) $i++; } print "".$langs->trans("TotalHT").":"; - print "".price($total)."".MAIN_MONNAIE.""; + print "".price($total)."".$conf->monnaie.""; print ""; $db->free(); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index ac55623f6c8..ea998d49ad6 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -320,15 +320,15 @@ if ($id > 0) // Ligne de 3 colonnes print ''.$langs->trans("AmountHT").''; print ''.price($commande->total_ht).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; print ''.$langs->trans("Note").' :'; print ''.$langs->trans("VAT").''.price($commande->total_tva).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; print ''.$langs->trans("TotalTTC").''.price($commande->total_ttc).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; if ($commande->note) { print 'Note : '.nl2br($commande->note).""; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 1a3ab071125..272d68122e0 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -469,7 +469,7 @@ else print ""; print "".strftime("%d %B %Y",$objp->dp)."\n"; print "$objp->paiement_type $objp->num_paiement\n"; - print "".price($objp->amount)."".MAIN_MONNAIE."\n"; + print "".price($objp->amount)."".$conf->monnaie."\n"; if ($fac->statut == 1 && $fac->paye == 0 && $user->societe_id == 0) { @@ -483,14 +483,14 @@ else $total = $total + $objp->amount; $i++; } - print "Total :".price($total)."".MAIN_MONNAIE."\n"; + print "Total :".price($total)."".$conf->monnaie."\n"; if ($fac->statut > 0) { $resteapayer = abs($fac->total_ttc - $total); print "Reste à payer :"; - print ''.price($resteapayer)."".MAIN_MONNAIE.""; + print ''.price($resteapayer)."".$conf->monnaie.""; print "\n"; } diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 37e5376a159..4a3587e4880 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -623,7 +623,7 @@ class pdf_crabe extends ModelePDFFactures */ function _pagefoot(&$pdf, $fac) { - global $langs; + global $langs, $conf; $langs->load("main"); $langs->load("bills"); $langs->load("companies"); @@ -633,7 +633,7 @@ class pdf_crabe extends ModelePDFFactures if (MAIN_INFO_CAPITAL) { $pdf->SetY(-$footy); - $pdf->MultiCell(190, 3,"SARL au Capital de " . MAIN_INFO_CAPITAL." ".MAIN_MONNAIE." - " . MAIN_INFO_RCS." - Identifiant professionnel: " . MAIN_INFO_SIREN , 0, 'C'); + $pdf->MultiCell(190, 3,"SARL au Capital de " . MAIN_INFO_CAPITAL." ".$conf->monnaie." - " . MAIN_INFO_RCS." - Identifiant professionnel: " . MAIN_INFO_SIREN , 0, 'C'); $footy-=3; } diff --git a/htdocs/lolix/societe/fiche.php b/htdocs/lolix/societe/fiche.php index 92614cc3e6a..7cdf9006920 100644 --- a/htdocs/lolix/societe/fiche.php +++ b/htdocs/lolix/societe/fiche.php @@ -81,7 +81,7 @@ if ($_GET["action"] == 'edit') print 'Siret'; print 'Ape'; - print 'Capital '.MAIN_MONNAIE.''; + print 'Capital '.$conf->monnaie.''; print 'Forme juridique'; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 78f1dbf12c4..a7f77f96568 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -33,6 +33,7 @@ define('DOL_VERSION','1.2.0-DEV'); define_syslog_variables(); +clearstatcache(); ini_set('mbstring.func_overload','0'); @@ -50,8 +51,7 @@ else if (! isset($dolibarr_main_db_type)) { - $dolibarr_main_db_type='mysql'; - //exit('Erreur la variale $dolibarr_main_db_type n\'est pas définie dans le fichier de configuration'); + $dolibarr_main_db_type='mysql'; // Pour compatibilité avec anciennes configs, si non défini, on prend 'mysql' } define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); @@ -73,10 +73,11 @@ if ($pos == '/') define('DOL_URL_ROOT', $pos); //define('DOL_URL_ROOT', $dolibarr_main_url_root); -require (DOL_DOCUMENT_ROOT."/conf/conf.class.php"); + /* - * Doit figurer aprés l'inclusion de conf.class.php pour overider certaines variables, à terme conf.class.php devra etre un fichier qui ne sera pas modifié par l'utilisateur + * Initialisation de l'objet $conf */ +require_once(DOL_DOCUMENT_ROOT."/conf/conf.class.php"); $conf = new Conf(); if (!strlen(getenv("LLX_DBNAME"))) { @@ -86,41 +87,32 @@ if (!strlen(getenv("LLX_DBNAME"))) $conf->db->pass = $dolibarr_main_db_pass; $conf->db->type = $dolibarr_main_db_type; } +if (! $conf->db->type) { $conf->db->type = 'mysql'; } // Pour compatibilité avec anciennes configs, si non défini, on prend 'mysql' +define('MAIN_DB_PREFIX','llx_'); // A terme cette constante sera définie dans $conf - -// Si type non défini (pour compatibilité avec ancienne install), on -// travail avec mysql -if (! $conf->db->type) { $conf->db->type = 'mysql'; } - - -// A terme cette constante sera définie dans la base -define('MAIN_DB_PREFIX','llx_'); - -require (DOL_DOCUMENT_ROOT ."/lib/".$conf->db->type.".lib.php"); -require (DOL_DOCUMENT_ROOT ."/lib/functions.inc.php"); -require (DOL_DOCUMENT_ROOT ."/html.form.class.php"); -require (DOL_DOCUMENT_ROOT ."/user.class.php"); +/* + * Chargement des includes principaux + */ +require_once(DOL_DOCUMENT_ROOT ."/lib/".$conf->db->type.".lib.php"); +require_once(DOL_DOCUMENT_ROOT ."/user.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/lib/functions.inc.php"); +require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/boxes.php"); +require_once(DOL_DOCUMENT_ROOT ."/notify.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/address.class.php"); $db = new DoliDb(); $user = new User($db); -clearstatcache(); - - -require (DOL_DOCUMENT_ROOT ."/product.class.php"); -require (DOL_DOCUMENT_ROOT ."/menu.class.php"); -require (DOL_DOCUMENT_ROOT ."/societe.class.php"); -require (DOL_DOCUMENT_ROOT ."/boxes.php"); -require (DOL_DOCUMENT_ROOT ."/address.class.php"); -require (DOL_DOCUMENT_ROOT ."/notify.class.php"); -require (DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf152/fpdf.php"); - +// \todo mettre ces includes uniquement sur les éléments qui manipulent du PDF +require_once(DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf152/fpdf.php"); define('FPDF_FONTPATH',DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf152/font/'); + /* * Definition de toutes les Constantes globales d'environnement - * */ $sql = "SELECT name, value FROM ".MAIN_DB_PREFIX."const"; $result = $db->query($sql); @@ -152,9 +144,8 @@ if (strlen($conf->langage) <= 3) { $conf->langage = strtolower($conf->langage)."_".strtoupper($conf->langage); } setlocale(LC_ALL, $conf->langage); -//setlocale(LC_TIME, $conf->language); -require (DOL_DOCUMENT_ROOT ."/translate.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/translate.class.php"); $langs = new Translate(DOL_DOCUMENT_ROOT ."/langs", $conf->langage); @@ -184,6 +175,7 @@ if (defined("MAIN_MODULE_EXPEDITION")) if (defined("MAIN_MODULE_SOCIETE")) { $conf->societe->enabled=MAIN_MODULE_SOCIETE; + require_once(DOL_DOCUMENT_ROOT ."/societe.class.php"); } if (defined("MAIN_MODULE_COMMERCIAL")) { @@ -212,7 +204,7 @@ if (defined("MAIN_MODULE_FOURNISSEUR")) if (defined("MAIN_MODULE_FICHEINTER")) { $conf->fichinter->enabled=MAIN_MODULE_FICHEINTER; - require (DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/modules_fichinter.php"); + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/modules_fichinter.php"); } if (defined("MAIN_MODULE_ADHERENT")) { @@ -224,6 +216,7 @@ if (defined("MAIN_MODULE_PRODUIT")) $conf->produit->dir_ouput=DOL_DATA_ROOT."/documents/produit"; $conf->produit->dir_images=DOL_DOCUMENT_ROOT."/images/produit"; $conf->produit->url_images=DOL_URL_ROOT."/images/produit"; + require_once(DOL_DOCUMENT_ROOT ."/product.class.php"); } if (defined("MAIN_MODULE_SERVICE")) { @@ -231,6 +224,7 @@ if (defined("MAIN_MODULE_SERVICE")) $conf->service->dir_ouput=DOL_DATA_ROOT."/documents/produit"; $conf->service->dir_images=DOL_DOCUMENT_ROOT."/images/produit"; $conf->service->url_images=DOL_URL_ROOT."/images/produit"; + require_once(DOL_DOCUMENT_ROOT ."/product.class.php"); } if (defined("MAIN_MODULE_STOCK")) { @@ -280,7 +274,7 @@ if (defined("MAIN_MODULE_WEBCALENDAR")) if (defined("MAIN_MODULE_FACTURE")) { $conf->facture->enabled=MAIN_MODULE_FACTURE; - require (DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); $conf->facture->dir_ouput=DOL_DATA_ROOT."/documents/facture"; $conf->facture->dir_images=DOL_DOCUMENT_ROOT."/images/facture"; $conf->facture->url_images=DOL_URL_ROOT."/images/facture"; @@ -288,12 +282,12 @@ if (defined("MAIN_MODULE_FACTURE")) if (defined("MAIN_MODULE_PROPALE")) { $conf->propal->enabled=MAIN_MODULE_PROPALE; - require (DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); $conf->propale->dir_ouput=DOL_DATA_ROOT."/documents/propale"; $conf->propale->dir_images=DOL_DOCUMENT_ROOT."/images/propale"; $conf->propale->url_images=DOL_URL_ROOT."/images/propale"; - // \todo a virer car remplacé par $conf->propale->dir_ouput + // \todo modifier le code des propales pour utiliser $conf->propale->dir_ouput au lieu de la constante if (! defined("PROPALE_OUTPUTDIR")) { define('PROPALE_OUTPUTDIR', DOL_DOCUMENT_ROOT . "/document/propale"); @@ -314,21 +308,19 @@ if (defined("MAIN_MODULE_PROPALE")) /* * Modification de quelques variable de conf en fonction des Constantes */ - if (defined("MAIN_MONNAIE")) { $conf->monnaie=MAIN_MONNAIE; } else { $conf->monnaie='euros'; - define("MAIN_MONNAIE",'euros'); // TODO Virer cette ligne et remplacer dans le code le MAIN_MONNAIE par $conf->monnaie } /* * Option du module Compta: Defini le mode de calcul du CA */ -$conf->compta->mode = 'RECETTES-DEPENSES'; // Par défaut +$conf->compta->mode = 'RECETTES-DEPENSES'; // Par défaut if (defined("COMPTA_MODE")) { - $conf->compta->mode = RECETTES-DEPENSES; // Peut etre 'CREANCES-DETTES' pour un CA en creances-dettes + $conf->compta->mode = RECETTES-DEPENSES; // Peut etre 'CREANCES-DETTES' pour un CA en creances-dettes } /* \todo Ajouter une option Gestion de la TVA dans le module compta qui permet de désactiver la fonction TVA @@ -341,10 +333,10 @@ $conf->compta->tva=1; * Option du module Facture */ if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') { - $conf->defaulttx='0'; # Taux par défaut des factures clients + $conf->defaulttx='0'; // Taux par défaut des factures clients } else { - $conf->defaulttx=''; # Pas de taux par défaut des factures clients, le premier sera pris + $conf->defaulttx=''; // Pas de taux par défaut des factures clients, le premier sera pris } /* diff --git a/htdocs/projet/commandes.php b/htdocs/projet/commandes.php index cc3d90aa5ba..b67e1a682ce 100644 --- a/htdocs/projet/commandes.php +++ b/htdocs/projet/commandes.php @@ -111,7 +111,7 @@ if (sizeof($commandes)>0 && is_array($commandes)) print ''.$i.' commandes '; print ''.$langs->trans("TotalHT").': '.price($total).''; - print ''.MAIN_MONNAIE.''; + print ''.$conf->monnaie.''; print ""; } diff --git a/htdocs/projet/facture.php b/htdocs/projet/facture.php index 4f45781a968..8caa91881ca 100644 --- a/htdocs/projet/facture.php +++ b/htdocs/projet/facture.php @@ -108,18 +108,18 @@ print '
'; $facture->fetch($factures[$i]); $var=!$var; - print ""; - print "id\">$facture->ref\n"; + print ""; + print "id\">$facture->ref\n"; print ''.strftime("%d %B %Y",$facture->date).''; - print ''.price($facture->total_ht).' '; + print ''.price($facture->total_ht).' '; $total = $total + $facture->total_ht; } print ''.$i.' factures '; - print 'Total : '.price($total).''; - print ''.MAIN_MONNAIE.' HT'; - print ""; + print ''.$langs->trans("Total").' : '.price($total).''; + print ''.$conf->monnaie.' HT'; + print ""; } $db->close(); diff --git a/htdocs/projet/propal.php b/htdocs/projet/propal.php index d6083d4103c..14a9c5bb521 100644 --- a/htdocs/projet/propal.php +++ b/htdocs/projet/propal.php @@ -109,7 +109,7 @@ if (sizeof($propales)>0 && is_array($propales)) print ''.$i.' propales '; print 'Total : '.price($total).''; - print ''.MAIN_MONNAIE.' HT'; + print ''.$conf->monnaie.' HT'; } $db->close(); diff --git a/htdocs/soc.php b/htdocs/soc.php index 4021bb339ba..5788107997b 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -150,7 +150,7 @@ if ($_GET["action"] == 'create') print ''.$langs->trans('ProfIdSiret').''; print ''.$langs->trans('ProfIdApe').''; - print 'Capital '.MAIN_MONNAIE.''; + print 'Capital '.$conf->monnaie.''; print 'Forme juridique'; $form->select_forme_juridique($soc->forme_juridique_code); @@ -242,7 +242,7 @@ elseif ($_GET["action"] == 'edit') print ''.$langs->trans('ProfIdSiret').''; print ''.$langs->trans('ProfIdApe').''; - print 'Capital '.MAIN_MONNAIE.''; + print 'Capital '.$conf->monnaie.''; print 'Forme juridique'; $form->select_forme_juridique($soc->forme_juridique_code); @@ -359,7 +359,7 @@ else print ''.$langs->trans('ProfIdSiret').''.$soc->siret.''; print ''.$langs->trans('ProfIdApe').''.$soc->ape.''; - print 'Capital'.$soc->capital.' '.MAIN_MONNAIE.''; + print 'Capital'.$soc->capital.' '.$conf->monnaie.''; print 'Forme juridique'.$soc->forme_juridique.''; print 'Effectif'.$soc->effectif.'';