From 7f376ced5781a251a543cab007bd4acfe1173299 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 May 2008 22:30:52 +0000 Subject: [PATCH] New: Add dictionnary for type of fees in fees and trips module --- htdocs/admin/dict.php | 44 ++++++++++++++++++++++++----------- htdocs/comm/mailing/fiche.php | 20 ++++++++-------- htdocs/langs/en_US/admin.lang | 2 ++ htdocs/langs/fr_FR/admin.lang | 2 ++ 4 files changed, 45 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e33548077e5..a186668c890 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -22,7 +22,7 @@ /** \file htdocs/admin/dict.php \ingroup setup - \brief Page d'administration des dictionnaires de donn�es + \brief Page to administer data tables \version $Id$ */ @@ -46,7 +46,7 @@ $active = 1; // Mettre ici tous les caract�ristiques des dictionnaires // Ordres d'affichage des dictionnaires (0 pour espace) -$taborder=array(9,0,4,3,2,0,1,8,16,0,5,11,0,6,0,10,12,13,0,14,0,7,0,15); +$taborder=array(9,0,4,3,2,0,1,8,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,15); // Nom des tables des dictionnaires $tabname[1] = MAIN_DB_PREFIX."c_forme_juridique"; @@ -65,6 +65,7 @@ $tabname[13]= MAIN_DB_PREFIX."c_paiement"; $tabname[14]= MAIN_DB_PREFIX."c_ecotaxe"; $tabname[15]= MAIN_DB_PREFIX."c_paper_format"; $tabname[16]= MAIN_DB_PREFIX."c_prospectlevel"; +$tabname[17]= MAIN_DB_PREFIX."c_type_fees"; // Libell� des dictionnaires $tablib[1] = $langs->trans("DictionnaryCompanyJuridicalType"); @@ -83,6 +84,7 @@ $tablib[13]= $langs->trans("DictionnaryPaymentModes"); $tablib[14]= $langs->trans("DictionnaryEcotaxe"); $tablib[15]= $langs->trans("DictionnaryPaperFormat"); $tablib[16]= $langs->trans("DictionnaryProspectLevel"); +$tablib[17]= $langs->trans("DictionnaryFees"); // Requete pour extraction des donn�es des dictionnaires $tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; @@ -101,6 +103,7 @@ $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as pays_id, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; +$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees"; // Critere de tri du dictionnaire $tabsqlsort[1] ="pays, code ASC"; @@ -119,7 +122,8 @@ $tabsqlsort[13]="code ASC"; $tabsqlsort[14]="pays, e.organization ASC, code ASC"; $tabsqlsort[15]="rowid ASC"; $tabsqlsort[16]="sortorder ASC"; - +$tabsqlsort[17]="code ASC"; + // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield[1] = "code,libelle,pays"; $tabfield[2] = "code,libelle,region_id,region"; // "code,libelle,region" @@ -137,8 +141,9 @@ $tabfield[13]= "code,libelle,type"; $tabfield[14]= "code,libelle,price,organization,pays_id,pays"; $tabfield[15]= "code,libelle,width,height,unit"; $tabfield[16]= "code,libelle"; +$tabfield[17]= "code,libelle"; -// Nom des champs d'�dition pour modification du dictionnaire +// Nom des champs d'edition pour modification du dictionnaire $tabfieldvalue[1] = "code,libelle,pays"; $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region" $tabfieldvalue[3] = "code,libelle,pays"; @@ -155,6 +160,7 @@ $tabfieldvalue[13]= "code,libelle,type"; $tabfieldvalue[14]= "code,libelle,price,organization,pays"; $tabfieldvalue[15]= "code,libelle,width,height,unit"; $tabfieldvalue[16]= "code,libelle"; +$tabfieldvalue[17]= "code,libelle"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert[1] = "code,libelle,fk_pays"; @@ -173,6 +179,7 @@ $tabfieldinsert[13]= "code,libelle,type"; $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays"; $tabfieldinsert[15]= "code,label,width,height,unit"; $tabfieldinsert[16]= "code,label"; +$tabfieldinsert[17]= "code,libelle"; // Nom du rowid si le champ n'est pas de type autoincr�ment $tabrowid[1] = ""; @@ -191,6 +198,7 @@ $tabrowid[13]= "id"; $tabrowid[14]= ""; $tabrowid[15]= ""; $tabrowid[16]= "code"; +$tabrowid[17]= "id"; // Condition to show dictionnary in setup page $tabcond[1] = true; @@ -209,6 +217,7 @@ $tabcond[13]= $conf->facture->enabled||$conf->fournisseur->enabled; $tabcond[14]= $conf->produit->enabled&&$conf->global->PRODUIT_USE_ECOTAXE; $tabcond[15]= true; $tabcond[16]= $conf->societe->enabled; +$tabcond[17]= $conf->deplacement->enabled; $msg=''; @@ -217,7 +226,7 @@ $sortfield=$_GET["sortfield"]; $sortorder=$_GET["sortorder"]; /* - * Actions ajout ou modification d'une entr�e dans un dictionnaire de donn�e + * Actions ajout ou modification d'une entree dans un dictionnaire de donnee */ if ($_POST["actionadd"] || $_POST["actionmodify"]) { @@ -397,28 +406,37 @@ if ($_GET["action"] == $acts[1]) // disable } - -llxHeader(); +/* + * View + */ $html = new Form($db); +llxHeader(); + $titre=$langs->trans("DictionnarySetup"); +$linkback=''; if ($_GET["id"]) { $titre.=' - '.$tablib[$_GET["id"]]; + $linkback=''.$langs->trans("BackToDictionnaryList").''; } -print_fiche_titre($titre,'','setup'); +print_fiche_titre($titre,$linkback,'setup'); -print $langs->trans("DictionnaryDesc"); -print " ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; -print "
\n"; +if (empty($_GET["id"])) +{ + print $langs->trans("DictionnaryDesc"); + print " ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; +} + print "
\n"; + /* * Confirmation de la suppression de la ligne */ if ($_GET['action'] == 'delete') { - $html = new Form($db); + $html = new Form($db); $html->form_confirm($_SERVER["PHP_SELF"].'?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$_GET["rowid"].'&code='.$_GET["code"].'&id='.$_GET["id"], $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete'); print '
'; } @@ -433,7 +451,7 @@ if ($_GET["id"]) print $msg.'
'; } - // Compl�te requete recherche valeurs avec critere de tri + // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$_GET["id"]]; if ($_GET["sortfield"]) { diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index a020b0a517c..e186eda2408 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -396,19 +396,21 @@ if ($_POST["cancel"] == $langs->trans("Cancel")) +/* + * View + */ + llxHeader("","","Fiche Mailing"); - -/* - * Mailing en mode création - * - */ +$html = new Form($db); $mil = new Mailing($db); + if ($_GET["action"] == 'create') { - print '
'."\n"; + // Mailing en mode création + print ''."\n"; print ''; print_titre($langs->trans("NewMailing")); @@ -446,8 +448,6 @@ if ($_GET["action"] == 'create') } else { - $html = new Form($db); - if ($mil->fetch($_GET["id"]) >= 0) { @@ -543,8 +543,8 @@ else // Message print ''.$langs->trans("MailMessage").''; - print ''; - print nl2br($mil->body); + print ''; + print dol_htmlentitiesbr($mil->body); print ''; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e523ac01824..fc0417aeb2c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -435,8 +435,10 @@ DictionnaryPaymentModes=Payments modes DictionnaryTypeContact=Contacts types DictionnaryEcotaxe=Ecotaxe (WEEE) DictionnaryPaperFormat=Paper formats +DictionnaryFees=Type of fees SetupSaved=Setup saved BackToModuleList=Back to modules list +BackToDictionnaryList=Back to dictionnaries list VATReceivedOnly=Special rate not billed VATManagement=VAT Management VATIsUsedDesc=The VAT rate by default when creating prospects, invoices, orders etc follow the active standard rule:
If the seller is subjected to VAT, then VAT by default=0. End of rule.
If the (selling country = buying country), then the VAT by default=VAT of the product in the selling country. End of rule.
If seller and buyer in the European Community and goods are sold having new means of transport (car, ship, plane), the default VAT=0 ( The VAT should be paid by the buyer at the customoffice of his country and not at the seller). End of rule.
If seller and buyer in the European Community and goods sold by other means rather than new means of transport, then the VAT by default=VAT of product sold. End of rule.
Else the proposed default VAT =1. End of rule. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index f8b4bcc9f82..854e0538441 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -433,8 +433,10 @@ DictionnaryPaymentModes=Modes de paiements DictionnaryTypeContact=Types de contacts DictionnaryEcotaxe=Barèmes Eco-participation (DEEE) DictionnaryPaperFormat=Format papiers +DictionnaryFees=Types de déplacement et notes de frais SetupSaved=Configuration sauvegardée BackToModuleList=Retour liste des modules +BackToDictionnaryList=Retour liste des dictionnaires VATReceivedOnly=Taux special non facturé VATManagement=Gestion 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:
Si vendeur non assujeti à TVA, TVA par défaut=0. Fin de règle.
Si le (pays vendeur = pays acheteur) alors TVA par défaut=TVA du produit vendu. Fin de règle.
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 acheteur au centre d'impots de son pays et non au vendeur). Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur = particulier ou entreprise sans num TVA intra alors TVA par défaut=TVA du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur = entreprise avec num TVA intra alors TVA par défaut=0. Fin de règle.
Sinon TVA proposée par défaut=0. Fin de règle.