New: Ajout gestion de parametres sur les boxes

New: Possibilité de mettre plusieurs boites de différents flux RSS.
This commit is contained in:
Laurent Destailleur 2006-06-18 01:34:15 +00:00
parent ac8c73555c
commit d7b7a2da94
28 changed files with 571 additions and 477 deletions

View File

@ -193,7 +193,7 @@ if ($resql)
$module=eregi_replace('.php$','',$obj->file); $module=eregi_replace('.php$','',$obj->file);
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$module.".php"); include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$module.".php");
$box=new $module(); $box=new $module($db,$obj->note);
// if (in_array($obj->rowid, $actives) && $box->box_multiple <> 1) // if (in_array($obj->rowid, $actives) && $box->box_multiple <> 1)
if (in_array($obj->rowid, $actives)) if (in_array($obj->rowid, $actives))
@ -273,7 +273,7 @@ if ($resql)
$module=eregi_replace('.php$','',$obj->file); $module=eregi_replace('.php$','',$obj->file);
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$module.".php"); include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$module.".php");
$box=new $module(); $box=new $module($db,$obj->note);
$logo=eregi_replace("^object_","",$box->boximg); $logo=eregi_replace("^object_","",$box->boximg);
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';

View File

@ -53,17 +53,21 @@ class InfoBox
/** /**
* \brief Retourne tableau des boites elligibles pour la zone * \brief Retourne tableau des boites elligibles pour la zone
* \param $zone ID de la zone (0 pour la Homepage, ...) * \param $zone ID de la zone (0 pour la Homepage, ...)
* \return array Tableau des boites qualifiées * \return array Tableau d'objet box
*/ */
function listBoxes($zone) function listBoxes($zone)
{ {
$boxes=array(); $boxes=array();
$sql = "SELECT b.rowid, b.box_id, d.file"; $sql = "SELECT b.rowid, b.box_id,";
$sql.= " d.file, d.note";
$sql.= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d";
$sql.= " WHERE b.box_id = d.rowid"; $sql.= " WHERE b.box_id = d.rowid";
$sql.= " AND position = ".$zone; $sql.= " AND position = ".$zone;
$sql.= " ORDER BY box_order"; $sql.= " ORDER BY box_order";
dolibarr_syslog("InfoBox::listBoxes sql=$sql");
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
@ -72,7 +76,12 @@ class InfoBox
while ($j < $num) while ($j < $num)
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
$boxes[$j]=eregi_replace('.php$','',$obj->file); $boxname=eregi_replace('.php$','',$obj->file);
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$boxname.".php");
$box=new $boxname($this->db,$obj->note);
$boxes[$j]=$box;
$j++; $j++;
} }
} }

View File

@ -37,6 +37,9 @@ class box_actions extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("action"); var $depends = array("action");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -36,6 +36,9 @@ class box_bookmarks extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array(); var $depends = array();
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -36,6 +36,9 @@ class box_clients extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("societe"); var $depends = array("societe");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -36,6 +36,9 @@ class box_commandes extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("commercial"); var $depends = array("commercial");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -37,9 +37,13 @@ class box_comptes extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("banque"); // Box active si module banque actif var $depends = array("banque"); // Box active si module banque actif
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();
/** /**
* \brief Constructeur de la classe * \brief Constructeur de la classe
*/ */

View File

@ -17,7 +17,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
@ -27,6 +26,10 @@ class box_energie_graph extends ModeleBoxes {
var $boxcode="energie_graph"; var $boxcode="energie_graph";
var $boximg="object_energie"; var $boximg="object_energie";
var $boxlabel; var $boxlabel;
var $depends = array("energie"); // Box active si module energie actif
var $db;
var $param;
var $box_multiple = 1; var $box_multiple = 1;

View File

@ -27,6 +27,10 @@ class box_energie_releve extends ModeleBoxes {
var $boxcode="energie"; var $boxcode="energie";
var $boximg="object_energie"; var $boximg="object_energie";
var $boxlabel; var $boxlabel;
var $depends = array("energie");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -39,17 +39,23 @@ class box_external_rss extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array(); var $depends = array();
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();
/** /**
* \brief Constructeur de la classe * \brief Constructeur de la classe
*/ */
function box_external_rss() function box_external_rss($DB,$param)
{ {
global $langs; global $langs;
$langs->load("boxes"); $langs->load("boxes");
$this->db=$DB;
$this->param=$param;
$this->boxlabel=$langs->trans("BoxLastRssInfos"); $this->boxlabel=$langs->trans("BoxLastRssInfos");
} }
@ -59,14 +65,19 @@ class box_external_rss extends ModeleBoxes {
*/ */
function loadBox($max=5) function loadBox($max=5)
{ {
global $user, $langs, $db; global $user, $langs;
$langs->load("boxes"); $langs->load("boxes");
for($site = 0; $site < 1; $site++) { // On recupere numero de param de la boite
ereg('^([0-9]+) ',$this->param,$reg);
$site=$reg[1];
// Recupere flux RSS definie dans EXTERNAL_RSS_URLRSS_$site
$rss = fetch_rss( @constant("EXTERNAL_RSS_URLRSS_".$site) ); $rss = fetch_rss( @constant("EXTERNAL_RSS_URLRSS_".$site) );
$title=$langs->trans("BoxTitleLastRssInfos",$max, @constant("EXTERNAL_RSS_TITLE_". $site)); $title=$langs->trans("BoxTitleLastRssInfos",$max, @constant("EXTERNAL_RSS_TITLE_". $site));
if ($rss->ERROR) { if ($rss->ERROR)
{
// Affiche warning car il y a eu une erreur // Affiche warning car il y a eu une erreur
$title.=" ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate",(isset($rss->date)?dolibarr_print_date($rss->date,"%d %b %Y %H:%M"):'unknown date'))); $title.=" ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate",(isset($rss->date)?dolibarr_print_date($rss->date,"%d %b %Y %H:%M"):'unknown date')));
$this->info_box_head = array('text' => $title,'limit' => 0); $this->info_box_head = array('text' => $title,'limit' => 0);
@ -76,7 +87,8 @@ class box_external_rss extends ModeleBoxes {
$this->info_box_head = array('text' => $title); $this->info_box_head = array('text' => $title);
} }
for($i = 0; $i < $max ; $i++){ for($i = 0; $i < $max ; $i++)
{
$item = $rss->items[$i]; $item = $rss->items[$i];
$href = $item['link']; $href = $item['link'];
$title = utf8_decode(urldecode($item['title'])); $title = utf8_decode(urldecode($item['title']));
@ -89,9 +101,6 @@ class box_external_rss extends ModeleBoxes {
'url' => $href, 'url' => $href,
'target' => 'newrss'); 'target' => 'newrss');
} }
}
} }
function showBox() function showBox()

View File

@ -37,6 +37,9 @@ class box_factures extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("facture"); var $depends = array("facture");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -18,7 +18,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -38,6 +37,9 @@ class box_factures_fourn extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("facture","fournisseur"); var $depends = array("facture","fournisseur");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -36,9 +36,13 @@ class box_factures_fourn_imp extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("facture","fournisseur"); var $depends = array("facture","fournisseur");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();
/** /**
* \brief Constructeur de la classe * \brief Constructeur de la classe
*/ */

View File

@ -38,6 +38,9 @@ class box_factures_imp extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("facture"); var $depends = array("facture");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -36,6 +36,9 @@ class box_fournisseurs extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("fournisseur"); var $depends = array("fournisseur");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -18,7 +18,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -37,6 +36,9 @@ class box_osc_clients extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("boutique"); var $depends = array("boutique");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -37,6 +37,9 @@ class box_produits extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("produit"); var $depends = array("produit");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -37,6 +37,9 @@ class box_propales extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("propale"); var $depends = array("propale");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -39,6 +39,9 @@ class box_prospect extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("commercial"); var $depends = array("commercial");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -37,6 +37,9 @@ class box_services_vendus extends ModeleBoxes {
var $boxlabel; var $boxlabel;
var $depends = array("produit","service"); var $depends = array("produit","service");
var $db;
var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();

View File

@ -65,6 +65,7 @@ class ModeleBoxes
$nbcol=sizeof($contents[0])+1; $nbcol=sizeof($contents[0])+1;
$nblines=sizeof($contents); $nblines=sizeof($contents);
print "\n<!-- Box start -->\n";
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
// Affiche titre de la boite // Affiche titre de la boite
@ -154,6 +155,9 @@ class ModeleBoxes
} }
print "</table>"; print "</table>";
print "\n<!-- Box end -->\n";
} }
} }

View File

@ -4,6 +4,7 @@
Snoopy - the PHP net client Snoopy - the PHP net client
Author: Monte Ohrt <monte@ispi.net> Author: Monte Ohrt <monte@ispi.net>
Modification: Laurent Destailleur (See LDR mark to find bug fix)
Copyright (c): 1999-2000 ispi, all rights reserved Copyright (c): 1999-2000 ispi, all rights reserved
Version: 1.0 Version: 1.0
@ -643,8 +644,9 @@ class Snoopy
if(!empty($this->user) || !empty($this->pass)) if(!empty($this->user) || !empty($this->pass))
$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass); $headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
for($curr_header = 0; $curr_header < count($headers); $curr_header++) for($curr_header = 0; $curr_header < count($headers); $curr_header++) {
$cmdline_params .= " -H \"".$headers[$curr_header]."\""; $cmdline_params .= " -H \"".$headers[$curr_header]."\"";
}
if(!empty($body)) if(!empty($body))
$cmdline_params .= " -d \"$body\""; $cmdline_params .= " -d \"$body\"";
@ -656,7 +658,7 @@ class Snoopy
# accept self-signed certs # accept self-signed certs
$cmdline_params .= " -k"; $cmdline_params .= " -k";
exec($this->curl_path." -D \"/tmp/$headerfile\"".$cmdline_params." ".$URI,$results,$return); exec($this->curl_path." -D \"/tmp/$headerfile\"".escapeshellcmd($cmdline_params)." ".escapeshellcmd($URI),$results,$return);
if($return) if($return)
{ {

View File

@ -93,12 +93,16 @@ class RSSCache {
return 0; return 0;
} }
if ($filesize = filesize($cache_file) ) {
$data = fread( $fp, filesize($cache_file) ); $data = fread( $fp, filesize($cache_file) );
$rss = $this->unserialize( $data ); $rss = $this->unserialize( $data );
return $rss; return $rss;
} }
return 0;
}
/*=======================================================================*\ /*=======================================================================*\
Function: check_cache Function: check_cache
Purpose: check a url for membership in the cache Purpose: check a url for membership in the cache
@ -130,6 +134,18 @@ class RSSCache {
} }
} }
function cache_age( $cache_key ) {
$filename = $this->file_name( $url );
if ( file_exists( $filename ) ) {
$mtime = filemtime( $filename );
$age = time() - $mtime;
return $age;
}
else {
return -1;
}
}
/*=======================================================================*\ /*=======================================================================*\
Function: serialize Function: serialize
\*=======================================================================*/ \*=======================================================================*/

View File

@ -5,7 +5,7 @@
to fetching and parsing RSS files, via the to fetching and parsing RSS files, via the
function fetch_rss() function fetch_rss()
* Author: Kellan Elliott-McCrea <kellan@protest.net> * Author: Kellan Elliott-McCrea <kellan@protest.net>
* Modified by Laurent Destailleur <eldy@users.sourceforge.net> for Dolibarr * Modification: Laurent Destailleur (See LDR mark to find bug fix)
* License: GPL * License: GPL
* *
* The lastest version of MagpieRSS can be obtained from: * The lastest version of MagpieRSS can be obtained from:
@ -82,10 +82,13 @@ require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc');
version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off) version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off)
\*=======================================================================*/ \*=======================================================================*/
define('MAGPIE_VERSION', '0.7'); define('MAGPIE_VERSION', '0.72');
$MAGPIE_ERROR = ""; $MAGPIE_ERROR = "";
// LDR Added cachedir parameter to replace use of MAGPIE_CACHE_RSS and
// allow several call to different url with different a cache foreach of
// inside same PHP session.
function fetch_rss ($url) { function fetch_rss ($url) {
// initialize constants // initialize constants
init(); init();
@ -192,18 +195,16 @@ function fetch_rss ($url) {
# compensate for Snoopy's annoying habbit to tacking # compensate for Snoopy's annoying habbit to tacking
# on '\n' # on '\n'
$http_error = substr($resp->error, 0, -2); $http_error = substr($resp->error, 0, -2);
// LDR FIX BUG (plus necessaire car corrigé par ligne du dessus)
//$http_error = eregi_replace("\n","",$resp->error);
$errormsg .= "(HTTP Error: $http_error)"; $errormsg .= "(HTTP Error: $http_error)";
} }
else { else {
$errormsg .= "(HTTP Response: " . $resp->response_code .')'; $errormsg .= "(HTTP Response: " . $resp->response_code .')';
} }
// LDR FIX BUG Si echec recup http mais cache bien lu, // LDR FIX BUG If fails to get http url but cache file is read successfuly,
// on stock erreur dans object rss // we store error as a property of $rss->ERROR and date of last successful
// http access in $rss->date property.
// This allows caller to trap error reasons and manage itself networks errors.
if ($rss) if ($rss)
{ {
if ($cache && $cache_key) $rss->date=filemtime($cache->file_name($cache_key)); if ($cache && $cache_key) $rss->date=filemtime($cache->file_name($cache_key));
@ -366,24 +367,7 @@ function init () {
} }
if ( !defined('MAGPIE_CACHE_DIR') ) { if ( !defined('MAGPIE_CACHE_DIR') ) {
define('MAGPIE_CACHE_DIR', './cache');
// Le rep de cache est defini dans DOL_DATA_ROOT
$ret=true;
if (! file_exists(DOL_DATA_ROOT)) {
$ret=mkdir(DOL_DATA_ROOT);
}
if ($ret && ! file_exists(DOL_DATA_ROOT.'/rsscache')) {
$ret=mkdir(DOL_DATA_ROOT.'/rsscache');
}
define('MAGPIE_CACHE_DIR', DOL_DATA_ROOT.'/rsscache');
// Si le rep de cache n'a pu etre trouvé ou créé, on utilise
// l'ancien dans DOL_DOCUMENT_ROOT pour raison de compatibilite
// avec anciennes versions
if (! $ret) {
define('MAGPIE_CACHE_DIR', DOL_DOCUMENT_ROOT.'/rsscache');
}
} }
if ( !defined('MAGPIE_CACHE_AGE') ) { if ( !defined('MAGPIE_CACHE_AGE') ) {

View File

@ -60,7 +60,6 @@ class MagpieRSS {
var $incontent = false; // if in Atom <content mode="xml"> field var $incontent = false; // if in Atom <content mode="xml"> field
var $intextinput = false; var $intextinput = false;
var $inimage = false; var $inimage = false;
var $current_field = '';
var $current_namespace = false; var $current_namespace = false;
@ -259,7 +258,6 @@ class MagpieRSS {
function feed_cdata ($p, $text) { function feed_cdata ($p, $text) {
if ($this->feed_type == ATOM and $this->incontent) if ($this->feed_type == ATOM and $this->incontent)
{ {
$this->append_content( $text ); $this->append_content( $text );
@ -391,7 +389,7 @@ class MagpieRSS {
$atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified']; $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified'];
if ( $atom_date ) { if ( $atom_date ) {
$epoch = @parse_w3cdtf($item['modified']); $epoch = @parse_w3cdtf($atom_date);
if ($epoch and $epoch > 0) { if ($epoch and $epoch > 0) {
$item['date_timestamp'] = $epoch; $item['date_timestamp'] = $epoch;
} }
@ -560,7 +558,7 @@ class MagpieRSS {
function error ($errormsg, $lvl=E_USER_WARNING) { function error ($errormsg, $lvl=E_USER_WARNING) {
// append PHP's error message if track_errors enabled // append PHP's error message if track_errors enabled
if ( $php_errormsg ) { if ( isset($php_errormsg) ) {
$errormsg .= " ($php_errormsg)"; $errormsg .= " ($php_errormsg)";
} }
if ( MAGPIE_DEBUG ) { if ( MAGPIE_DEBUG ) {
@ -585,5 +583,23 @@ function map_attrs($k, $v) {
return "$k=\"$v\""; return "$k=\"$v\"";
} }
// patch to support medieval versions of PHP4.1.x,
// courtesy, Ryan Currie, ryan@digibliss.com
if (!function_exists('array_change_key_case')) {
define("CASE_UPPER",1);
define("CASE_LOWER",0);
function array_change_key_case($array,$case=CASE_LOWER) {
if ($case=CASE_LOWER) $cmd=strtolower;
elseif ($case=CASE_UPPER) $cmd=strtoupper;
foreach($array as $key=>$value) {
$output[$cmd($key)]=$value;
}
return $output;
}
}
?> ?>

View File

@ -484,31 +484,30 @@ print '</td></tr></table>';
*/ */
include_once("./boxes.php"); include_once("./boxes.php");
$infobox=new InfoBox($db); $infobox=new InfoBox($db);
$boxes=$infobox->listboxes("0"); // 0 = valeur pour la page accueil $boxarray=$infobox->listboxes("0"); // 0 = valeur pour la page accueil
$NBCOLS=2; // Nombre de colonnes pour les boites $NBCOLS=2; // Nombre de colonnes pour les boites
if (sizeof($boxes)) if (sizeof($boxarray))
{ {
print '<br>'; print '<br>';
print_fiche_titre($langs->trans("OtherInformationsBoxes")); print_fiche_titre($langs->trans("OtherInformationsBoxes"));
print '<table width="100%" class="notopnoleftnoright">'; print '<table width="100%" class="notopnoleftnoright">';
} }
for ($ii=0, $ni=sizeof($boxes); $ii<$ni; $ii++) for ($ii=0, $ni=sizeof($boxarray); $ii<$ni; $ii++)
{ {
if ($ii % $NBCOLS == 0) print "<tr>\n"; if ($ii % $NBCOLS == 0) print "<tr>\n";
print '<td valign="top" width="50%">'; print '<td valign="top" width="50%">';
// Affichage boite ii // Affichage boite ii
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$boxes[$ii].".php"); $box=$boxarray[$ii];
$box=new $boxes[$ii]();
$box->loadBox(); $box->loadBox();
$box->showBox(); $box->showBox();
print "</td>"; print "</td>";
if ($ii % $NBCOLS == ($NBCOLS-1)) print "</tr>\n"; if ($ii % $NBCOLS == ($NBCOLS-1)) print "</tr>\n";
} }
if (sizeof($boxes)) if (sizeof($boxarray))
{ {
if ($ii % $NBCOLS == ($NBCOLS-1)) print "</tr>\n"; if ($ii % $NBCOLS == ($NBCOLS-1)) print "</tr>\n";
print "</table>"; print "</table>";

View File

@ -269,7 +269,7 @@ VATReceivedOnly=Taux special non factur
VATManagement=Gestion TVA VATManagement=Gestion TVA
VATIsUsed=Assujéti à TVA VATIsUsed=Assujéti à TVA
VATIsNotUsed=Non assujéti à TVA VATIsNotUsed=Non assujéti à TVA
VATIsUsedDesc=Le taux de TVA proposé par défaut lors de la création de propale, facture, commande, etc répond à la règle standard suivante:<br>Si vendeur non assujeti à TVA, TVA par défaut=0. Fin de règle.<br>Si le (pays vendeur = pays acheteur) alors la TVA par défaut=TVA du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payé par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu autre que transport neuf alors la TVA par défaut=TVA du produit vendu. Fin de règle.<br>Sinon la TVA proposée par défaut=0. Fin de règle. VATIsUsedDesc=Le taux de TVA proposé par défaut lors de la création de propale, facture, commande, etc répond à la règle standard suivante:<br>Si le (pays vendeur = pays acheteur) alors la TVA par défaut=TVA du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payé par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu autre que transport neuf alors la TVA par défaut=TVA du produit vendu. Fin de règle.<br>Sinon la TVA proposée par défaut=0. Fin de règle.
VATIsNotUsedDesc=Le taux de TVA proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés. VATIsNotUsedDesc=Le taux de TVA proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés.
VATIsUsedExampleFR=En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée. VATIsUsedExampleFR=En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée.
VATIsNotUsedExampleFR=En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaitre la mention "TVA non applicable - art-293B du CGI" sur les factures. VATIsNotUsedExampleFR=En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaitre la mention "TVA non applicable - art-293B du CGI" sur les factures.

View File

@ -145,14 +145,17 @@ $langs->setPhpLang($conf->global->MAIN_LANG_DEFAULT);
* Pour PHPlot: PHPLOT_PATH * Pour PHPlot: PHPLOT_PATH
* Pour MagpieRss: MAGPIERSS_PATH * Pour MagpieRss: MAGPIERSS_PATH
*/ */
// Les path racines
if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); } if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); }
if (! defined('PEAR_PATH')) { define('PEAR_PATH', DOL_DOCUMENT_ROOT .'/includes/pear/'); } if (! defined('PEAR_PATH')) { define('PEAR_PATH', DOL_DOCUMENT_ROOT .'/includes/pear/'); }
if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); } if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
if (! defined('PHPLOT_PATH')) { define('PHPLOT_PATH', DOL_DOCUMENT_ROOT .'/includes/phplot/'); } if (! defined('PHPLOT_PATH')) { define('PHPLOT_PATH', DOL_DOCUMENT_ROOT .'/includes/phplot/'); }
if (! defined('MAGPIERSS_PATH')) { define('MAGPIERSS_PATH', DOL_DOCUMENT_ROOT .'/includes/magpierss/'); } if (! defined('MAGPIERSS_PATH')) { define('MAGPIERSS_PATH', DOL_DOCUMENT_ROOT .'/includes/magpierss/'); }
if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); } if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); }
define('FPDF_FONTPATH', FPDF_PATH . 'font/'); // Les autres path
define('MAGPIE_DIR', MAGPIERSS_PATH); if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); }
if (! defined('MAGPIE_DIR')) { define('MAGPIE_DIR', MAGPIERSS_PATH); }
if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', DOL_DATA_ROOT .'/rsscache'); }
// \todo Ajouter la ligne // \todo Ajouter la ligne
// require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); // require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");