From 83f394866c2b5e523cc58b065ed5b11f332f386f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 24 Jul 2007 15:14:12 +0000 Subject: [PATCH] =?UTF-8?q?Add:=20d=E9but=20ajout=20gestion=20des=20=E9co-?= =?UTF-8?q?taxes=20(DEEE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/dict.php | 91 +++++++++++++++++-------------- htdocs/admin/produit.php | 20 +++++++ htdocs/langs/en_US/admin.lang | 4 +- htdocs/langs/en_US/companies.lang | 3 +- htdocs/langs/fr_FR/admin.lang | 4 +- htdocs/langs/fr_FR/companies.lang | 3 +- mysql/data/data.sql | 16 ++++++ mysql/migration/2.1.0-2.2.0.sql | 20 +++++++ mysql/tables/llx_c_ecotaxe.sql | 32 +++++++++++ 9 files changed, 148 insertions(+), 45 deletions(-) create mode 100644 mysql/tables/llx_c_ecotaxe.sql diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index cc7eb491928..6ff68e6c5ab 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -50,7 +50,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,0,5,11,0,6,0,10,12,13,0,7); +$taborder=array(9,0,4,3,2,0,1,8,0,5,11,0,6,0,10,12,13,0,14,0,7); // Nom des tables des dictionnaires $tabname[1] = MAIN_DB_PREFIX."c_forme_juridique"; @@ -66,6 +66,7 @@ $tabname[10]= MAIN_DB_PREFIX."c_tva"; $tabname[11]= MAIN_DB_PREFIX."c_type_contact"; $tabname[12]= MAIN_DB_PREFIX."cond_reglement"; $tabname[13]= MAIN_DB_PREFIX."c_paiement"; +$tabname[14]= MAIN_DB_PREFIX."c_ecotaxe"; // Libellé des dictionnaires $tablib[1] = $langs->trans("DictionnaryCompanyJuridicalType"); @@ -81,6 +82,7 @@ $tablib[10]= $langs->trans("DictionnaryVAT"); $tablib[11]= $langs->trans("DictionnaryTypeContact"); $tablib[12]= $langs->trans("DictionnaryPaymentConditions"); $tablib[13]= $langs->trans("DictionnaryPaymentModes"); +$tablib[14]= $langs->trans("DictionnaryEcotaxe"); // 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"; @@ -94,8 +96,9 @@ $tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREF $tabsql[9] = "SELECT code, code_iso, label as libelle, active FROM ".MAIN_DB_PREFIX."c_currencies"; $tabsql[10]= "SELECT t.rowid, t.taux, p.libelle as pays, t.recuperableonly, t.note, t.active FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; -$tabsql[12]= "SELECT rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX."cond_reglement AS c"; +$tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX."cond_reglement AS c"; $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c"; +$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"; // Critere de tri du dictionnaire $tabsqlsort[1] ="pays, code ASC"; @@ -111,6 +114,7 @@ $tabsqlsort[10]="pays ASC, taux ASC, recuperableonly ASC"; $tabsqlsort[11]="element ASC, source ASC, code ASC"; $tabsqlsort[12]="sortorder ASC, code ASC"; $tabsqlsort[13]="code ASC"; +$tabsqlsort[14]="pays, e.organization ASC, code ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield[1] = "code,libelle,pays"; @@ -126,6 +130,7 @@ $tabfield[10]= "pays,taux,recuperableonly,note"; $tabfield[11]= "element,source,code,libelle"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfield[13]= "code,libelle,type"; +$tabfield[14]= "code,libelle,price,organization,pays_id,pays"; // Nom des champs d'édition pour modification du dictionnaire $tabfieldvalue[1] = "code,libelle,pays"; @@ -141,6 +146,7 @@ $tabfieldvalue[10]= "pays,taux,recuperableonly,note"; $tabfieldvalue[11]= "element,source,code,libelle"; $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfieldvalue[13]= "code,libelle,type"; +$tabfieldvalue[14]= "code,libelle,price,organization,pays"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert[1] = "code,libelle,fk_pays"; @@ -156,6 +162,7 @@ $tabfieldinsert[10]= "fk_pays,taux,recuperableonly,note"; $tabfieldinsert[11]= "element,source,code,libelle"; $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfieldinsert[13]= "code,libelle,type"; +$tabfieldinsert[14]= "code,libelle,price,organization,fk_pays"; // Nom du rowid si le champ n'est pas de type autoincrément $tabrowid[1] = ""; @@ -171,6 +178,7 @@ $tabrowid[10]= ""; $tabrowid[11]= "rowid"; $tabrowid[12]= "rowid"; $tabrowid[13]= "id"; +$tabrowid[14]= ""; // Condition to show dictionnary in setup page $tabcond[1] = $conf->societe->enabled; @@ -186,6 +194,7 @@ $tabcond[10]= true; $tabcond[11]= true; $tabcond[12]= $conf->facture->enabled||$conf->fournisseur->enabled; $tabcond[13]= $conf->facture->enabled||$conf->fournisseur->enabled; +$tabcond[14]= $conf->produit->enabled&&$conf->global->PRODUIT_USE_ECOTAXE; $msg=''; @@ -198,6 +207,8 @@ $sortfield=$_GET["sortfield"]; if ($_POST["actionadd"] || $_POST["actionmodify"]) { $listfield=split(',',$tabfield[$_POST["id"]]); + $listfieldmodify=split(',',$tabfieldinsert[$_POST["id"]]); + $listfieldvalue=split(',',$tabfieldvalue[$_POST["id"]]); // Verifie que tous les champs sont renseignés $ok=1; @@ -244,14 +255,15 @@ if ($_POST["actionadd"] || $_POST["actionmodify"]) if ($tabrowid[$_POST["id"]] && ! in_array($tabrowid[$_POST["id"]],$listfield)) $sql.= $newid.","; $i=0; - foreach ($listfield as $f => $value) { - if ($i) $sql.=","; - $sql.="'".addslashes($_POST[$value])."'"; - $i++; + foreach ($listfieldmodify as $f => $value) { + if ($value == 'price') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } + if ($i) $sql.=","; + $sql.="'".addslashes($_POST[$listfieldvalue[$i]])."'"; + $i++; } $sql.=",1)"; - dolibarr_syslog("dict actionadd sql=".$sql); + dolibarr_syslog("dict actionadd sql=".$sql); $result = $db->query($sql); if (!$result) { @@ -269,10 +281,6 @@ if ($_POST["actionadd"] || $_POST["actionmodify"]) if ($tabrowid[$_POST["id"]]) { $rowidcol=$tabrowid[$_POST["id"]]; } else { $rowidcol="rowid"; } - // on utilise les champs d'insertion pour effectuer la modification - $listfieldmodify=split(',',$tabfieldinsert[$_POST["id"]]); - $listfieldvalue=split(',',$tabfieldvalue[$_POST["id"]]); - // Modify entry $sql = "UPDATE ".$tabname[$_POST["id"]]." SET "; // Modifie valeur des champs @@ -282,16 +290,10 @@ if ($_POST["actionadd"] || $_POST["actionmodify"]) $sql.= "'".addslashes($_POST["rowid"])."', "; } $i = 0; - foreach ($listfieldmodify as $field) { - if ($i > 0) - { - $sql.= ", "; - } - + if ($i) $sql.=","; $sql.= $field."="; $sql.= "'".addslashes($_POST[$listfieldvalue[$i]])."'"; - $i++; } $sql.= " WHERE ".$rowidcol." = '".$_POST["rowid"]."'"; @@ -435,18 +437,20 @@ if ($_GET["id"]) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de données $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut - if ($fieldlist[$field]=='source') $valuetoshow=$langs->trans("Contact"); - if ($fieldlist[$field]=='lang') $valuetoshow=$langs->trans("Language"); - if ($fieldlist[$field]=='type') $valuetoshow=$langs->trans("Type"); - if ($fieldlist[$field]=='code') $valuetoshow=$langs->trans("Code"); - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $valuetoshow=$langs->trans("Label")."*"; - if ($fieldlist[$field]=='libelle_facture') $valuetoshow=$langs->trans("LabelOnDocuments")."*"; - if ($fieldlist[$field]=='pays') $valuetoshow=$langs->trans("Country"); - if ($fieldlist[$field]=='recuperableonly') $valuetoshow=MENTION_NPR; - if ($fieldlist[$field]=='nbjour') $valuetoshow=$langs->trans("NbOfDays"); - if ($fieldlist[$field]=='fdm') $valuetoshow=$langs->trans("AtEndOfMonth"); - if ($fieldlist[$field]=='decalage') $valuetoshow=$langs->trans("Offset"); - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') $valuetoshow=''; + if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } + if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } + if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); } + if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } + if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } + if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; } + if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } + if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); } + if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MENTION_NPR; } + if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } + if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); } + if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); } + if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; } if ($valuetoshow != '') { @@ -493,6 +497,8 @@ if ($_GET["id"]) $showfield=1; // Par defaut $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } + if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } + if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } @@ -533,24 +539,24 @@ if ($_GET["id"]) else { foreach ($fieldlist as $field => $value) - { - $showfield=1; + { + $showfield=1; $valuetoshow=$obj->$fieldlist[$field]; if ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); } - if ($fieldlist[$field]=='recuperableonly') { + if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm') { $valuetoshow=yn($valuetoshow); } - if ($fieldlist[$field]=='fdm') { - $valuetoshow=yn($valuetoshow); + if ($fieldlist[$field]=='price') { + $valuetoshow=price($valuetoshow); } if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; } - if ($showfield) print ''.$valuetoshow.''; - } + if ($showfield) print ''.$valuetoshow.''; + } print ''; // Est-ce une entrée du dictionnaire qui peut etre désactivée ? @@ -642,8 +648,8 @@ function fieldList($fieldlist,$obj='') print ''; } elseif ($fieldlist[$field] == 'pays_id') { - $pays_id = $obj->$fieldlist[$field]; - print ''; + $pays_id = $obj->$fieldlist[$field]?$obj->$fieldlist[$field]:0; + print ''; } elseif ($fieldlist[$field] == 'region') { print ''; @@ -651,8 +657,8 @@ function fieldList($fieldlist,$obj='') print ''; } elseif ($fieldlist[$field] == 'region_id') { - $region_id = $obj->$fieldlist[$field]; - print ''; + $region_id = $obj->$fieldlist[$field]?$obj->$fieldlist[$field]:0; + print ''; } elseif ($fieldlist[$field] == 'lang') { print ''; @@ -699,6 +705,9 @@ function fieldList($fieldlist,$obj='') elseif ($fieldlist[$field] == 'nbjour' || $fieldlist[$field] == 'decalage' || $fieldlist[$field] == 'taux') { print ''; } + elseif ($fieldlist[$field] == 'price') { + print ''; + } else { print ''; diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 36475c8cd7d..f694141a2f4 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -144,6 +144,12 @@ else if ($_GET["action"] == 'set') Header("Location: produit.php"); exit; } +else if ($_POST["action"] == 'useecotaxe') +{ + dolibarr_set_const($db, "PRODUIT_USE_ECOTAXE", $_POST["activate_useecotaxe"]); + Header("Location: produit.php"); + exit; +} /* @@ -275,6 +281,20 @@ if ($conf->global->PRODUIT_CHANGE_PROD_DESC == 0) print ''; } +// Utilisation de l'écotaxe +$var=!$var; +print "
"; +print ""; +print ""; +print ''.$langs->trans("UseEcoTaxeAbility").''; +print ''; +print $html->selectyesno("activate_useecotaxe",$conf->global->PRODUIT_USE_ECOTAXE,1); +print ''; +print ''; +print ""; +print ''; +print '
'; + print ''; print " ".$langs->trans("ProductSpecial")."\n"; print " ".$langs->trans("Value")."\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ef8f2ea127f..25edae254c4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -20,7 +20,6 @@ ErrorDecimalLargerThanAreForbidden=Error, precision higher than %s are no DictionnarySetup=Dictionnary setup DisableJavascript=Disable JavaScript functions DisableAjax=Disable AJAX functions -UseSearchToSelectProduct=Use a search form to choose a product (intead of using a list box) UseSearchToSelectProduct=Use a search form to choose a company (intead of using a list box) NotAvailableWhenAjaxDisabled=Not available when Ajax disabled JavascriptDisabled=JavaScript disabled @@ -349,6 +348,7 @@ DictionnaryVAT=VAT Rates DictionnaryPaymentConditions=Payments conditions DictionnaryPaymentModes=Payments modes DictionnaryTypeContact=Contacts types +DictionnaryEcotaxe=Ecotaxe (WEEE) VATReceivedOnly=Special rate not billed VATManagement=VAT Management 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 en vigueur:
Si vendeur non assujeti à TVA, TVA par défaut=0. Fin de règle.
Si le (pays vendeur = pays acheteur) alors la TVA par défaut=TVA du produit dans le pays du vendeur. 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 l'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 bien vendu autre que transport neuf alors la TVA par défaut=TVA du produit vendu. Fin de règle.
Sinon la TVA proposée par défaut=0. Fin de règle. @@ -680,6 +680,8 @@ NumberOfProductShowInSelect=Max number of products in combos select lists (0=no ConfirmDeleteProductLineAbility=Confirmation of removal of a line produces in the forms ModifyProductDescAbility=Personalization of descriptions produced in the forms ViewProductDescInFormAbility=Visualization of descriptions produced in the forms +UseSearchToSelectProduct=Use a search form to choose a product (intead of using a list box) +UseEcoTaxeAbility=Support Eco-Taxe (WEEE) ##### Syslog ##### SyslogSetup=Syslog module setup SyslogOutput=Log output diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index baa3f2b77a8..efa91af817b 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -221,4 +221,5 @@ DeleteFile=Delete file ConfirmDeleteFile=Are you sure you want to delete this file? AllocateCommercial=Allocate a commercial SelectCountry=Select a country -SelectCompany=Select a third party \ No newline at end of file +SelectCompany=Select a third party +Organization=Organisme \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index f60cbe3075f..4a8666bb4d9 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -20,7 +20,6 @@ ErrorDecimalLargerThanAreForbidden=Erreur, les pr DictionnarySetup=Dictionnaires DisableJavascript=Désactiver les fonctions javascript DisableAjax=Désactiver les fonctions ajax -UseSearchToSelectProduct=Utiliser un formulaire de recherche pour choix d'un produit (plutôt que liste déroulante) UseSearchToSelectCompany=Utiliser un formulaire de recherche pour choix d'un tiers (plutôt que liste déroulante) NotAvailableWhenAjaxDisabled=Non disponible quand Ajax désactivé JavascriptDisabled=Javascript désactivé @@ -351,6 +350,7 @@ DictionnaryVAT=Taux de TVA DictionnaryPaymentConditions=Conditions de paiements DictionnaryPaymentModes=Modes de paiements DictionnaryTypeContact=Types de contacts +DictionnaryEcotaxe=Barèmes Eco-participation (DEEE) 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.
@@ -682,6 +682,8 @@ NumberOfProductShowInSelect=Nombre de produits max dans les listes d ConfirmDeleteProductLineAbility=Confirmation de suppression d'une ligne produit dans les formulaires ModifyProductDescAbility=Personnalisation des descriptions produits dans les formulaires ViewProductDescInFormAbility=Visualisation des descriptions produits dans les formulaires +UseSearchToSelectProduct=Utiliser un formulaire de recherche pour choix d'un produit (plutôt que liste déroulante) +UseEcoTaxeAbility=Prise en charge des éco-taxes (DEEE) ##### Syslog ##### SyslogSetup=Configuration du module Syslog SyslogOutput=Sortie des log diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index a67cd1a7a8b..c7899f594a1 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -224,4 +224,5 @@ DeleteFile=Suppression d'un fichier ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier ? AllocateCommercial=Affecter un commercial SelectCountry=Sélectionner un pays -SelectCompany=Sélectionner un tiers \ No newline at end of file +SelectCompany=Sélectionner un tiers +Organization=Organisme \ No newline at end of file diff --git a/mysql/data/data.sql b/mysql/data/data.sql index 7ba08c4b917..7a6f2df4ca7 100644 --- a/mysql/data/data.sql +++ b/mysql/data/data.sql @@ -1521,3 +1521,19 @@ insert into `llx_menu_const` (`rowid`, `fk_menu`, `fk_constraint`, `user`) value insert into `llx_menu_const` (`rowid`, `fk_menu`, `fk_constraint`, `user`) values (112, 4901, 6, 2); insert into `llx_menu_const` (`rowid`, `fk_menu`, `fk_constraint`, `user`) values (113, 5000, 26, 2); insert into `llx_menu_const` (`rowid`, `fk_menu`, `fk_constraint`, `user`) values (114, 5001, 6, 2); + +-- +-- Eco-Taxes +-- + +-- France (Organisme ERP) +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (1, 'PAM-A', 'Matériels électriques < 0,2kg', 0.01000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (2, 'PAM-B', 'Matériels électriques >= 0,2 kg et < 0,5 kg', 0.03000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (3, 'PAM-C', 'Matériels électriques >= 0,5 kg et < 1 kg', 0.04000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (4, 'PAM-D', 'Matériels électriques >= 1 kg et < 2 kg', 0.13000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (5, 'PAM-E', 'Matériels électriques >= 2 kg et < 4kg', 0.21000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (6, 'PAM-F', 'Matériels électriques >= 4 kg et <8 kg', 0.42000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (7, 'PAM-G', 'Matériels électriques >= 8 kg et < 15 kg', 0.84000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (8, 'PAM-H', 'Matériels électriques >= 15 kg et < 20 kg', 1.25000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (9, 'PAM-I', 'Matériels électriques >= 20 kg et <30 kg', 1.88000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (10, 'PAM-J', 'Matériels électriques >= 30 kg', 3.34000000, 'ERP', 1, 1); \ No newline at end of file diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 0fea644a936..0d41185ec66 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -755,4 +755,24 @@ update llx_fichinter set tms=date_valid where tms < date_valid; ALTER TABLE llx_commande_fournisseur DROP INDEX ref; ALTER TABLE llx_commande_fournisseur ADD UNIQUE INDEX uk_commande_fournisseur_ref (ref, fk_soc); +create table llx_c_ecotaxe +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + code varchar(64) NOT NULL, + libelle varchar(256), + price double(16,8), + organization varchar(256), + fk_pays integer NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)type=innodb; +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (1, 'PAM-A', 'Matériels électriques < 0,2kg', 0.01000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (2, 'PAM-B', 'Matériels électriques >= 0,2 kg et < 0,5 kg', 0.03000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (3, 'PAM-C', 'Matériels électriques >= 0,5 kg et < 1 kg', 0.04000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (4, 'PAM-D', 'Matériels électriques >= 1 kg et < 2 kg', 0.13000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (5, 'PAM-E', 'Matériels électriques >= 2 kg et < 4kg', 0.21000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (6, 'PAM-F', 'Matériels électriques >= 4 kg et <8 kg', 0.42000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (7, 'PAM-G', 'Matériels électriques >= 8 kg et < 15 kg', 0.84000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (8, 'PAM-H', 'Matériels électriques >= 15 kg et < 20 kg', 1.25000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (9, 'PAM-I', 'Matériels électriques >= 20 kg et <30 kg', 1.88000000, 'ERP', 1, 1); +INSERT INTO `llx_c_ecotaxe` (`rowid`, `code`, `libelle`, `price`, `organization`, `fk_pays`, `active`) VALUES (10, 'PAM-J', 'Matériels électriques >= 30 kg', 3.34000000, 'ERP', 1, 1); \ No newline at end of file diff --git a/mysql/tables/llx_c_ecotaxe.sql b/mysql/tables/llx_c_ecotaxe.sql new file mode 100644 index 00000000000..04d538224d8 --- /dev/null +++ b/mysql/tables/llx_c_ecotaxe.sql @@ -0,0 +1,32 @@ +-- ======================================================================== +-- Copyright (C) 2007 Régis Houssin +-- +-- $Id$ +-- $Source$ +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_ecotaxe +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + code varchar(64) NOT NULL, -- Code servant à la traduction et à la référence interne + libelle varchar(256), -- Description + price double(16,8), -- Montant HT + organization varchar(256), -- Organisme gérant le barème tarifaire + fk_pays integer NOT NULL, -- Pays correspondant + active tinyint DEFAULT 1 NOT NULL +)type=innodb; \ No newline at end of file